- Home /
Load texture at full resolution when using quality settings
I'm struggling with very strange problem. I'm using quality settings to reduce memory usage on mobile platforms with half textures. But there are some sprites, which I need to load at full resolution with mip maps. I'm using www class.
var txt = new Texture2D(1, 1, TextureFormat.ARGB32, true);
//this will turn off readable texture
txt.Apply(true, false);
www.LoadImageIntoTexture(txt);
var pixels = www.texture.GetPixels(0);
//HACK ??? I thought, this could work
txt.SetPixels(pixels, 0);
//not updating mipmaps, but first mip map level is still half
txt.Apply(false,true);
www.Dispose();
This code will load texture successfully,but unity will throw away first level of mipmaps from texture. I've tried also second approach, where I am not using method LoadImageIntoTexture, and setting pixels via SetPixels direcly. I suppose, that method texture.Apply is looking to quality settings and if using half textures, than first level of mipmaps is ignored.
Does anybody know some workaround to this ?
Your answer
Follow this Question
Related Questions
Get Texture 2D after all shader passes are applied 0 Answers
Making texture cover whole button 1 Answer
Select part of the texture in GUI.DrawTexture 2 Answers
Paint Grid Texture 1 Answer