From 0bfd358559ef11cc0228061103553e7ef4dfaace Mon Sep 17 00:00:00 2001 From: Vanessa Karolek <vaka1997@uni-koblenz.de> Date: Mon, 26 Jul 2021 14:54:58 +0200 Subject: [PATCH] [#94] avoid moving texture wrt camera orientation --- projects/saf_r/shaders/shader.vert | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/saf_r/shaders/shader.vert b/projects/saf_r/shaders/shader.vert index 1faa9080..fe51e232 100644 --- a/projects/saf_r/shaders/shader.vert +++ b/projects/saf_r/shaders/shader.vert @@ -24,8 +24,8 @@ void main() { vec4 position = mvp * vec4(positions[gl_VertexIndex], 1.0); gl_Position = position; - texCoord.x = (position.x + 1.0) * 0.5; - texCoord.y = (position.y + 1.0) * 0.5; + texCoord.x = (positions[gl_VertexIndex].x + 1.0) * 0.5; + texCoord.y = (-positions[gl_VertexIndex].y + 1.0) * 0.5; fragColor = colors[gl_VertexIndex]; } \ No newline at end of file -- GitLab