先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
42 lines
920 B
HLSL
42 lines
920 B
HLSL
#ifndef SPRITES_DEPTH_ONLY_PASS_INCLUDED
|
|
#define SPRITES_DEPTH_ONLY_PASS_INCLUDED
|
|
|
|
#include "UnityCG.cginc"
|
|
|
|
sampler2D _MainTex;
|
|
float _Cutoff;
|
|
float _ZWriteOffset;
|
|
|
|
struct VertexInput {
|
|
float4 positionOS : POSITION;
|
|
float2 texcoord : TEXCOORD0;
|
|
float4 vertexColor : COLOR;
|
|
};
|
|
|
|
struct VertexOutput {
|
|
float4 positionCS : SV_POSITION;
|
|
float4 texcoordAndAlpha: TEXCOORD0;
|
|
};
|
|
|
|
VertexOutput DepthOnlyVertex (VertexInput v) {
|
|
VertexOutput o;
|
|
o.positionCS = UnityObjectToClipPos(v.positionOS - float4(0, 0, _ZWriteOffset, 0));
|
|
o.texcoordAndAlpha.xy = v.texcoord;
|
|
o.texcoordAndAlpha.z = 0;
|
|
o.texcoordAndAlpha.a = v.vertexColor.a;
|
|
return o;
|
|
}
|
|
|
|
float4 DepthOnlyFragment (VertexOutput input) : SV_Target{
|
|
float4 texColor = tex2D(_MainTex, input.texcoordAndAlpha.rg);
|
|
|
|
#if defined(_STRAIGHT_ALPHA_INPUT)
|
|
texColor.rgb *= texColor.a;
|
|
#endif
|
|
|
|
clip(texColor.a * input.texcoordAndAlpha.a - _Cutoff);
|
|
return 0;
|
|
}
|
|
|
|
#endif
|