From 2263bcbf7c566da56530ef967bfa04930521e798 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 21 Jan 2022 01:24:00 +0000 Subject: [PATCH] Use correct ray direction underwater --- assets/voxygen/shaders/fluid-frag/shiny.glsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/voxygen/shaders/fluid-frag/shiny.glsl b/assets/voxygen/shaders/fluid-frag/shiny.glsl index 0f8af5db01..6917e09d49 100644 --- a/assets/voxygen/shaders/fluid-frag/shiny.glsl +++ b/assets/voxygen/shaders/fluid-frag/shiny.glsl @@ -176,13 +176,14 @@ void main() { // vec3 cam_to_frag = normalize(f_pos - cam_pos.xyz); // Squared to account for prior saturation. float f_light = 1.0;// pow(f_light, 1.5); - vec3 reflect_color = get_sky_color(/*reflect_ray_dir*/beam_view_dir, time_of_day.x, f_pos, vec3(-100000), 0.125, true); vec3 ray_dir; if (medium.x == 1) { ray_dir = (cam_to_frag + norm) / 2; } else { ray_dir = reflect_ray_dir; } + + vec3 reflect_color = get_sky_color(/*reflect_ray_dir*/ray_dir, time_of_day.x, f_pos, vec3(-100000), 0.125, true); reflect_color = get_cloud_color(reflect_color, ray_dir, f_pos.xyz, time_of_day.x, 100000.0, 0.1); reflect_color *= f_light;