Our cull visitor no longer collects light sources by default
This commit is contained in:
parent
b62808bb4c
commit
5a2c348b12
@ -54,11 +54,14 @@ CullVisitor* EffectCullVisitor::clone() const
|
||||
|
||||
void EffectCullVisitor::apply(osg::Node &node)
|
||||
{
|
||||
// TODO: Properly cull lights outside the viewport (override computeBounds())
|
||||
CullVisitor::apply(node);
|
||||
if (_collectLights) {
|
||||
// TODO: Properly cull lights outside the viewport
|
||||
// (override computeBounds() in SGLight)
|
||||
SGLight *light = dynamic_cast<SGLight *>(&node);
|
||||
if (light)
|
||||
_lightList.push_back(light);
|
||||
}
|
||||
}
|
||||
|
||||
void EffectCullVisitor::apply(osg::Geode& node)
|
||||
|
@ -284,7 +284,7 @@ Compositor::addPass(Pass *pass)
|
||||
identifier = sceneView->getCullVisitor()->getIdentifier();
|
||||
|
||||
sceneView->setCullVisitor(
|
||||
new EffectCullVisitor(false, pass->effect_scheme));
|
||||
new EffectCullVisitor(pass->collect_lights, pass->effect_scheme));
|
||||
sceneView->getCullVisitor()->setIdentifier(identifier.get());
|
||||
|
||||
identifier = sceneView->getCullVisitorLeft()->getIdentifier();
|
||||
|
@ -682,8 +682,10 @@ public:
|
||||
const SGPropertyNode *p_clustered = root->getNode("clustered-shading");
|
||||
ClusteredShading *clustered = nullptr;
|
||||
if (p_clustered) {
|
||||
if (checkConditional(p_clustered))
|
||||
if (checkConditional(p_clustered)) {
|
||||
clustered = new ClusteredShading(camera, p_clustered);
|
||||
pass->collect_lights = true;
|
||||
}
|
||||
}
|
||||
|
||||
camera->setCullCallback(new SceneCullCallback(clustered));
|
||||
|
@ -48,6 +48,7 @@ class Compositor;
|
||||
*/
|
||||
struct Pass : public osg::Referenced {
|
||||
Pass() :
|
||||
collect_lights(false),
|
||||
useMastersSceneData(true),
|
||||
cull_mask(0xffffff),
|
||||
inherit_cull_mask(false),
|
||||
@ -57,6 +58,7 @@ struct Pass : public osg::Referenced {
|
||||
int render_order;
|
||||
std::string name;
|
||||
std::string type;
|
||||
bool collect_lights;
|
||||
std::string effect_scheme;
|
||||
osg::ref_ptr<osg::Camera> camera;
|
||||
bool useMastersSceneData;
|
||||
|
Loading…
Reference in New Issue
Block a user