Jump to content
  • Advertisement
Sign in to follow this  
Spa8nky

OpenGL [XNA] Order independently drawn transparent model is not reading depth

This topic is 2190 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using a method for drawing transparent objects without ordering using the weighted average method found in the following paper: http://Weighted Average Paper: http://developer.download.nvidia.com/SDK/10/opengl/src/dual_depth_peeling/doc/DualDepthPeeling.pdf

The problem with my setup is that the transparent model always draws on top of the opaque model even when I believe I have set up my render states correctly and it should be obscured.

The draw method can be broken down as follows:

- SetRenderTarget
- DrawOpaque
- UnsetRenderTarget
- SetTransparentRenderTargets
- DrawTransparent
- UnsetTransparentRenderTargets
- CombineTransparent result with OpaqueRenderTarget result

I have attached a simple source code and .exe demonstration of the problem. WASD keys and mouse to control the camera.

The opaque object is drawn in front of the camera and the transparent object is drawn behind the opaque object. It is not obscured by the opaque object and I am uncertain why this is the case?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!