Skip to content

Commit

Permalink
Fixes #18. Updated wavy fragment shader
Browse files Browse the repository at this point in the history
- Used vTexCoords instead of gl_FragCoord
  • Loading branch information
bmdelacruz committed Dec 21, 2019
1 parent 0d1d22b commit 6be8878
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shader/wavy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func main() {
var fragmentShader = `
#version 330 core
in vec2 vTexCoords;
out vec4 fragColor;
uniform sampler2D uTexture;
Expand All @@ -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) {
Expand Down

0 comments on commit 6be8878

Please sign in to comment.