transparent texture

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
airpas
Posts: 48
Joined: Wed Apr 18, 2012 11:50 am

transparent texture

Post 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 ?
Attachments
Untitled.jpg
Untitled.jpg (29.74 KiB) Viewed 5745 times
test.zgeproj
(10.67 KiB) Downloaded 401 times
User avatar
Kjell
Posts: 1883
Joined: Sat Feb 23, 2008 11:15 pm

Re: transparent texture

Post 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
Attachments
Crate.zgeproj
(11.45 KiB) Downloaded 413 times
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post 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.
airpas
Posts: 48
Joined: Wed Apr 18, 2012 11:50 am

Post by airpas »

thanks kjell , it took me a little time to understand it :wink:

thanks again
Post Reply