Hello, I’m trying to create an app for VR (Pico G2 4K headset) and I need to load textures at runtime from a folder inside the headset (so that they can be changed without touching the app) and then set them onto a plane.
Now the thing is I can load and set as textures images that are 24 bit images, but 32 bit images I can’t find a way to load them, they never appear and I can’t figure out why or how to solve it. I’ve tried setting the format in the code to both ARGB32
and RGBA32
I’ve found that it’s not a matter of setting the texture into the material but rather that the image doesn’t load at all, the result of the function LoadImage(byteArray) is false, I can’t understand what’s happening.
Is it impossible to load 32 bit images at runtime by any chance?
Here is my code:
TempTex = new Texture2D(512, 512, TextureFormat.RGBA32, false);
byte[] byteArray = System.IO.File.ReadAllBytes(StoredPath);
TempTex.LoadImage(byteArray);
TempTex.Apply();
transform.GetComponent<Renderer>().material.mainTexture = TempTex;