Iris Shaders

Iris Shaders

36M Downloads

quad in fullscreen programs has wrong vertex coordinates

Kneemund opened this issue ยท 0 comments

commented

Expected Behavior

The quad's vertex coordinates should be provided in the range [0, 1] and then transformed to [-1, 1] in the vertex shader using the normal transformation matrices: gl_ModelViewProjectionMatrix * gl_Vertex
A common optimization (which does the exact same thing) is this: vec4(gl_Vertex.xy * 2.0 - 1.0, 0.0, 1.0)

Actual Behavior

Iris' quad coordinates already range from -1 to 1, and the model/view/projection matrices seem to be identity matrices. The optimization incorrectly positions the quad. A workaround is simply using vec4(gl_Vertex.xy, 0.0, 1.0).