1
This commit is contained in:
62
Src/Unity/Shader/AlwaysOnTopURP.shader
Normal file
62
Src/Unity/Shader/AlwaysOnTopURP.shader
Normal file
@@ -0,0 +1,62 @@
|
||||
// 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
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user