Hi Dirk,

On Wed, 29 Oct 2003, Dirk Reiners wrote:

> In general intersecting transparent polygons are pretty hard in OpenGL.
> You have to split them across the intersection line and draw them
> separately. But your polygons are not really transparent, you're just
> using an alpha key, which does work with intersecting polygons.

You're right, I just need an alpha key, that's why I was kinda surprised
it just didn't work. :) Of course I haven't done this kind of stuff with
VRML and OpenSG before so I didn't know if it's the fault of the loader,
OpenSG or something completely different. :)

> So here's what you can do: call renderact->setZWriteTrans(true); on your
> RenderAction to make the transparent polygons change the Z-Buffer or
> change the BlendChunk to use an alpha key (setAlphaFunc(GL_NOTEQUAL);
> setAlphaValue(0);).

Both of these sound good. Can you comment on the performance hit of these
methods? I guess the first one shouldn't be a big hit since it's just a
few additional OpenGL calls when constructing the display-lists for the
transparent geometries. Actually since I write to the zbuffer anyway I
could get rid of the whole sorting-mess associated with the transparent
polygons, since I don't really need transparency, but alpha-keying. Is
there a method to do that?

I think the BlendChunk method presupposes that the loader creates
appropriate BlendChunks for the transparent materials, and as far as I
understood the discussion it's not the case currently, am I wrong here?

Of course I could still parse the graph myself via osg::traverse() and
find materials that are transparent, suppose they just want alpha keys and
setup an appropriate BlendChunk. This might be more efficient, depending
on how expensive an additional BlendChunk is. Hmmmmm.

Thanks,
        Akos




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to