Page 1 of 1

Transparency problems regarding polys of the same mesh

Posted: Thu May 19, 2005 3:56 am
by serrakilla
Hey guys, i hope someone helps in my dilemma...

Im creating trees ( pine trees to be more precise ) for a game im making using ogre. Now the way i designed trees is that i made separate planes for each segment of leaves ( comprising around 10 ) around a trunk. I UV mapped the parent leaf segment, then put texture on it. The other referenced leaves then followed suit once i applied the texture. Then I attached every leaf to each other to make one mesh composed of separate planes. I then attached the trunk to the leaf set to make a tree.

I then coded the transparency properly and made the material of the leaves 2 sided. Viewed it in meshviewer, and everything seemed ok until i noticed that...

a.) Though i can see the background color of the meshviewer in between the blank spaces of each leaf segment, i can't seem to see the other leaves and the trunk.

b.) 2 leaves that are overlapping ( meaning one on top of the other ), i can't see the leaves behind, but i can still see the background color of meshviewer.


Hope you guys can help, im kinda new to ogre. thanks. :D

Posted: Thu May 19, 2005 4:01 am
by serrakilla
oh, and i used these in my code for the .material of the tree

i placed this in the portion where the code calls the texture of the leaves.

scene_blend alpha_blend
cull_hardware none
cull_software none

Posted: Thu May 19, 2005 4:05 am
by Lioric
this is because transparents are ordered by object, not by face

I have not used ogre too much, probably others can give you more info, probably playing with the the alpha rejection parameter or z read/write parameter

Lioric

Posted: Thu May 19, 2005 10:51 am
by :wumpus:
Try using alpha_reject instead of alpha blend. It solves this issue.

Posted: Thu May 19, 2005 12:23 pm
by bugshake
hey thanks, I had the same problem.

I also ran into another problem, which you might run into as well. (going a little off topic here) I got white edges around all my leafs using a PNG file i made in photoshop. i think this is because first the gouraud shader interpolates the edges with a white background and then it gets alpha blended into the scene, resulting in 50% white, 50% alpha edges. the fix is to give your entire image a coloured background with opacity 1% (very transparent)