Added proper refraction to water surface

This commit is contained in:
Joshua Barretto 2022-01-21 17:45:50 +00:00 committed by Imbris
parent 470353e08c
commit 212392a062

View File

@ -177,7 +177,7 @@ void main() {
float f_light = 1.0;// pow(f_light, 1.5);
vec3 ray_dir;
if (medium.x == 1) {
ray_dir = (cam_to_frag + norm) / 2;
ray_dir = refract(cam_to_frag, -norm, 1.33);
} else {
ray_dir = reflect_ray_dir;
}