diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-10-07 00:38:31 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-10-07 00:44:22 +0300 |
commit | 9ab18d14f6f1cfe510a2b06ee477498502d1c887 (patch) | |
tree | 1600baa94e45aa9462efe5afcea2d563b84c5059 /source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl | |
parent | 321f773ca65921f6cb1ba13562bf9e942a30c455 (diff) |
Eevee: Modify the raycast function to be more flexible.
Make quality a parameter, and modify the ray end to be premultiplied so that the raytrace is done on a range.
This is in order to add contact shadows.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl index 7d142e50013..7a501964fae 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl @@ -10,6 +10,9 @@ uniform sampler2DArray utilTex; #define BRDF_BIAS 0.7 #define MAX_MIP 9.0 +uniform float fireflyFactor; +uniform float maxRoughness; + #ifdef STEP_RAYTRACE uniform sampler2D normalBuffer; @@ -54,7 +57,7 @@ vec4 do_planar_ssr(int index, vec3 V, vec3 N, vec3 T, vec3 B, vec3 planeNormal, * below the reflection plane). This way it's garanted that the hit will * be in front of the camera. That let us tag the bad rays with a negative * sign in the Z component. */ - vec3 hit_pos = raycast(index, viewPosition, R, 1e16, jitter, a2); + vec3 hit_pos = raycast(index, viewPosition, R * 1e16, 1e16, jitter, ssrQuality, a2); return vec4(hit_pos, pdf); } @@ -73,7 +76,7 @@ vec4 do_ssr(vec3 V, vec3 N, vec3 T, vec3 B, vec3 viewPosition, float a2, vec3 ra vec3 R = reflect(-V, H); pdf = min(1024e32, pdf); /* Theoretical limit of 16bit float */ - vec3 hit_pos = raycast(-1, viewPosition, R, ssrThickness, jitter, a2); + vec3 hit_pos = raycast(-1, viewPosition, R * 1e16, ssrThickness, jitter, ssrQuality, a2); return vec4(hit_pos, pdf); } |