Hi Mateusz,
[quote="SMesserschmidt"]
When you use instanced drawing you cannot have correct semi-transparent
objects, as there is no sorting involved.
One option is to sort your instanced obejcts in every frame or to use some
order independent transparency approach.
[quote]
Could You provide me avaiable techniques in OSG that allow me to introduce
objects sorting for native OSG objects and instanced ones?
Sorting per object will be done by the scene graph automatically if the
stateset contains blending ( @All please correct me here, but I'm not
sure about all the details).
Usually this is done with DepthSortedBin Renderbin implementation, which
you can override and even write your own Renderbin implementation.
For starters just rely on the automatic sorting, but beware that is per
drawable not per face. So having a semitransparent box will not always
result in the desired behavior.
This is a complicated topic and there is no general solution to this. If
you want to dive deeper into order independent blending look into the
examples (osgoit) and look in the mailing list archives/forum. The
topic was touch not long ago.
In case of instanced drawing (in case you are using real GPU instancing)
there is no ready-to-use implementation, at least non that i know off.
I'd start with adding a (cull-)callback to the part which defines your
texture/buffer object and implement a kind of sorting based on distance
to the camera.
It might very well be that there is flaw in my idea, but since I didn't
have to solve such problem I leave the experimenting to you.
In general I would say that sorting/semitransparent objects and
instancing simply doesn't play well, so maybe you should step back and
check if you really need instancing here at all.
cheers
Sebastian
Thank you!
Cheers,
Mateusz
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=56360#56360
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org