Hello Mathias,
Mathias Wagner wrote:
> Hello everyone,
>
> I have a problem with sorting of transparent primitives.
> There are three transparent objects behind the other - two arrows
> (consists of one cylinder and one cone) and one plane in the middle
> (always with same small distance to both arrows). If I move both arrows
> (one is always completely in front and the other one is always
> completely behind of the plane) there are unpredictable effects. In
> dependency of the position of both arrows sometimes are all parts of
> both arrows rendered, sometimes only one cone, or two cylinders and only
> one cone, … .
> How can I avoid this problem (without sorting manually)?
OpenSG renders transparent objects (i.e. Geometry) from back to front,
using the center of the bounding box as the point of reference to
compute distance from the camera. Within a single Geometry no sorting of
the individual triangles happens. Looking at the images you sent (BTW
thanks these are very helpful), this seems to work as expected, although
I can see why it is not what you want ;)
To manually control the drawing order of objects, you can assign a sort
key (Material::setSortKey) to the material. Drawing happens from smaller
to larger keys, with the default key being 0.
Hope it helps,
Carsten
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users