Balance caustics with depth better

This commit is contained in:
Joshua Barretto 2022-09-22 23:45:16 +01:00
parent 3b195fbd55
commit 34522b39bd
2 changed files with 3 additions and 3 deletions

View File

@ -148,7 +148,7 @@ float caustics(vec2 p, float t) {
l = min(l, length(.5-fract(k+n)));
k = k*m*.3;
l = min(l, length(.5-fract(k+n)));
return pow(l,4.)*5.5;
return pow(l,3.)*5.5;
}
#endif

View File

@ -401,8 +401,8 @@ void main() {
vec3 wpos = f_pos + vec3(focus_off.xy, 0);
vec3 spos = (wpos + (fluid_alt - wpos.z) * vec3(sun_dir.xy, 0)) * 0.25;
reflected_light += caustics(spos.xy * 1.0, tick.x * 0.5)
* 2
* (1.0 + abs(fluid_alt - wpos.z) * 0.2)
* 3
/ (1.0 + pow(abs(fluid_alt - wpos.z) * 0.075, 2))
* cam_attenuation
* max(dot(f_norm, -sun_dir.xyz), 0)
* sun_diffuse