diff options
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/prepass_frag.glsl')
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/prepass_frag.glsl | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/prepass_frag.glsl b/source/blender/draw/engines/eevee/shaders/prepass_frag.glsl index b49dbfceba2..9acd8f998f6 100644 --- a/source/blender/draw/engines/eevee/shaders/prepass_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/prepass_frag.glsl @@ -45,26 +45,22 @@ float hashed_alpha_threshold(vec3 co) /* Find our final, uniformly distributed alpha threshold. */ float threshold = (x < one_a) ? ((x < a) ? cases.x : cases.y) : cases.z; + /* Jitter the threshold for TAA accumulation. */ + threshold = fract(threshold + alphaHashOffset); + /* Avoids threshold == 0. */ threshold = clamp(threshold, 1.0e-6, 1.0); - /* Jitter the threshold for TAA accumulation. */ - return fract(threshold + alphaHashOffset); + return threshold; } #endif -#ifdef USE_ALPHA_CLIP -uniform float alphaThreshold; -#endif +#define NODETREE_EXEC void main() { - /* For now do nothing. - * In the future, output object motion blur. */ - -#if defined(USE_ALPHA_HASH) || defined(USE_ALPHA_CLIP) -# define NODETREE_EXEC +#if defined(USE_ALPHA_HASH) Closure cl = nodetree_exec(); @@ -75,11 +71,6 @@ void main() if (opacity < hashed_alpha_threshold(worldPosition)) { discard; } -# elif defined(USE_ALPHA_CLIP) - /* Alpha clip */ - if (opacity <= alphaThreshold) { - discard; - } # endif #endif } |