Jump to content

  • Log In with Google      Sign In   
  • Create Account


how is the depth range changed between NDC and depth buffer


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 jerrycao_1985   Members   -  Reputation: 140

Like
0Likes
Like

Posted 31 May 2013 - 08:22 AM

hi everyone

 

It occurred to me that the depth value in NDC is between -1 and 1 , while the depth value in depth buffer is between 0 and 1.

 

So where did the change happened ?

 

And most importantly , why does OpenGL bother to make the range between -1 and 1, then change it to 0 and 1.

DX does it in a simpler way , range of depth is always between 0 and 1 after perspective divide by default.



Sponsor:

#2 santa01   Members   -  Reputation: 307

Like
0Likes
Like

Posted 31 May 2013 - 09:18 AM

So where did the change happened ?

When the fragment processing (and sorting with depth test enabled) happens. see glDepthRange().



#3 jerrycao_1985   Members   -  Reputation: 140

Like
0Likes
Like

Posted 31 May 2013 - 09:57 AM

according to the document of glDepthRange 

It's during transformation between NDC and window coordinate , much earlier than fragment processing.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS