From 96e8dadda0b2dda7ce771b1eba2d901a056a039f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 4 Nov 2020 17:16:06 +0100 Subject: Fix T82385 EEVEE: Alpha Clip shadows actually using Alpha Hashed shadows The shadow path was not using the alpha threshold. --- .../material/gpu_shader_material_output_material.glsl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_output_material.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_output_material.glsl index 4cb00c15b78..14271f9d107 100644 --- a/source/blender/gpu/shaders/material/gpu_shader_material_output_material.glsl +++ b/source/blender/gpu/shaders/material/gpu_shader_material_output_material.glsl @@ -1,5 +1,9 @@ -void node_output_material( - Closure surface, Closure volume, vec3 displacement, float alpha_threshold, out Closure result) +void node_output_material(Closure surface, + Closure volume, + vec3 displacement, + float alpha_threshold, + float shadow_threshold, + out Closure result) { #ifdef VOLUMETRICS result = volume; @@ -7,9 +11,9 @@ void node_output_material( result = surface; # if defined(USE_ALPHA_HASH) /* Alpha clip emulation. */ - if (alpha_threshold >= 0.0) { + if ((rayType != EEVEE_RAY_SHADOW) ? (alpha_threshold >= 0.0) : (shadow_threshold >= 0.0)) { float alpha = saturate(1.0 - avg(result.transmittance)); - result.transmittance = vec3(step(alpha, alpha_threshold)); + result.transmittance = vec3(step(alpha, max(alpha_threshold, shadow_threshold))); } # endif #endif -- cgit v1.2.3