Jump to content
Posted 04 July 2012 - 08:08 AM
Posted 04 July 2012 - 10:29 AM
Posted 04 July 2012 - 11:30 AM
If you turn depth testing off rendering is done in the order you submit the draw calls in, so say you have two objects that overlap and one is at 0.1 and the other is at 0.2 depth. With depth testing on and rendering the 0.1 object first that would be the object you see, when it is off however the one with 0.2 is rendered last and will overlap the other one.
Are you sure you aren't changing the alpha blend equations as well? If you render something thats changing the Alpha blend state before or after this draw call when you next come to this drawcall the alpha state will not have reset itself.
Posted 04 July 2012 - 11:55 AM
Posted 04 July 2012 - 02:05 PM
With depth testing enabled, the drawing order for alpha objects matter. The problem you're seeing is caused by the first object filling the depth buffer with a quad so when the second object which is behind draws it's tested against the depth buffer which contains a quad so that area is clipped out rather than alpha blended with the object in front of it.
This is a common problem with alpha blending. What you want to do is sort your objects from back to front before you render them. Even if you are submitting these objects out of order, if you queue them up in a buffer you can sort that buffer before you actually submit them to be rendered.
Posted 04 July 2012 - 03:33 PM