您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
41 行
908 B
41 行
908 B
#ifndef UNIVERSAL_FALLBACK_2D_INCLUDED
|
|
#define UNIVERSAL_FALLBACK_2D_INCLUDED
|
|
|
|
struct Attributes
|
|
{
|
|
float4 positionOS : POSITION;
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
struct Varyings
|
|
{
|
|
float2 uv : TEXCOORD0;
|
|
float4 vertex : SV_POSITION;
|
|
};
|
|
|
|
Varyings vert(Attributes input)
|
|
{
|
|
Varyings output = (Varyings)0;
|
|
|
|
VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz);
|
|
output.vertex = vertexInput.positionCS;
|
|
output.uv = TRANSFORM_TEX(input.uv, _BaseMap);
|
|
|
|
return output;
|
|
}
|
|
|
|
half4 frag(Varyings input) : SV_Target
|
|
{
|
|
half2 uv = input.uv;
|
|
half4 texColor = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, uv);
|
|
half3 color = texColor.rgb * _BaseColor.rgb;
|
|
half alpha = texColor.a * _BaseColor.a;
|
|
AlphaDiscard(alpha, _Cutoff);
|
|
|
|
#ifdef _ALPHAPREMULTIPLY_ON
|
|
color *= alpha;
|
|
#endif
|
|
return half4(color, alpha);
|
|
}
|
|
|
|
#endif
|