opengl

Sample code from LearnOpenGL.com
Log | Files | Refs

commit b6f08a045db3b6dd48ee900b6d56c15926c2b3bf
parent 4d2929f83c1dff9a28a9c7148d6d33208744bf37
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Wed, 28 Jun 2023 10:12:47 +0900

fix depth shading

Diffstat:
Mshaders/vertex.sl | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shaders/vertex.sl b/shaders/vertex.sl @@ -10,5 +10,5 @@ main() { gl_Position = transform * vec4(aPos, 1.0); texCoord = aTexCoord; - depth = gl_Position.z / 2 + 1.0; + depth = 1.0 - gl_Position.z / 2; }