Page 1 of 1

transparent texture

Posted: Wed Jan 15, 2014 5:18 pm
by airpas
hi every one
i create a cube and texture it with a png file, the rendering was not expected , so what i did wrong ?

Re: transparent texture

Posted: Wed Jan 15, 2014 6:02 pm
by Kjell
Hi airpas,
airpas wrote:i create a cube and texture it with a png file, the rendering was not expected, so what i did wrong?
You mean the fact that you can't always see the backside / inside of the crate when looking through the transparent parts of the outside?

You can't use the DrawBackFace property of a Material for those kind of situations. Instead, you need to render the inside first and the outside after that. Either use a separate mesh for the inside, or draw the same mesh twice while toggling glFrontFace ( GL_CW for the inside, GL_CCW for the outside ).

Attached is a example using the separate mesh approach.

K

Posted: Wed Jan 15, 2014 6:07 pm
by Rado1
I obtained the same strange behavior. Rendering the cube's inside through each side is different. Other sides which should be visible are hidden.

Posted: Wed Jan 15, 2014 7:02 pm
by airpas
thanks kjell , it took me a little time to understand it :wink:

thanks again