Hello,
I am quite new to using render textures and I am currently trying to use them to display models in the UI, while in the editor its working pretty much fine and in the PC build, in the android build it’s showing up as a black square, I have messed around with the clear flags of the camera, different color formats of the texture and shaders for the materials however to no avail. I am currently using the default rendering pipeline for Unity. Am I missing something? The current android version I am testing on is Android 9. Thanks.
The code here converts the render texture in a texture 2d and then applies it to the raw image
void ApplyTexture()
{
Texture2D texture = new Texture2D(_renderTexture.width, _renderTexture.height, TextureFormat.RGBA32, false);
renderCamera.Render();
RenderTexture.active = _renderTexture;
texture.ReadPixels(new Rect(0, 0, _renderTexture.width, _renderTexture.height), 0, 0);
texture.Apply();
_image.texture = texture;
}
This is currently what its showing: