Net.Like.Xue.Tokyo/Assets/BITKit/Unity/Shader/AlwaysOnTopURP.shader

63 lines
1.6 KiB
Plaintext
Raw Normal View History

2024-11-03 16:42:23 +08:00
// SomeShader.shader
Shader "Custom/AlwaysOnTopURP"
{
Properties
{
_BaseMap ("Texture", 2D) = "white" {}
_Color ("Color", Color) = (1,1,1,1)
}
SubShader
{
Tags { "RenderType"="Opaque" "RenderQueue"="Geometry+1000" }
LOD 100
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
ZTest Always
Pass
{
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fragment _ALPHAPREMULTIPLY_ON
#pragma multi_compile_fragment _ALPHAMODULATE_ON
#pragma multi_compile_fragment _ALPHATEST_ON
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
float2 uv : TEXCOORD0;
};
struct Varyings
{
float2 uv : TEXCOORD0;
float4 positionCS : SV_POSITION;
};
TEXTURE2D(_BaseMap);
SAMPLER(sampler_BaseMap);
float4 _BaseMap_ST;
float4 _Color;
Varyings vert(Attributes IN)
{
Varyings OUT;
OUT.uv = TRANSFORM_TEX(IN.uv, _BaseMap);
OUT.positionCS = TransformObjectToHClip(IN.positionOS.xyz);
return OUT;
}
half4 frag(Varyings IN) : SV_Target
{
half4 color = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, IN.uv) * _Color;
return color;
}
ENDHLSL
}
}
}