diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-10 01:33:39 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-10 01:33:39 +0000 |
| commit | 61d6b49d5a4c5f58a2922a19a360e078a0aeacba (patch) | |
| tree | c192508c15d880ccb84003f3494aa2e26d36324b /gfx/gl/shaders/water.vert | |
| parent | Specialise glTexture::savePosition (diff) | |
| download | ilt-61d6b49d5a4c5f58a2922a19a360e078a0aeacba.tar.bz2 ilt-61d6b49d5a4c5f58a2922a19a360e078a0aeacba.tar.xz ilt-61d6b49d5a4c5f58a2922a19a360e078a0aeacba.zip | |
Switch to floating point, camera relative position buffer
Diffstat (limited to 'gfx/gl/shaders/water.vert')
| -rw-r--r-- | gfx/gl/shaders/water.vert | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gfx/gl/shaders/water.vert b/gfx/gl/shaders/water.vert index 60e4fb8..bb056b8 100644 --- a/gfx/gl/shaders/water.vert +++ b/gfx/gl/shaders/water.vert @@ -1,7 +1,7 @@ #version 460 core layout(location = 0) in ivec3 position; -out vec3 FragPos; +out vec4 FragPos; out vec2 TexCoords; uniform mat4 viewProjection; @@ -14,8 +14,8 @@ main() vec3 wpos = vec3(position.x + (cos(waves) * 1000.0), position.y + (cos(waves * 1.4) * 1000.0), cos(waves + (position.x / 1000000) + (position.y / 8000)) * 300.0); - FragPos = vec3(wpos.xy, position.z); + FragPos = vec4(wpos - viewPoint, position.z); TexCoords = (position.xy / 8192) - (viewPoint.xy / 8192); - gl_Position = viewProjection * vec4(wpos - viewPoint, 1.0); + gl_Position = viewProjection * vec4(FragPos.xyz, 1.0); } |
