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