Search Feedback

64
votes

Custom Mipmap Textures

Graphics

-

-

In many cases, mipmap textures that are automatically generated are much lower in quality then they could be, even for their resolution. Allowing for custom mipmap textures would greatly improve rendering quality of textures without any increase in performance cost. Custom mipmaps are especially useful for texture atlases, where downsampling leads to blurry, low quality textures.

Comments (4)

  1. 065483a85fc953df40399d818b2f7fb0?d=mm

    -Linear-

    Aug 24, 2018 16:56

    Hey, found a workaround for people that really, really need this functionality. It's not pretty, but it works:

    Create an Editor script that spawns a Texture2D:

    var tex = new Texture2D(512, 512, TextureFormat.ARGB32, true);

    Call SetPixels32 for each miplevel:

    for(int i = 0;i < tex.mipmapCount;i++)
    {
    tex.SetPixels32(/* a block of pixels here */, i);
    }

    Then, call apply like this:

    tex.Apply(false);

    Afterwards, save out the Texture2D as an asset:

    AssetDatabase.CreateAsset(tex, "Assets/MyTexture.asset");
    AssetDatabase.SaveAssets();

    Your mipmaps will be preserved, and you'll end up with a Texture2D asset that acts like a normal texture. However, it will be a .asset file, not a PNG or a JPG, and it will have its own import settings that you'll have to tweak.

    I really wish there was a better way =/

  2. 5f3747d70f196ecbbb2db431a800e17b?d=mm

    Mr-Crumbles

    Jul 12, 2018 09:34

    I really need this feature. I'm working on a 3d game with pixel-art textures, and I can't achieve the correct look without being able to use custom mipmaps.

  3. 88f26214912f58c19e2d840933db8655?d=mm

    LaireonGames

    Oct 25, 2016 01:53

    For me even just being able to ignore mip maps after a certain level would be great. E.G in my 1024 atlas it creates 11 mip maps. However within this atlas I use 128 by 128 textures. This means that after mip 7 a tile in that atlas is smaller than a pixel so it becomes half an average of that tile and that of the ones beside it.

    In this scenario I would like to only use 7 mip maps, meaning each tiles final map map is represented by a single pixel

  4. A87c4a0dfc984c84ea19f6bedfc21acf?d=mm

    DanielSig

    Sep 10, 2016 18:23

    To underline the severity of the issue at hand.

    Unity automatically generates a texture asset that is displayed on most of the screen almost all the time in the game, and it can't even by edited directly by the developer.

Your opinion counts

Help us make things better. Share your great idea for improving Unity or vote for other people’s.

Log in to post a new idea

Categories

All

(10883)

2D

(287)

Ads

(57)

AI & Navigation

(81)

Analytics

(130)

Animation

(406)

Asset Store

(363)

Asset Store Publisher

(19)

Assets

(551)

Audio

(185)

Cloud Build

(146)

Collaborate

(67)

Docs & Tutorials

(246)

Editor

(2545)

Everyplay

(17)

Game Performance Reporting

(21)

General

(987)

Graphics

(894)

GUI

(442)

Input

(173)

Licensing

(93)

Networking

(189)

Physics

(387)

Platforms

(445)

Profiling & Optimization

(84)

Runtime

(185)

Scripting

(1141)

Terrain

(174)

WebGL

(142)