diff --git a/simgear/scene/material/EffectCullVisitor.cxx b/simgear/scene/material/EffectCullVisitor.cxx index b25012a0..e8750d86 100644 --- a/simgear/scene/material/EffectCullVisitor.cxx +++ b/simgear/scene/material/EffectCullVisitor.cxx @@ -55,14 +55,10 @@ CullVisitor* EffectCullVisitor::clone() const void EffectCullVisitor::apply(osg::Node &node) { // TODO: Properly cull lights outside the viewport (override computeBounds()) - // if (isCulled(node)) - // return; + CullVisitor::apply(node); SGLight *light = dynamic_cast(&node); - if (!light) { - CullVisitor::apply(node); - return; - } - _lightList.push_back(light); + if (light) + _lightList.push_back(light); } void EffectCullVisitor::apply(osg::Geode& node) diff --git a/simgear/scene/model/SGLight.cxx b/simgear/scene/model/SGLight.cxx index a56bf1a7..29602af4 100644 --- a/simgear/scene/model/SGLight.cxx +++ b/simgear/scene/model/SGLight.cxx @@ -165,6 +165,9 @@ SGLight::SGLight() : _quadratic_attenuation = 0.0f; _spot_exponent = 0.0f; _spot_cutoff = 180.0f; + // Do not let OSG cull lights by default, we usually leave that job to + // other algorithms, like clustered shading. + setCullingActive(false); } SGLight::~SGLight()