- Home /
It was a conflict with another plugin used to display a video on that same mesh. Still don't really know what specifically caused the issue with that plugin, but I was able to separate the two and it solves the problem.
flip shader UV reading on ios
Hi,
I use a plugin to paint on a plane mesh with a mesh collider using touch position. It's working fine on Android, however on iOS there is a flip/mirrored problem. When I touch on the top of the mesh, paint is applied on the bottom.
I read about a shader issue depending on the plateform here :
https://docs.unity3d.com/Manual/SL-PlatformDifferences.html
where there is an exemple :
// Flip sampling of the Texture:
// The main Texture
// texel size will have negative Y).
#if UNITY_UV_STARTS_AT_TOP
if (_MainTex_TexelSize.y < 0)
uv.y = 1-uv.y;
#endif
it looks like my problem solution, but I dont know where to put this code in the shader to solve the problem...
Any idea about that or another workaround ?
Thank you very much for your help.
Answer by tanoshimi · Dec 03, 2016 at 09:10 AM
Since you're flipping all your UVs, you only need to do that per-vertex rather than per pixel. So add it in to your vert program.