Transparent texture

E.Kiver

06-12-2007 18:32:20

Hi!
I'm using oFusion 1.8.6 CE. And I'm trying to texture hair, which consist of set of semi-transparent polygons. I've created material->Technique->Pass->Texture Unit->Choose my .TGA with alpha chanel, then I was playing with Src Blend and DstBlend constants in Pass material.
Now I can make transparent polygon textured with my tga (with transparency on alpha chanell) but when there is another polygon - between camera and the first one - none of them displayed right. The one in the middle passes nothing of the one in the back through its alpha transparent areas.
So I think there-is another way (somehow grass displayed right in OGRE3D tutorials)
P.S. I've just thought that it might be caused buy .TGA format, I'm not sure whether it supports alpha chanel.



Lioric

07-12-2007 16:53:00

The images are not showing, i used the link but is displays a page with a link to the same link (a hotlink proctection)

In any case, it seems you have a z buffer issues, test by disabling "depth" buffer read and write (in the pass material), as if the polygons are in a single object no sorting can be made on them (only object sorting is used in interactive engines for performance), or if the hair layers are separated objects then there will be z buffer issues as the bounding boxes are different from the exact object shape

Search this forum for several threads with this similar issue, some of them are:

http://www.ogre3d.org/phpBB2addons/view ... light=hair

http://www.ogre3d.org/phpBB2addons/view ... ansparency

http://www.ogre3d.org/phpBB2addons/view ... ansparency

E.Kiver

09-12-2007 16:05:52

There is images http://groups.google.com/group/lovebook ... ic?lnk=srg

Lioric

10-12-2007 15:09:29

You are not using alpha blended mode, you need to use "SrcAlpha" and "InvSrcAlpha" in the blend modes to use the texture alpha

Or if you dont need soft transparency blending, you can use an alpha rejection mode with a value of 128 (or what better suit your textures)

And depending on your specific model you need to use the depth func modes and the depth read/write (z buffer)