Texture2D.GetPixels gives OutOfMemoryException

Hey folks,

I have several textures that I read in with GetPixels(), every texture has a size of 1024x1024.

Now in the webplayer it often crashes after the first or second texture, giving the following error:

I’m using a very powerful machine so memory shoudn’t really be any problem. Also it only happens in the webplayer.

Any hints??

Can you post the code you are using to do this?

Of course:

// Gain current texture

Texture2D oldTexture	= colorizeMaterial.mainTexture as Texture2D;

// Create new texture and copy old texture

Texture2D texture = new Texture2D( oldTexture.width, oldTexture.height, TextureFormat.ARGB32, true );
Color[] listColors = oldTexture.GetPixels( ); // <----- this one crashes

texture.SetPixels( listColors  );

The previously assigned texture is flagged as readable.