A mip or mip level is a version of a texture with a specific resolution. Mips exist in sets called mipmaps. Mipmaps contain progressively smaller and lower resolution versions of a single texture.
For example, a mipmap might contain four versions of a texture, from the original texture (Mip 0), to Mip 1, Mip 2, and Mip 3:
Mipmaps are commonly used for rendering objects in 3D scenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary, where textured objects can vary in distance from the cameraA component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary. A higher mip level is used for objects closer to the camera, and lower mip levels are used for more distant objects.
Mipmaps can speed up rendering operations and reduce rendering artifacts in situations where the GPU renders a texture at less than its full resolution. A mip is effectively a cached, downsampled version of the original texture. Instead of performing many sampling operations on the original, full resolution texture, the GPU can perform a smaller number of operations on the already downsampled version.
Sometimes, mipmaps aren’t beneficial. Mipmaps increase the size of a texture by 33%, both on disk and in memory. They also provide no benefit when a texture is only rendered at its full resolution, such as a UI(User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary texture that isn’t scaled.
You can create a mipmap for a texture manually, or you can instruct Unity to generate a mipmap for you. To automatically generate a mipmap, ensure that your original texture’s resolution is a power of two value, as shown in the example mipmap image.
You can enable or disable mipmaps for a texture asset in the Texture Import Settings Inspector.
When the GPU samples a texture, it determines which mip level to use based on the texture coordinates (UVs) for the current pixelThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
See in Glossary, and two internal values that the GPU calculates: DDX and DDY. DDX and DDY provide information about the UVs of the pixels beside and above the current pixel, including distances and angles.
The GPU uses these values to determine how much of a texture’s detail is visible to the camera. A greater distance and a more extreme angle between the current pixel and its neighbors means that the GPU picks a lower resolution mip; a shorter distance and less extreme angle means that the GPU picks a mip with a higher resolution.
The GPU can also blend the texture information from two mips together with trilinear filtering. Blending mips while sampling can make the transition from one mip to another less noticeable. To blend mips, the GPU takes a specific percentage of texture information from one mip and the rest from another mip.
A setting called mip bias can do two things while sampling, based on the sampler settings:
The GPU has a global mip bias that it applies to its mip selection by default. Textures can have their own mip bias, which Unity adds or subtracts from the global mip bias. You can also specify your own mip bias for an individual texture sampling operation in a shaderA program that runs on the GPU. More info
See in Glossary.
To set the mip bias for an individual texture, see Texture.mipMapBias. To set a mip bias for a texture sampling operation in a hand-coded shader, use HLSL functions such as tex2dbias. To set a mip bias for a texture sampling operation in Shader Graph, see Sample texture 2D Array node or Sample texture 2D node.
You can control the way that Unity loads mipmaps at runtime with Mipmap Streaming.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.