Do not let OSG cull lights away
This commit is contained in:
@@ -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<SGLight *>(&node);
|
||||
if (!light) {
|
||||
CullVisitor::apply(node);
|
||||
return;
|
||||
}
|
||||
_lightList.push_back(light);
|
||||
if (light)
|
||||
_lightList.push_back(light);
|
||||
}
|
||||
|
||||
void EffectCullVisitor::apply(osg::Geode& node)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user