Question by
sewy · Oct 23, 2018 at 12:26 PM ·
texturegraphicserror messagecompressioncopy
Using Graphics.CopyTexture with Compressed (DXT) textures
Hello, anyone makes Graphics.CopyTexture work with Compressed (DXT) textures?
From Graphics.CopyTexture
Compressed texture formats add some restrictions to the CopyTexture with a region variant.
For block-based formats (e.g. DXT, ETC), the region size and coordinates must be a multiple of
compression block size (4 pixels for DXT).
Which I quite not understand what they mean by region size and coordinates, and how I should alter the code. I am using
for(int j = 0; j < texture.mipmapCount; j++) { // Copy all mipmap levels
Graphics.CopyTexture(texture, 0, j, texture2DArray, i, j); //-i- is index into texture2DArray
}
But getting:
Invalid texture format: 25
UnityEngine.Graphics:CopyTexture(Texture, Int32, Int32, Texture, Int32, Int32)
Image invalid format!
UnityEngine.Graphics:CopyTexture(Texture, Int32, Int32, Texture, Int32, Int32)
But the result saved in texture2DArray looks OK. Any help will be appreciated.
Comment
Best Answer
Answer by sewy · Nov 14, 2018 at 09:15 AM
Seems to be problem in Unity 2018.3. (0b7 in my case). In 2018.2.8f1 there is no error.