diff options
3 files changed, 4 insertions, 31 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl index 93492762bbe..b554fd113df 100644 --- a/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl @@ -187,8 +187,6 @@ struct ClosureEvalCommon { float specular_accum; /** Diffuse probe accumulator. */ float diffuse_accum; - /** Viewspace depth to start raytracing from. */ - float tracing_depth; }; /* Common cl_out struct used by most closures. */ @@ -210,18 +208,6 @@ ClosureEvalCommon closure_Common_eval_init(ClosureInputCommon cl_in) cl_eval.vP = viewPosition; cl_eval.Ng = safe_normalize(cross(dFdx(cl_eval.P), dFdy(cl_eval.P))); cl_eval.vNg = transform_direction(ViewMatrix, cl_eval.Ng); - /* TODO(fclem) See if we can avoid this complicated setup. */ -#ifdef STEP_RESOLVE /* SSR */ - cl_eval.tracing_depth = FragDepth; -#else - cl_eval.tracing_depth = gl_FragCoord.z; -#endif - /* Constant bias (due to depth buffer precision) */ - /* Magic numbers for 24bits of precision. - * From http://terathon.com/gdc07_lengyel.pdf (slide 26) */ - cl_eval.tracing_depth -= mix(2.4e-7, 4.8e-7, cl_eval.tracing_depth); - /* Convert to view Z. */ - cl_eval.tracing_depth = get_view_z_from_depth(cl_eval.tracing_depth); cl_eval.occlusion_data = occlusion_load(cl_eval.vP, cl_in.occlusion); @@ -254,13 +240,8 @@ ClosureLightData closure_light_eval_init(ClosureEvalCommon cl_common, int light_ light.L.w = length(light.L.xyz); light.vis = light_visibility(light.data, cl_common.P, light.L); - light.contact_shadow = light_contact_shadows(light.data, - cl_common.P, - cl_common.vP, - cl_common.tracing_depth, - cl_common.vNg, - cl_common.rand.x, - light.vis); + light.contact_shadow = light_contact_shadows( + light.data, cl_common.P, cl_common.vP, cl_common.vNg, cl_common.rand.x, light.vis); return light; } diff --git a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl index bd752d33819..5d3db8d4966 100644 --- a/source/blender/draw/engines/eevee/shaders/lights_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/lights_lib.glsl @@ -268,8 +268,7 @@ float light_shadowing(LightData ld, vec3 P, float vis) } #ifndef VOLUMETRICS -float light_contact_shadows( - LightData ld, vec3 P, vec3 vP, float tracing_depth, vec3 vNg, float rand_x, float vis) +float light_contact_shadows(LightData ld, vec3 P, vec3 vP, vec3 vNg, float rand_x, float vis) { if (ld.l_shadowid >= 0.0 && vis > 0.001) { ShadowData sd = shadows_data[int(ld.l_shadowid)]; diff --git a/source/blender/draw/engines/eevee/shaders/shadow_accum_frag.glsl b/source/blender/draw/engines/eevee/shaders/shadow_accum_frag.glsl index c48828b7b8d..ad0d682dcf4 100644 --- a/source/blender/draw/engines/eevee/shaders/shadow_accum_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/shadow_accum_frag.glsl @@ -28,13 +28,6 @@ void main() vec4 rand = texelfetch_noise_tex(texel); float accum_light = 0.0; - float tracing_depth = depth; - /* Constant bias (due to depth buffer precision) */ - /* Magic numbers for 24bits of precision. - * From http://terathon.com/gdc07_lengyel.pdf (slide 26) */ - tracing_depth -= mix(2.4e-7, 4.8e-7, depth); - /* Convert to view Z. */ - tracing_depth = get_view_z_from_depth(tracing_depth); vec3 vP = get_view_space_from_depth(uvs, depth); vec3 P = transform_point(ViewMatrixInverse, vP); @@ -50,7 +43,7 @@ void main() float l_vis = light_shadowing(ld, P, 1.0); - l_vis *= light_contact_shadows(ld, P, vP, tracing_depth, vNg, rand.x, 1.0); + l_vis *= light_contact_shadows(ld, P, vP, vNg, rand.x, 1.0); accum_light += l_vis; } |