From fd37232cbc24e4711b2b79e9e8ace509629f7e56 Mon Sep 17 00:00:00 2001 From: Lisandro Lorea Date: Mon, 2 Oct 2023 16:51:31 -0300 Subject: [PATCH] Use MODEL_MATRIX instead of INV_VIEW_MATRIX The 4.0 equivalent of WORLD_MATRIX is MODEL_MATRIX This fixes the wobbling and distortion when moving the camera around. --- realistic_water_shader/art/water/Water.gdshader | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/realistic_water_shader/art/water/Water.gdshader b/realistic_water_shader/art/water/Water.gdshader index 4264c4e..90dd3f1 100644 --- a/realistic_water_shader/art/water/Water.gdshader +++ b/realistic_water_shader/art/water/Water.gdshader @@ -85,7 +85,7 @@ void vertex() float time = TIME * wave_speed; vec4 vertex = vec4(VERTEX, 1.0); - vec3 vertex_position = (INV_VIEW_MATRIX * vertex).xyz; + vec3 vertex_position = (MODEL_MATRIX * vertex).xyz; vec3 tang = vec3(0.0, 0.0, 0.0); vec3 bin = vec3(0.0, 0.0, 0.0); @@ -171,4 +171,4 @@ void fragment() SPECULAR = 0.2 + depth_blend_pow * 0.4; NORMAL_MAP = normalmap; NORMAL_MAP_DEPTH = 1.25; -} \ No newline at end of file +}