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:
Diffstat (limited to 'source/blender/gpu/shaders/material/gpu_shader_material_output_material.glsl')
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_output_material.glsl10
1 files changed, 9 insertions, 1 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 62f76d46088..4cb00c15b78 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,8 +1,16 @@
-void node_output_material(Closure surface, Closure volume, vec3 displacement, out Closure result)
+void node_output_material(
+ Closure surface, Closure volume, vec3 displacement, float alpha_threshold, out Closure result)
{
#ifdef VOLUMETRICS
result = volume;
#else
result = surface;
+# if defined(USE_ALPHA_HASH)
+ /* Alpha clip emulation. */
+ if (alpha_threshold >= 0.0) {
+ float alpha = saturate(1.0 - avg(result.transmittance));
+ result.transmittance = vec3(step(alpha, alpha_threshold));
+ }
+# endif
#endif
}