[osg-users] design issues

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Wed Nov 2 15:25:17 PDT 2016


Hi Community,

I am trying to optimize the rendering. Getting huge update numbers.

The story is this:
My scene has huge number of lights, some are static (streetlights) some
dynamic (a car). The lighting engine needs the World matrix of a
LightSource and the ViewMatrix (which is the same as the World inverse just
with some extra rotation). In my code after the update before the rendering
traversal I am updating these matrices each frame and I am about to place
this code in my custom CullVisitor (which traverse the scene anyway but
only the active children).

Here is my approach at the moment: list of light entities and here is how I
am computing these:
http://pastebin.com/0A64sc7Y
Simply getting the NodePath and computing the world matrix from this node
path. This seams to be costly

I am after wiser optimization, to place this in my CullVistor: Here is the
snippet:
http://pastebin.com/6dQnih8N

These snippets are simple and I would like to ask if this is more proper
way, which it seams to me since I will gain more performance by updating
only the culled and active nodes. Also the math in the cull visitor.

Thanks a lot for any hints, ideas. As always :-)

Cheers,
Nick

-- 
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161102/d8ff7749/attachment-0002.htm>


More information about the osg-users mailing list