Stopped caustics appearing in bad places

This commit is contained in:
Joshua Barretto 2022-01-21 13:43:36 +00:00 committed by Imbris
parent 38832fadd3
commit 90f3f0fea0

View File

@ -271,7 +271,7 @@ void main() {
float not_underground = clamp((f_pos.z - f_alt) / 128.0 + 1.0, 0.0, 1.0);
// To account for prior saturation
/*float */f_light = faces_fluid ? not_underground : f_light * sqrt(f_light);
/*float */f_light = faces_fluid ? not_underground * f_light : f_light * sqrt(f_light);
emitted_light = vec3(1.0);
reflected_light = vec3(1.0);
@ -298,11 +298,12 @@ void main() {
vec3 wpos = f_pos + focus_off.xyz;
vec3 spos = (wpos + wpos.z * vec3(sun_dir.xy, 0)) * 0.05;
reflected_light += max(1.0 - pow(abs(noise_3d(vec3(spos.xy, tick.x * 0.1 + dot(sin(wpos.xy * 0.8), vec2(1)) * 0.05)) - 0.5) * 10, 0.001), 0)
* 500
* 1000
* cam_attenuation
* max(dot(f_norm, -sun_dir.xyz), 0)
* sun_diffuse
* sun_info.shadow;
* sun_info.shadow
* f_light;
}
#endif
#endif