Does anyone have any suggestions as well as some pseudo code logic for a fast way to rotate pixels in a Color array?
I’m rendering out a T-shape cubemap to a file, but for the sake of the model UVs, I need it to be cohesive all the way around. Currently, the SetPixels method always renders in the same direction.
that works for the most part but appears to have a rounding problem.
Now I need to flip the image, which is basically this:
public Texture2D flipTexture(Texture2D tex)
{
Texture2D flipImage = new Texture2D(tex.width, tex.height);
int x,y;
for (x = 0; x < tex.width; x++)
{
for ( y = 0; y < tex.height; y++)
{
flipImage.SetPixel(y,x,getPixel(tex,x,y));
}
}
flipImage.Apply();
return flipImage;
}