Fixed caustics

This commit is contained in:
Joshua Barretto 2022-01-23 20:06:44 +00:00 committed by Imbris
parent a3fcd7f568
commit abda8058fe
2 changed files with 7 additions and 3 deletions

View File

@ -6,7 +6,11 @@
#define LIGHTING_REFLECTION_KIND LIGHTING_REFLECTION_KIND_GLOSSY
#define LIGHTING_TRANSPORT_MODE LIGHTING_TRANSPORT_MODE_RADIANCE
#if (FLUID_MODE == FLUID_MODE_CHEAP)
#define LIGHTING_TRANSPORT_MODE LIGHTING_TRANSPORT_MODE_IMPORTANCE
#elif (FLUID_MODE == FLUID_MODE_SHINY)
#define LIGHTING_TRANSPORT_MODE LIGHTING_TRANSPORT_MODE_RADIANCE
#endif
#define LIGHTING_DISTRIBUTION_SCHEME LIGHTING_DISTRIBUTION_SCHEME_MICROFACET

View File

@ -293,8 +293,8 @@ void main() {
#ifndef EXPERIMENTAL_NOCAUSTICS
#if (FLUID_MODE == FLUID_MODE_SHINY)
if (faces_fluid) {
vec3 wpos = f_pos + focus_off.xyz;
vec3 spos = (wpos + wpos.z * vec3(sun_dir.xy, 0)) * 0.05;
vec3 wpos = f_pos + vec3(focus_off.xy, 0);
vec3 spos = (wpos + (fluid_alt - 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)
* 1000
* cam_attenuation