mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Balance caustics with depth better
This commit is contained in:
parent
3b195fbd55
commit
34522b39bd
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user