Skip to main content
GameDev.net gamedev.net
🔒 Locked

Multiple Surface rendering issue

Started by myfeng Dec 4, 2008 at 1:27 PM 1 replies 550+ views
Original Post
myfeng
myfeng
Hi, I am having an issue with rendering multiple surfaces with difference opacity. The problem is: mesh A and B. B is inside of A. If I render A, then render B and change the opacity of B, B will not be seen unless opacity A is 0. If I render B first, then render A, it seems ok. I cannot actually just switch the rendering order, since I have more than 2 meshes and I also don't know which one is inside of others. Can anyone help me on this? Thanks a lot. myfeng
V-man
V-man
If B is inside A and you render A, then B can't be rendered because of the depth test. You need to sort objects that need certain blending modes like GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA back to front.

The other technique is to use order independent transparency. Do some searches if you want to implement this.
myfeng
myfeng
Thanks a lot V-man. I will try.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.