Hi Vincent,

On Thu, 2005-02-17 at 01:07, Vincent Honnet wrote:
> Hello Dirk,
> 
> Thanks for your answer.
> The scene I have is quite simple: this is a cross of 3 planes (one xy, 
> one xz, and one zy, and they are centered with 0,0,0) and on each there 
> is grayscale texture. 

Do they extend to both the negative nad the positive halfspace? In that
case you have intersecting transparent polygons, which is really the
worst case scenario...

> Every pixel which are originaly black are 
> completely transparent the other have no transparency 

...but that makes it much easier.

> (is there actually 
> a way to give a grayscale texture without transparency values and that 
> OpenSG automatically gives a transparency value 1 to the black pixels ?).

No, not directly. If it's important for you you could write a shader to
do that, but that would be quite a bit of work, if you have an LA
texture anyway that's fine.

The best way to make this work is using the OpenGL Alpha Test. That
allows you to simply discard all pixels that fail a certain test before
the depth buffer is changed, and avoids the ordering problem for
transparent faces altogether.

The problem is (as you realized ;) that the SimpleMaterial and friends
create the texture and blend chunks internally. They don't show up in
the chunks MField, therefore you can't manipulate them (the chunks
MField is only for chunks in addition to the internal ones).

So here's the recipe: create a ChunkMaterial, add a TextureChunk with
your LA texture. If you want it to be lit you also need a MaterialChunk
for the material parameters. Then you need to add a BlendChunk, with
alphaFunc set to GL_NOTEQUAL and alphaValue set to 0 (if your outside
alpha is 0).

That should take care of it.

Hope it helps

        Dirk




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to