GLSL - 立体视图的透视校正

问题描述 投票:2回答:1

我试图修正GLSL中的透视不正确

Incorrect

纠正

Correct

在VS中我添加了:

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;

我认为结果看起来不错

Result

但是在向右旋转90度后,它看起来并不像我预期的那样。

Rot90r

在下一次旋转90度后,它看起来更糟。

Rot90d

opengl glsl perspective
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.