Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

Alpha testing with the depthbuffer enabled ?

$
0
0

@willmotil wrote:

If i remember right, In the old xna 3.1 you could flip on the depth buffer with alpha test on.
turn multisample anti aliasing off and set the filter to point clamp or wrap and get a cheap quick zbuffered alpha test.

But i have no clue how what to do here whats the quickest way to get both at once or do i need to do this thru my shader now.

If so how do i work with the depth buffer within the shader.
I have no clue how to access and use that depth info within a shader (i suck with shaders).

What steps should i take ? Or in what order should i take them to do that or learn how to do that ?

To illustrate clearly.

The problem is shown below.

With depth testing on the order affects the gpu's alpha discarding of pixels, i.e. the entire quad is set to the depth buffer regardless of transparent alpha pixels on the texture or not.

I guess im wondering if there is a way to just tell the gpu to not set the depth buffer while building up the buffers color on transparent pixels, until that pixel actually becomes opaque and to then set the discarding depth per pixel depending on alpha. In a easy way.

The problem with turning of the depth buffer is obvious.
Things bleed thru from behind. Like the red arrows shown below one of them is on the surface the other is behind it but drawn after the mesh.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles