Quantcast
Channel: Why does GL divide `gl_Position` by W for you rather than letting you do it yourself? - Stack Overflow
Browsing latest articles
Browse All 4 View Live

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 Article


Image may be NSFW.
Clik here to view.

Answer 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 Article

Answer 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 Article

Why 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
Browsing latest articles
Browse All 4 View Live




<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>