From 6be8878d2a40e4afac719cbf15c596bc5b3e929c Mon Sep 17 00:00:00 2001 From: Bryan Dela Cruz Date: Sat, 21 Dec 2019 17:05:18 +0800 Subject: [PATCH] Fixes #18. Updated wavy fragment shader - Used vTexCoords instead of gl_FragCoord --- shader/wavy/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shader/wavy/main.go b/shader/wavy/main.go index 8925b69..2950b43 100644 --- a/shader/wavy/main.go +++ b/shader/wavy/main.go @@ -67,6 +67,7 @@ func main() { var fragmentShader = ` #version 330 core +in vec2 vTexCoords; out vec4 fragColor; uniform sampler2D uTexture; @@ -77,7 +78,7 @@ uniform float uSpeed; uniform float uTime; void main() { - vec2 t = gl_FragCoord.xy / uTexBounds.zw; + vec2 t = vTexCoords / uTexBounds.zw; vec3 influence = texture(uTexture, t).rgb; if (influence.r + influence.g + influence.b > 0.3) {