Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2017-09-24 02:25:21 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-09-25 21:14:42 +0300
commit98dd2a518be52b7f94c3a6f9345f19a0aebb2284 (patch)
tree263c9cbb4b466782b133030e796bfe8b67e9f06f /source/blender/draw/engines/eevee/shaders/ssr_lib.glsl
parent00955d8d7a2e17ee86767e5f3703d6c20f2602b8 (diff)
Eevee: Fix SSR in orthographic view.
The problem was that orthographic views can have hit position that are negative. Thus we cannot encode the hit in the sign of the Z component. The workaround is to store the hit position in screenspace. But since we are using floating point render target, we are loosing quite a bit of precision. TODO: use RGBA16 instead of RGBA16F. But that means encoding the pdf value somehow.
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/ssr_lib.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/ssr_lib.glsl1
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/ssr_lib.glsl b/source/blender/draw/engines/eevee/shaders/ssr_lib.glsl
index 68e0c2a682f..6dbd761ba8d 100644
--- a/source/blender/draw/engines/eevee/shaders/ssr_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/ssr_lib.glsl
@@ -36,6 +36,7 @@ vec4 screen_space_refraction(vec3 viewPosition, vec3 N, vec3 V, float ior, float
vec3 hit_pos = raycast(-1, viewPosition, R, ssrThickness, jitter, roughnessSquared);
if ((hit_pos.z < 0.0) && (F_eta(ior, dot(H, V)) < 1.0)) {
+ hit_pos = get_view_space_from_depth(hit_pos.xy, hit_pos.z);
float hit_dist = distance(hit_pos, viewPosition);
float cone_cos = cone_cosine(roughnessSquared);