Sign in to follow this  

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

Recommended Posts

I'm using a method for drawing transparent objects without ordering using the weighted average method found in the following paper: [url="http://Weighted%20Average%20Paper:%20"]http://Weighted Average Paper:[/url]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this