Hello Victor,
On 09/05/2012 03:21 AM, Victor Haefner wrote:
> I am using planes with partialy transparent textures.
>
> When looking at them with a certain angle I get artifacts (see attachment).
> The planes have a small offset in y direction between each other.
>
> First I had the problem that they would not render over the room
> geometry, the walls and floor are one big object I import from a collada
> file.
> I solved this with
> mat->setSortKey(1); //SimpleTexturedMaterial from the planes
>
> It is my first time messing with alpha sort..
> I read bits and pieces somewhere that normally the objects are sorted by
> their geometric center? or position? or material?
blending in OpenGL only produces the expected results if primitives (!)
are rendered in a defined order by depth (usually back to front),
because blending is an operation between the current content of the
framebuffer and the incoming fragment.
Sorting at the primitive level is prohibitively expensive [1], so OpenSG
sorts at the object level as an approximation. All opaque objects are
rendered first (sorted to reduce state changes), then transparent
objects are rendered sorted by the eye space Z of the center of their
bounding box. Therefore to get correct sorting for parallel planes they
must be different objects (i.e. Geometries).
Cheers,
Carsten
[1] there are techniques to get order independent transparency (OIT),
depth peeling (and variations of it) and A-Buffers are two examples.
They tend to be expensive as well, and since they rely on shaders are
not trivial to integrate into a general purpose system.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users