From 148085c030a0ade2856269ca7d753464c2aa2e05 Mon Sep 17 00:00:00 2001 From: CobaltXII Date: Sat, 5 Jan 2019 10:21:20 -0500 Subject: [PATCH] Animation does not loop backwards and is faster --- glsl/block_vertex.glsl | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/glsl/block_vertex.glsl b/glsl/block_vertex.glsl index 20b2c2b..c8f963b 100644 --- a/glsl/block_vertex.glsl +++ b/glsl/block_vertex.glsl @@ -44,16 +44,9 @@ void main() if (frag_texture.z < 0.0f) { - // Animate the water. + // Animate the texture. - float frame = mod(floor(time_in_seconds * 10.0f), 61.0f); - - if (frame > 30.0f) - { - frame = 61.0f - frame; - } - - frag_texture.z = abs(frag_texture.z) + frame; + frag_texture.z = abs(frag_texture.z) + mod(floor(time_in_seconds * 16.0f), 31.0f); } frag_lighting = vertex_lighting;