rabidus-test/Assets/Amazing Assets/Advanced Dissolve/Shaders/Universal/AdvancedDissolve_Alpha.hlsl

25 lines
593 B
HLSL
Raw Permalink Normal View History

2023-09-18 20:09:22 +03:00
#ifndef ADVANCED_DISSOLVE_ALPHA
#define ADVANCED_DISSOLVE_ALPHA
half AdvancedDissolve_Alpha(half albedoAlpha, half4 color, half cutoff, float4 cutoutSource)
{
#if !defined(_SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A) && !defined(_GLOSSINESS_FROM_BASE_ALPHA)
half alpha = albedoAlpha * color.a;
#else
half alpha = color.a;
#endif
//Advanced Dissolve/////////////////////////////////////////
AdvancedDissolveCalculateAlphaAndClip(cutoutSource, alpha, cutoff);
#if defined(_ALPHATEST_ON)
clip(alpha - cutoff);
#endif
return alpha;
}
#endif