From b9911da4c799984c639102e5dcae133bd52ce378 Mon Sep 17 00:00:00 2001 From: Bo Svensson <90132211+bosvensson1@users.noreply.github.com> Date: Sun, 31 Oct 2021 12:03:42 +0000 Subject: [PATCH] applies lightMask (#3201) With this PR we apply `lightMask` to a `Transform` node we create specifically for a light. This mask will allow us to stop traversing such nodes sooner and avoid costly processing associated with `Transform` nodes in the cull visitor. --- components/sceneutil/lightutil.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/components/sceneutil/lightutil.cpp b/components/sceneutil/lightutil.cpp index 6a1a1376ec..2a5a945558 100644 --- a/components/sceneutil/lightutil.cpp +++ b/components/sceneutil/lightutil.cpp @@ -79,6 +79,7 @@ namespace SceneUtil // PositionAttitudeTransform seems to be slightly faster than MatrixTransform osg::ref_ptr trans(new SceneUtil::PositionAttitudeTransform); trans->setPosition(computeBound.getBoundingBox().center()); + trans->setNodeMask(lightMask); node->addChild(trans);