Need to understand GetRawTextureData but I can't

Hi,

I have a texture that is 2048x2048 but when I call GetRawTextureData I get an array of length 524,288.

So what I cannot understand is why as 2048*2048 = 4,194,304 and how do I change the array element corresponding to say [10,10].

Can anyone help?

So you know, the 2D forum here is not related to general graphics questions.

I’ll move your post to the graphics forum for you.

Probably you are calling it on a texture that is compressed. GetRawTextureData will return the compressed texture data. You need to use a uncompressed texture format to set the colors at runtime, or use a texture that unity supports runtime texture compression for.

@joshuauacwilde I believe you are correct as the editor is show 2048x2048 RGB Compressed DXT1|BC1 UNorm when previewing the png.

1 Like