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:
authorYimingWu <xp8110@outlook.com>2020-06-04 13:57:28 +0300
committerYimingWu <xp8110@outlook.com>2020-06-04 13:57:28 +0300
commitbfbf0bb7f7a0191b65fc724d5dfea225e6293c6b (patch)
tree042f37d28c9e1cf0ce5a0fb4fd4235288f62d36e /source/blender/gpu/shaders/material/gpu_shader_material_output_material.glsl
parent3b52dfe549f0c2fca7e0cd499b85fb098e9b4da9 (diff)
parent78017916f7c7a8ec8907c9b993214ff8ec3c3557 (diff)
Merge remote-tracking branch 'origin/master' into temp-lanpr-reviewtemp-lanpr-review
# Conflicts: # release/datafiles/locale # release/scripts/addons
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
}