Camera view upside down when adding shader to a camera

+1 vote
asked Aug 8, 2019 by robotkittens (150 points)
When I have a shader on a camera (main camera or ar camera) the camera image flips upside down. Is there a way to fix this? Is anyone else having this problem? (only on android / iOS, not on desktop btw).

1 Answer

0 votes
answered Aug 12, 2019 by spaceagent (1,290 points)

Most probably it is happening because of platform specific UV coordinates. You will need to modify the shader to flip UV coordinates on mobile devices using #if UNITY_UV_STARTS_AT_TOP

You can find more info in the Unity manual

commented Aug 12, 2019 by robotkittens (150 points)
The shader is orientated correctly, because it also shades the other elements under the unity camera (like the interfaces & other 3d objects). So only the camera image flips. Not everything under the shader.
commented Aug 12, 2019 by spaceagent (1,290 points)
If it is happening only when using a custom shader on the camera, it is a shader issue.
EasyAR 3 is using CommandBuffer to render camera feed and using its own custom shaders, everything else is rendered in a separate pass so is not influenced by the shader.
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.