Hi Antonio,

Antonio Bleile wrote:
> Carsten Neumann wrote:
>> Your scene does not build up gradually, because it is not rendered in 
>> immediate mode. Instead the renderaction builds a tree where geometry is 
>> sorted by transparency/non-transparency and then by material so that 
>> geometry with identical material is drawn at once.
> 
> Well actually it would be sufficient to get back a list of (sorted) 
> transparent objects with their respective transformation matrix in
> order to render those objects separately "by hand". I guess the matrix
> could be retrieved with getToWorld, but do I get the correctly depth
> sorted object list if I push back the geometry into a vector each time
> the enter function gets called?

no, the traversal of the scenegraph is a straightforward depth first and 
does not care about the spatial position of objects. However, if you 
store a pair<GeometryPtr, Real32> were the Real32 is the distance from 
the camera (i.e. its beacon) into a std::priority_queue with a suitable 
sorting functor you'll get depth sorted geometry.
For efficiency reason you also would want to use the RenderActions 
matrix stack' top matrix to avoid the expensive accumulation of the 
getToWorld matrix.
I think you'd then only have to be clever with foregrounds to prevent 
them being drawn before you have rendered your transparent objects by 
hand, but otherwise this should work, I think.

        Hope it helps,
                Carsten

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to