Hi Robert,
 
> The most general approach is the best, and the performance differences> will 
> almost certainly be negligible between your suggest> SwitchStateSetNode and 
> my suggest Layer node with nodemask. Feel free> to implement both and test 
> them against each other w.r.t cull> traversal time and overall framerate.> 
I implemented the LayerNode approach and tested both versions using a composite 
viewer.
The StateSetSwitchNode is a tiny bit faster as predicted, but I agree with you 
that the difference is negligible.
The other penalty that I worte about earlier is however large.
My scene:==========- My scene contains 40308 nodes. - A full traverse results 
in visiting 380941 nodes (lot of reused geometry).
 
Pre-processing the scene with 
LayerNodes:==========================================- 2356 LayerNodes are 
inserted.   - Each LayerNode is one Group node with 5 child Group nodes.   - 
Each child node share the same children as the other child nodes.- I apply 
optimizations from osgUtil::Optimizer.- Result:   - 54444 nodes totally in the 
scene.   - 11446441 visits during a full traverse.
 
Pre-processing the scene with 
StateSetSwitchNode:==================================================- 2356 
StateSetSwitchNodes are inserted.   - This is one Group node that has 5 Group 
nodes embedded.   - All 5 embedded nodes share the same children as the 
StateSetSwitchNode.   - None of the 5 embedded nodes has any parents.- I use 
the same optimizations as above.- Result:   - 42664 nodes totally in the scene. 
  - 540844 visits during a full traverse.
 
The penalty:=============Our viewer is a osgViewer::CompositeViewer.Calling the 
run function of the osgViewer::CompositeViewer is quite dramatically different 
from the LayerNode to the StateSetSwitchNode approach.The LayerNode approach 
use approximately 20 times longer time from we call run until the scene appears 
on screen.11446441 divided by 540844 = 21.
 
Conclusion after this testing:===============================- We do not need 
the StateSetSwitchNode if the viewer initialization penalty is somehow fixed.
New questions:===============- What does the osgViewer::CompositeViewer do when 
we call run and until render starts?- Is this something that would be possible 
to do in a pre-processor and save in a .ive file?- Other ways to get around 
this problem?
 
 
Regards,Viggo
_________________________________________________________________
Hold kontakten med Windows Live Messenger.
http://clk.atdmt.com/GBL/go/msnnkdre0010000003gbl/direct/01/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to