Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I load a texture using the code below:

WWW www = new WWW(textureName);     

yield return www;

renderer.material = new Material(Shader.Find("Diffuse"));

Texture tex = www.texture;
tex.filterMode = FilterMode.Trilinear;

renderer.material.mainTexture =tex;

The texture does not come with mipmaps, how can I tell unity to generate the mipmaps?

share|improve this question
up vote 6 down vote accepted

You could simply create a new texture using the width/height information from the WWW's texture, and pass true to the mipmap parameter of the constructor. Then you can use the GetPixels and SetPixels methods to copy the data over (the texture returned from the WWW object is read-only so you probably can't modify it directly).

See also:

share|improve this answer
This works fine, thanks! – bcsanches May 6 '11 at 1:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.