Sign in to follow this  

Viewport maxZ = 0 question

Recommended Posts

I have a 3D arrow mesh (cylinder + cone) that I use to indicate light direction. I want this to always be visible, so I tried setting the MinZ = MaxZ = 0 in the viewport transformation and it works well. However, after thinking about it, I started questioning why it works. The arrow has overlapping triangles from some view angles, so shouldn't this cause some sort of Z-fighting since both pixels will have a z = 0 from this viewport transform? But rotating the arrow and viewing from all angles, there is no problem. It almost seems like it does the depth test first (with z values before flattening from the viewport transform), and then flattens to z = 0 from the viewport transform. I am using Direct3D 9. Any explanation?

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