Search Unity

set [url]www.texture[/url] use MipMap?

Discussion in 'Scripting' started by airstick, Apr 7, 2009.

  1. airstick

    airstick

    Joined:
    Feb 16, 2009
    Posts:
    29
    hi everybody:

    i use www.texture import a texture below:

    (
    var url = "http://images.earthcam.com/ec_metros/ourcams/fridays.jpg";
    function Start () {
    // Start a download of the given URL
    var www : WWW = new WWW (url);

    // Wait for download to complete
    yield www;

    // assign texture
    renderer.material.mainTexture = www.texture;
    }
    )


    but how to set a mipmap for this texture?

    thanks!!
     

    Attached Files:

  2. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Use LoadImageIntoTexture - first create a small texture (e.g. 4x4) with mipmaps, then load into that texture. Since the texture will have mipmaps, the loading code will create mipmaps as well.
     
  3. airstick

    airstick

    Joined:
    Feb 16, 2009
    Posts:
    29
    thanks Aras!
    it`s great answser!!