Reputation: 141
I'm trying to fix the perspective in GLSL from incorrect
to correct
In VS I added:
float gradient = 0.5;
mat4 transformGeometry = mat4(1.0, 0.0, gradient, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0);
gl_Position = mvp_matrix * transformGeometry * a_position;
I think the result looks ok
BUT after rotating 90 degree right, it doesn't look like as I expected.
After next rotation 90 degree down, it looks even worse.
Upvotes: 2
Views: 217
Reputation: 141
Solved - it should be
projectionMatrix * transformGeometry * modelView
instead of the
MVP * transformGeometry
Upvotes: 1