↧
Answer by t0rakka for Why does GL divide `gl_Position` by W for you rather...
It's even simpler; the clipping happens after the vertex shading. If the vertex shader was allowed (or more strongly, mandated) to do perspective divison the clipping would have to happen in...
View ArticleAnswer by derhass for Why does GL divide `gl_Position` by W for you rather...
I'd like to extent on BDL's answer. It is not only about the perspective interpolation. It is also about the clipping. The space the value gl_Position is supposed to be provided in is called clip...
View ArticleAnswer by BDL for Why does GL divide `gl_Position` by W for you rather than...
The reason is, that not only gl_Position gets divided by the homogeneous coordinate, but also all other interpolated varyings. This is called perspective correct interpolation which requires the...
View ArticleWhy does GL divide `gl_Position` by W for you rather than letting you do it...
Note: I understand the basic math. I understand that the typical perspective function in various math libraries produces a matrix that converts z values from -zNear to -zFar back into -1 to +1 but only...
View Article
More Pages to Explore .....