Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Purpose of mipmaps for 2D sprites?

In current Unity,

For use in Unity.UI as conventional UI ..

for any "Sprite (2D and UI)", in fact it always defaults to having "Generate Mip Maps" turned ON. Every time you drop an image in, you have to turn that "off" and apply.

As noted in the comments, these days you can actually use world space UI canvasses, and indeed advanced users may indeed have (say) "buttons that float over the head of Zelda and they are in the far distance". However if you're a everyday Unity user adding a button, just turn it off :)

enter image description here

like image 661
Fattie Avatar asked Feb 17 '16 15:02

Fattie


People also ask

Why are mipmaps used?

Mipmap textures are used in 3D scenes to decrease the time required to render a scene. They also improve image quality by reducing aliasing and Moiré patterns that occur at large viewing distances, at the cost of 33% more memory per texture.

What is mipmaps in unity?

Mipmapping is a technique where a high-resolution texture is downscaled and filtered so that each subsequent mip level is a quarter of the area of the previous level. This means that the texture and all of its generated mips requires no more than 1.5 times the original texture size.

What are mipmaps levels?

A mipmap is a sequence of textures, each of which is a progressively lower resolution representation of the same image. The height and width of each image, or level, in the mipmap is a power of two smaller than the previous level. Mipmaps do not have to be square.

What does MIP stand for graphics?

MIP stands for "multum in parvo," which is Latin for "many in a small place." See bilinear interpolation, trilinear interpolation, texture map and point sampling. MIP Maps MIP maps provide more depth realism to objects, because texture maps for varying levels of depth have been prepared.


1 Answers

In Unity, "sprites" can still be positioned in 3D space. For example, on a world space canvas. Furthermore, mipmaps are used when the sprite is scaled. This is because the mipmap sampling is determined by the texel size rather than the distance.

If a sprite is flat and perfectly scaled then there is no reason to use mipmaps. This would likely apply to your icon example.

I suspect that it is enabled by default for 2D games where sprites will often not be perfectly scaled. To clarify, a sprite does not need to be on a canvas. Sprites can exist as their own GameObject with a Sprite Renderer (not on a canvas.) When this is the case, scaling the camera view will change the sprite's size on the screen resulting in mipmapping due to the texel size changing. This results in making the sprite always perfectly scaled challenging without a canvas.

like image 168
agriffin Avatar answered Sep 18 '22 16:09

agriffin