GQ_Communicate/GQ_TongXin/Assets/Resources/AlwaysVisibleUI.shader

51 lines
1.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Shader "Custom/AlwaysVisibleUI"
{
Properties
{
_MainTex("Texture", 2D) = "white" {} // UI的纹理贴图
}
SubShader
{
Tags { "Queue" = "Overlay" } // 设置UI的渲染队列为 Overlay使UI始终在其他物体之上
LOD 1000
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
};
sampler2D _MainTex;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
fixed4 frag(v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
return col;
}
ENDCG
}
}
}