Skip to content

Instantly share code, notes, and snippets.

@byBretema
Created April 25, 2020 18:24
Show Gist options
  • Save byBretema/d45fbf1030f8cde4995deb718ea25941 to your computer and use it in GitHub Desktop.
Save byBretema/d45fbf1030f8cde4995deb718ea25941 to your computer and use it in GitHub Desktop.
Quick shader to debug texture coordinates of a given mesh
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