diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-07-24 16:36:22 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-07-24 16:36:22 +0300 |
commit | c5f4342692b10110200e3494a1e9412e75270c10 (patch) | |
tree | 8f3b47d2133aa0c4685d99b8cd779706cb72ba17 /source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl | |
parent | f6c60ffcadc0e3ea2d14c48e96120010751ae53c (diff) |
Eevee: SSR: Small fixes
- Encode normals for other opaque bsdf so they are not rejected by the normal facing test.
- Early out non reflective surfaces.
- Add small offset to raytrace to avoid self intersection.
- Fix fallback probes not appearing.
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 | 10 |
1 files changed, 10 insertions, 0 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 64ad433eb44..83f238ce782 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl @@ -59,6 +59,11 @@ void main() /* Retrieve pixel data */ vec4 speccol_roughness = texelFetch(specroughBuffer, fullres_texel, 0).rgba; + + /* Early out */ + if (dot(speccol_roughness.rgb, vec3(1.0)) == 0.0) + discard; + float roughness = speccol_roughness.a; float roughnessSquared = max(1e-3, roughness * roughness); float a2 = roughnessSquared * roughnessSquared; @@ -244,6 +249,11 @@ void main() vec3 V = cameraVec; vec3 N = mat3(ViewMatrixInverse) * normal_decode(texelFetch(normalBuffer, fullres_texel, 0).rg, viewCameraVec); vec4 speccol_roughness = texelFetch(specroughBuffer, fullres_texel, 0).rgba; + + /* Early out */ + if (dot(speccol_roughness.rgb, vec3(1.0)) == 0.0) + discard; + float roughness = speccol_roughness.a; float roughnessSquared = max(1e-3, roughness * roughness); |