diff --git a/apps/opencs/view/render/mask.hpp b/apps/opencs/view/render/mask.hpp index 984dccae4..d2dfef7b4 100644 --- a/apps/opencs/view/render/mask.hpp +++ b/apps/opencs/view/render/mask.hpp @@ -20,6 +20,8 @@ namespace CSVRender // used within models Mask_ParticleSystem = 0x100, + Mask_Lighting = 0x200, + // control elements Mask_CellMarker = 0x10000, Mask_CellArrow = 0x20000, diff --git a/apps/opencs/view/render/object.cpp b/apps/opencs/view/render/object.cpp index f202be4bc..1821da059 100644 --- a/apps/opencs/view/render/object.cpp +++ b/apps/opencs/view/render/object.cpp @@ -120,7 +120,7 @@ void CSVRender::Object::update() static float linearRadiusMult = fallback->getFallbackFloat("LightAttenuation_LinearRadiusMult"); static float linearValue = fallback->getFallbackFloat("LightAttenuation_LinearValue"); bool isExterior = false; // FIXME - SceneUtil::addLight(mBaseNode, light, Mask_ParticleSystem, ~0u, isExterior, outQuadInLin, useQuadratic, + SceneUtil::addLight(mBaseNode, light, Mask_ParticleSystem, Mask_Lighting, isExterior, outQuadInLin, useQuadratic, quadraticValue, quadraticRadiusMult, useLinear, linearRadiusMult, linearValue); } } diff --git a/apps/opencs/view/render/scenewidget.cpp b/apps/opencs/view/render/scenewidget.cpp index c51b22e09..e5b9171e0 100644 --- a/apps/opencs/view/render/scenewidget.cpp +++ b/apps/opencs/view/render/scenewidget.cpp @@ -67,6 +67,7 @@ RenderWidget::RenderWidget(QWidget *parent, Qt::WindowFlags f) SceneUtil::LightManager* lightMgr = new SceneUtil::LightManager; lightMgr->setStartLight(1); + lightMgr->setLightingMask(Mask_Lighting); mRootNode = lightMgr; mView->getCamera()->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON); @@ -96,7 +97,7 @@ void RenderWidget::flagAsModified() void RenderWidget::setVisibilityMask(int mask) { - mView->getCamera()->setCullMask(mask | Mask_ParticleSystem); + mView->getCamera()->setCullMask(mask | Mask_ParticleSystem | Mask_Lighting); } bool RenderWidget::eventFilter(QObject* obj, QEvent* event) diff --git a/components/sceneutil/lightutil.cpp b/components/sceneutil/lightutil.cpp index 725157e23..6499c54b1 100644 --- a/components/sceneutil/lightutil.cpp +++ b/components/sceneutil/lightutil.cpp @@ -39,7 +39,7 @@ namespace SceneUtil } - void addLight (osg::Group* node, const ESM::Light* esmLight, int partsysMask, int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, + void addLight (osg::Group* node, const ESM::Light* esmLight, unsigned int partsysMask, unsigned int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, float linearValue) { diff --git a/components/sceneutil/lightutil.hpp b/components/sceneutil/lightutil.hpp index f7879cd72..810ffa318 100644 --- a/components/sceneutil/lightutil.hpp +++ b/components/sceneutil/lightutil.hpp @@ -23,7 +23,7 @@ namespace SceneUtil /// @param lightMask Mask to assign to the newly created LightSource. /// @param isExterior Is the light outside? May be used for deciding which attenuation settings to use. /// @par Attenuation parameters come from the game INI file. - void addLight (osg::Group* node, const ESM::Light* esmLight, int partsysMask, int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, + void addLight (osg::Group* node, const ESM::Light* esmLight, unsigned int partsysMask, unsigned int lightMask, bool isExterior, bool outQuadInLin, bool useQuadratic, float quadraticValue, float quadraticRadiusMult, bool useLinear, float linearRadiusMult, float linearValue);