Search Unity

[SOLVED] Texture2D, Mipmaps, and Compression

Discussion in 'Scripting' started by 4lk4tr43, Aug 28, 2014.

  1. 4lk4tr43

    4lk4tr43

    Joined:
    Feb 21, 2013
    Posts:
    4
    Hi

    I wanted to ask what the trick is to compress a texture with mipmaps correctly at runtime, because I get a strange mimap result when execute a compression. (dxt1 and dxt5)

    I marked the area where the real texture mip level 1 is with blue.
    Everything works fine when I do not compress the Texture2D.

    Code (CSharp):
    1. // TODO mipmaps are not compressed correctly
    2. Texture.Compress(TextureHighCompressionQuality);
    Thank you for your input
     
    Last edited: Aug 28, 2014
  2. hpjohn

    hpjohn

    Joined:
    Aug 14, 2012
    Posts:
    2,190
    Your texture is NPOT
    Its just filling in the unused pixels by smudging the borders.
    Use POTS
     
    4lk4tr43 likes this.
  3. 4lk4tr43

    4lk4tr43

    Joined:
    Feb 21, 2013
    Posts:
    4
    Thx a lot, that works.