RawImage with RenderTexture texture not working on Android


We want to have some 3D models appear on top of our GUI (we use Canvas), so we decided to have an extra camera render those objects to a RenderTexture. Then, in the canvas, we have a Raw Image that uses the texture and is the top (closes to camera) object.

This works really well in Editor and on iOS, but not at all on Android. It’s as if nothing gets rendered to the RenderTexture.

I tried changing settings, making sure that the RT is power of two, and also did a printout to check if the references on the Camera or Raw Image were lost ( they were not ). Now i’m out of ideas.

Here’s a screenshot from the editor, showing how it’s supposed to look. 76844-working.png

I was getting quite desperate to fix this untill i did this printout:

    Look at target: Target position is 74.41666, 22.16666, -1.
    Look at target: Camera position is 380, 237.5, -1294.203.

08-25 13:33:44.517: I/Unity(17771): Look at target: Target position is 188, 56, -1.
08-25 13:33:44.534: I/Unity(17771): Look at target: Camera position is 960, 540, -3269.564.

From this point i could clearly see that on Android the distance between my 3d Gui elements was bigger than 3000, the cameras far plane. Increasing it to 30 000 solved the issue.

I don’t know why the values are different on android, editor and ISO. Possibly because the distance is dynamically created based on the size of the canvas position in world.