Sign in to follow this  

Translucent/transparent pixels ignore the z-buffer

This topic is 3567 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

For some reason (using Managed DirectX in C#) when I draw polygons with alpha-blending enabled, any part of the texture whose alpha is less than 255 does not use the z-buffer. I have no idea how to change this. Can anyone help? I want the entire thing to do z-buffer checking and writing even for pixels that are partially or completely transparent.

Share this post


Link to post
Share on other sites
What do you mean by "does not use the z-buffer"? Check if alpha test is enabled. If it is, either disable it or set alpha ref to 0. Also, make sure that objects are sorted back to front, otherwise translucent objects will be occluded incorrectly.

Share this post


Link to post
Share on other sites
Oh I'm an idiot, haha. Perhaps the z-buffering is working but it's just blending with the occluded polygons it drew first. Unfortunately this is a single mesh and it's impractical/impossible to sort the polygons in real-time. I'll have to figure out something.

Share this post


Link to post
Share on other sites

This topic is 3567 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.

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