75 lines
2.1 KiB
Plaintext

Shader "Hidden/Beautify2/DepthOnlyAlphaTest"
{
Properties
{
[MainTexture] _BaseMap ("Texture", 2D) = "white" {}
[MainColor] _BaseColor("Color", Color) = (1, 1, 1, 1)
_Cutoff("AlphaCutout", Range(0.0, 1.0)) = 0.5
}
SubShader
{
ColorMask 0
ZWrite On
Cull Back
Pass
{
Name "Beautify DepthOnly Alpha Test Pass"
HLSLPROGRAM
#pragma target 4.5
#pragma vertex UnlitPassVertex
#pragma fragment UnlitPassFragment
#pragma multi_compile _ DOTS_INSTANCING_ON
#pragma multi_compile_instancing
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
half _OutlineCutOff;
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
CBUFFER_START(UnityPerMaterial)
float4 _BaseMap_ST;
CBUFFER_END
#ifdef UNITY_DOTS_INSTANCING_ENABLED
UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata)
UNITY_DOTS_INSTANCED_PROP(float4, _BaseMap_ST)
UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata)
#define _BaseMap_ST UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _BaseMap_ST)
#endif
#include "DepthOnlyAlphaTest_Include.hlsl"
ENDHLSL
}
Pass
{
Name "Beautify DepthOnly Alpha Test Pass" // for older GPUs with no DOTs instancing
HLSLPROGRAM
#pragma target 2.0
#pragma vertex UnlitPassVertex
#pragma fragment UnlitPassFragment
#pragma multi_compile_instancing
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
half _OutlineCutOff;
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
CBUFFER_START(UnityPerMaterial)
float4 _BaseMap_ST;
CBUFFER_END
#include "DepthOnlyAlphaTest_Include.hlsl"
ENDHLSL
}
}
}