Created
April 25, 2020 18:24
-
-
Save byBretema/d45fbf1030f8cde4995deb718ea25941 to your computer and use it in GitHub Desktop.
Quick shader to debug texture coordinates of a given mesh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/DebugUVs" { | |
SubShader { | |
Pass { | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag | |
#include "UnityCG.cginc" | |
struct v2f { | |
float4 pos : SV_POSITION; | |
fixed3 color : COLOR0; | |
}; | |
v2f vert (appdata_base v) | |
{ | |
v2f o; | |
o.pos = UnityObjectToClipPos(v.vertex); | |
o.color = v.texcoord; | |
return o; | |
} | |
fixed4 frag (v2f i) : SV_Target | |
{ | |
return fixed4 (i.color, 1); | |
} | |
ENDCG | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment