UVColor.shader
Shader "My/UVColor" { Properties { } SubShader { Tags { "RenderType" = "Opaque" } LOD 100 Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag #pragma target 2.0 #include "UnityCG.cginc" struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; }; v2f vert(appdata_t v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); o.vertex.xyzw = o.vertex.xyzw / o.vertex.w; o.texcoord = v.texcoord; return o; } fixed4 frag(v2f i) : SV_Target { fixed4 c = fixed4(0, 0, 0, 1); c.xy = i.texcoord; return c; } ENDCG } } }
标签:frag,显示,颜色,fixed4,uv,vertex,texcoord,v2f,pragma From: https://www.cnblogs.com/sailJs/p/17071580.html