When I render transparent object and the terrain is at the background, I see the sky instead of the terrain.
Which make it appear like the terrain doesn't exists behind the transparent object.
What's going wrong?
Jump to content
Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
Posted 07 September 2013 - 11:16 AM
You probably aren't drawing the terrain before the transparent objects. The right rendering order is like:
1. All opaque objects (in whichever order)
2. All transparent objects (sorted - furthest first, closest last)
When you are rendering a transparent object, the backbuffer already has to contain all objects that are behind the transparent one and that can be seen through it. Only this way the blending can work properly.
Edited by Tom KQT, 07 September 2013 - 12:45 PM.
Posted 08 September 2013 - 06:53 AM
Drawing order (in regular* alpha blendig) is really important. What alpha bending operations to is that thay simply gets the current color value of the buffer and the transperant surface color values. After that those values are processed with the operation defined by you. There is a technique called orderless(or independant) alpha blending but it is a bit more advanced topic. So this is what you want to do to get accurate blending;
1. Draw all solid objects
2. Sort all all surfaces with transperancy by dist. from camera.
3. Draw those surcafes starting from the most distant surface from the camera.
Well here the most hardest thing is the sorting. It really depends on your scene.
Hope that will help.
Sry for by bad English.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.