Hi Björn,
Hello,
firstly, I have the document "OpenSG: Basic Concepts",
which is from 2002. Is there a newer version of that
paper and where can I find it?
Secondly, I saw that the features list at OpenSG.org
where it says "State Sorting: To efficiently use
graphics hardware, the OpenGL state has to be changed
as rarely as possible. Sorting the visible objects by
state is the main way to do that."
If I take a look at OSGRenderAction.cpp, I can't see
that. I understand that the following is going on:
RenderAction traverses the scenegraph to build its
drawtree. Functors and geometries are dropped in
according to the traversal order. If their material
already exists in a map, the new drawtreenode is
simply <u>appended</u> to the node list of the
material.
When the frame is rendered, State::changeFrom is used;
but the order in which the states come in still
depends on the order the drawtreenodes have been
appended in the drop* methods (and yes, the sort key,
which has to be explicitly set by the user).
Yes.
In other words: I have two material instances A and B
which produce exactly the same state, but A is used in
a geometry somewhere where the traversal arrives
quickly and B somewhere where the traversal arrives at
the end. Additionally A was the first material ever
created, then a thousand others, then B, so they will
probably not lie beside each other in the material
map, which is apparently sorted by addresses. Then the
rendering of A objects happens a long time before that
of B objects, altough their states are exactly the
same.
Am I missing a point? Maybe I do not correctly
understand the wording of the feature phrase.
No that's correct. If you have duplicated materials you can't eliminate
these in the render action. Ok you could do this but this would be
really slow. For example take a material with a texture you need to
compare each texture pixel ... The render action just eliminates the
state switches beetween the same material instance. You should optimize
your scene before with the GraphOp's to get rid of the duplicated materials.
Andreas
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users