|
|
|
|
|
|
{ |
|
|
|
float alpha = SAMPLE_UVMAPPING_TEXTURE2D(ADD_IDX(_BaseColorMap), ADD_ZERO_IDX(sampler_BaseColorMap), ADD_IDX(layerTexCoord.base)).a * ADD_IDX(_BaseColor).a; |
|
|
|
|
|
|
|
#ifndef ALPHA_USED_AS_SMOOTHNESS |
|
|
|
#if defined(_ALPHATEST_ON) && !defined(LAYERED_LIT_SHADER) |
|
|
|
float alphaCutoff = _AlphaCutoff; |
|
|
|
#ifdef CUTOFF_TRANSPARENT_DEPTH_PREPASS |
|
|
|
alphaCutoff = _AlphaCutoffPrepass; |
|
|
|
#elif defined(CUTOFF_TRANSPARENT_DEPTH_POSTPASS) |
|
|
|
alphaCutoff = _AlphaCutoffPostpass; |
|
|
|
#endif |
|
|
|
DoAlphaTest(alpha, alphaCutoff); |
|
|
|
#if defined(_ALPHATEST_ON) && !defined(LAYERED_LIT_SHADER) |
|
|
|
float alphaCutoff = _AlphaCutoff; |
|
|
|
#ifdef CUTOFF_TRANSPARENT_DEPTH_PREPASS |
|
|
|
alphaCutoff = _AlphaCutoffPrepass; |
|
|
|
#elif defined(CUTOFF_TRANSPARENT_DEPTH_POSTPASS) |
|
|
|
alphaCutoff = _AlphaCutoffPostpass; |
|
|
|
surfaceData.perceptualSmoothness = 1; |
|
|
|
#else |
|
|
|
surfaceData.perceptualSmoothness = alpha; |
|
|
|
alpha = 1; |
|
|
|
DoAlphaTest(alpha, alphaCutoff); |
|
|
|
#endif |
|
|
|
|
|
|
|
float3 detailNormalTS = float3(0.0, 0.0, 0.0); |
|
|
|
|
|
|
bentNormalTS = ADD_IDX(GetBentNormalTS)(input, layerTexCoord, normalTS, detailNormalTS, detailMask); |
|
|
|
|
|
|
|
#if defined(_MASKMAP_IDX) |
|
|
|
surfaceData.perceptualSmoothness *= SAMPLE_UVMAPPING_TEXTURE2D(ADD_IDX(_MaskMap), SAMPLER_MASKMAP_IDX, ADD_IDX(layerTexCoord.base)).a; |
|
|
|
surfaceData.perceptualSmoothness = SAMPLE_UVMAPPING_TEXTURE2D(ADD_IDX(_MaskMap), SAMPLER_MASKMAP_IDX, ADD_IDX(layerTexCoord.base)).a; |
|
|
|
surfaceData.perceptualSmoothness *= ADD_IDX(_Smoothness); |
|
|
|
surfaceData.perceptualSmoothness = ADD_IDX(_Smoothness); |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef _DETAIL_MAP_IDX |
|
|
|