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:
authorRichard Antalik <richardantalik@gmail.com>2020-11-04 20:13:57 +0300
committerRichard Antalik <richardantalik@gmail.com>2020-11-04 20:13:57 +0300
commit7a8c8ec5e990765bab2e8db6b54ed4f0e80c2a2b (patch)
tree78274c9fb9f62f8fc64145ca4c4ad64daa1362b6 /source/blender/gpu/shaders/material
parentc937f9c4e76c04cc245775d39cd2684e65515863 (diff)
parentfd110291a5f133042511dee3648c354fca141a43 (diff)
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source/blender/gpu/shaders/material')
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_output_material.glsl12
1 files changed, 8 insertions, 4 deletions
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