(FIX FOUND) EasyAR 3.0.1 Unity iOS camera feed upside down using HDR

+4 votes
asked Aug 28, 2019 by spaceagent (1,190 points)
edited Nov 11, 2019 by spaceagent

The camera feed is upside down on iOS devices using Metal graphics API and with HDR enabled in Graphics settings in Unity. It looks like it is a shader problem related to platform-specific rendering differences.

UPDATE: We managed to find the solution and another related Unity bug.

First the problem is with the EasyAR shaders as initially tought is related to platform-specific rendering differences, second it is a problem with how Unity render its camera and how HDR changes that, as we mentioned in this update.

To fix this we modified all EasyAR shaders to flip the texture uv when #if UNITY_UV_STARTS_AT_TOP is true and a script that set forceIntoRenderTexture to true on the Unity camera, that is doing the same thing that enabling HDR do, except the actual HDR effect.

Here is a link with the modified shaders, just enable forceIntoRenderTexture on the Unity camera with a script and it should work.

2 Answers

0 votes
answered Aug 28, 2019 by nigelkp9 (220 points)
Was your video feed rotated 180 degrees, or was it mirrored? In the forum post you linked, they are experiencing a mirrored video feed, I am just wondering as ours is rotated 180 degrees. I implemented your fix and the video is rotated correctly, but the augmented content is still rotated 180 degrees
commented Aug 29, 2019 by spaceagent (1,190 points)
Yes, the video feed was rotated 180 degrees, the forum post is not related directly with this problem, but it shares the same cause. Also in our case the augmented content was always showing the correct way, we had problems only with the camera feed.
Check a sample scene to see if it is a problem from your scene or from EasyAR.
commented Aug 29, 2019 by nigelkp9 (220 points)
Thank you for the suggestion, I will continue on. Seems like I have two separate issues then
0 votes
answered Nov 10, 2019 by rahnaaqmalina (140 points)
the link is not working, can u reupload again the modified shaders, please..
commented Nov 11, 2019 by spaceagent (1,190 points)
I've updated the link, but to let you know, in the end we didn't use this solution because it is still with bugs. For iOS we switched to OpenGLES graphics API, which is fully supported by EasyAR
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...