commit de129c37493ff9583111691e52c16f0dd379f953 parent 44a4379b1c8b1d6785d8d15455bea7277afdef29 Author: Matsuda Kenji <info@mtkn.jp> Date: Wed, 28 Jun 2023 12:00:58 +0900 fix bug of muptiplication order Diffstat:
M | shaders/vertex.sl | | | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/shaders/vertex.sl b/shaders/vertex.sl @@ -3,12 +3,15 @@ layout (location = 0) in vec3 aPos; layout (location = 1) in vec2 aTexCoord; out vec2 texCoord; out float depth; -uniform mat4 transform; + +uniform mat4 model; +uniform mat4 view; +uniform mat4 proj; void main() { - gl_Position = transform * vec4(aPos, 1.0); + gl_Position = proj * view * model * vec4(aPos, 1.0); texCoord = aTexCoord; depth = 1.0 - gl_Position.z / 2; }