Hi, I’m pretty new to unity and I’ve been out of graphics programming for a few years and I’m hoping someone can help with this odd problem.
I’m noticing that Textures that I import and map to a plane seem to be flipped.
I’ve created a test scene with just a camera, directional light and a plane that’s been rotated -90 about the x axis. I created a test texture:
I than set the texture on the material assigned to the plane and this is what was shown in the game preview:
I created a test shader that simply colors the pixel based on the texture coordinate to make sure that 0,0 is in the right spot.
Pass {
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
sampler2D _MainTex;
struct vertInput {
float4 v : POSITION;
float4 tc : TEXCOORD0;
};
struct fragmentInput {
float4 p : SV_POSITION;
float4 tc : TEXCOORD0;
};
fragmentInput vert(vertInput vi) {
fragmentInput fi;
fi.p = mul(UNITY_MATRIX_MVP, vi.v);
fi.tc = vi.tc;
return fi;
}
float4 frag(fragmentInput fi) : COLOR {
float4 c = tex2D (_MainTex, fi.tc.xy);
//return float4(c.rgb, 1.0);
return float4(fi.tc.xy, 0, 1.0);
}
ENDCG
}
This shader produced an image that was black in the upper right hand corner of the plane. The only way that this could happen (that I can think of) is that the image is being flipped by the engine before being sampled.
Anyone have any ideas? Am I missing something obvious?

