I am trying to create cubemap from separated textures which comes from server at runtime.
I do UnityWebRequestTexture.GetTexture
for each texture and then Graphics.CopyTexture(tex, 0, cube, face)
Texture2D[] texture = ...
Cubemap cubemap;
{
cubemap = new Cubemap(texture[0].width, texture[0].format, false);
Graphics.CopyTexture(texture[1], 0, cubemap, 0);
Graphics.CopyTexture(texture[3], 0, cubemap, 1);
Graphics.CopyTexture(texture[5], 0, cubemap, 2);
Graphics.CopyTexture(texture[4], 0, cubemap, 3);
Graphics.CopyTexture(texture[0], 0, cubemap, 4);
Graphics.CopyTexture(texture[2], 0, cubemap, 5);
}
I guess to get correct cubemap at least in Inspector, but unexpectedly textures are flipped for no reason (see by_copytexture.png). When I do this by creating cubemap as asset and inserting preloaded textures to cubemap inspector view then I get correct cubemap (see by_hand.png).
It is possible to reproduce this case by importing cubemapCheck1.unitypackage which is attached to the tread to any project. It contains one scene, one script and 6 preloaded textures for cubemap.
4971878–484322–cubemapCheck1.unitypackage (232 KB)