I am trying to apply a shader to a Skinned Mesh Renderer. However I have no idea how Unity calculates the Texture coordinates for Skinned Mesh Renderers. I have the feeling some sort of atlassing is used. Can someone give me an example or an explanation on the texture coordinates of a Skinned Mesh Renderer?
Preferably I am looking for a texture coordinate which isn’t used twice (so not mirrored), but any help would be great either way!

Shader “Clipping/Texture Clipped” {
Properties {
_MainTex (“Base (RGB)”, 2D) = “white” {}
_ClipTex (“Clip (RGB)”, 2D) = “white” {}
_InnerTex (“Inner (RGB)”, 2D) = “white” {}
}
SubShader {
Pass {
Cull Back
CGPROGRAM
#pragma exclude_renderers gles
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f {
float4 pos : SV_POSITION;
float2 uv[2] : TEXCOORD0;
float4 color : COLOR0;
};
uniform sampler2D _InnerTex;
uniform float4 _InnerTex_ST;
uniform sampler2D _ClipTex;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
v2f vert( appdata_base v ) {
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.uv[0] = v.texcoord;
o.uv[1] = v.texcoord;
o.uv[1].x /= 2.0;
// lighting from single directional light + ambient
float4 color = UNITY_LIGHTMODEL_AMBIENT;
float3 lightDir = mul( glstate.light[0].position.xyz, (float3x3)UNITY_MATRIX_IT_MV );
float ndotl = max( 0, dot( lightDir, v.normal ) );
color.xyz += glstate.light[0].diffuse * ndotl;
o.color = color;
return o;
}
void frag(v2f IN, out float4 finalColor : COLOR) {
float a = tex2D(_ClipTex, IN.uv[1].xy);
if (a < 0.1)
discard;
finalColor = IN.color * tex2D(_MainTex, TRANSFORM_TEX(IN.uv[0].xy, _MainTex));
}
ENDCG
AlphaTest Greater 0.1
SetTexture [_MainTex] {
Combine texture * primary DOUBLE, texture * primary
}
SetTexture [_ClipTex] { Combine previous, texture }
}
Pass {
Cull Front
CGPROGRAM
#pragma exclude_renderers gles
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f {
float4 pos : SV_POSITION;
float2 uv[2] : TEXCOORD0;
float4 color : COLOR0;
};
uniform sampler2D _InnerTex;
uniform float4 _InnerTex_ST;
uniform sampler2D _ClipTex;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
v2f vert( appdata_base v ) {
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.uv[0] = v.texcoord;
o.uv[1] = v.texcoord;
o.uv[1].x /= 2.0;
// lighting from single directional light + ambient
float4 color = UNITY_LIGHTMODEL_AMBIENT;
float3 lightDir = mul( glstate.light[0].position.xyz, (float3x3)UNITY_MATRIX_IT_MV );
float ndotl = max( 0, dot( lightDir, v.normal ) );
color.xyz += glstate.light[0].diffuse * ndotl;
o.color = color;
return o;
}
void frag(v2f IN, out float4 finalColor : COLOR) {
float a = tex2D(_ClipTex, IN.uv[0].xy);
if (a < 0.1)
discard;
finalColor = IN.color * tex2D(_InnerTex, TRANSFORM_TEX(IN.uv[0].xy, _InnerTex));
}
ENDCG
AlphaTest Greater 0.1
SetTexture [_MainTex] {
Combine texture * primary DOUBLE, texture * primary
}
SetTexture [_ClipTex] { Combine previous, texture }
}
}
Fallback "VertexLit"
}
If I divide uv[1].x by 2 I get this however:

Thank you for your reply. I would think so too. However when I use the texture coordinates on another texture which is blitted with the original, the result shows something else. I will attach my shader and a screenshot.
– KajosI added an example. The white square with blacks is the cliptex.
– KajosI've never seen or tried to write a shader that was only a vertex program - so I'm not sure how that might be affecting it - having the fragment be some fixed function thing...
– whydoidoitI added a fragment part as well today; see the original question. It doesn't matter for the uv's though..
– KajosAbove fragment is not 100% correct. However funny thing is if I divide uv[1].x by two it just works. So I guess that solves it.. I have no idea why though..
– Kajos