- Home /
How do you use mipmaps?
Mipmaps just seem to make everything look really bad so i always keep them unchecked. Is there a correct way of using them that doesn't just totally trash your graphics?
I'm assuming I just don't know how to make use of them! What I find is any way I play the mipmaps they just look like junk.... but they must have a sensible function. I'm interested in tightening up my rendering so I want to learn how to use them properly... I know they can make rendering much lighter.
my question is... how to implement mipmaps nicely?
thanks for your answer! not seeing any artifacts, but i found what was going on to destroy mipmaps. i had quality setting at 1/8 res. once i set quality to full res, mipmaps worked more as expected, nicely fading out in distance.
however my builds today with mipmaps, the graphics was not significantly better & it ran about 5 fps slower then without. seems in my current game project mipmaps have no place, but now that i know what's going on, i'll keep them in $$anonymous$$d for future projects!
Answer by Eric5h5 · Apr 10, 2012 at 06:59 AM
You should always have mipmaps checked if you're using 3D, because otherwise you get awful artifacts when the camera moves, plus it runs faster since it doesn't have to calculate so many pixels for distant objects. Other than looking slightly blurry compared to not having mipmaps, there shouldn't be any downsides, and the slight blurriness is more than compensated for by the lack of flickering texture artifacts. You can use trilinear filtering so that the transition between mipmap levels is smooth. If you have any serious degradation with mipmaps, that's not normal and maybe you need to update your drivers or something.
Additionally @citycrusher, toy with `Aniso Level` and `Filter $$anonymous$$ode` for better / more expensive results. Worked for me! ;)
Answer by Max_Bol · Aug 27, 2018 at 03:49 PM
There's not a clear an fixed answer to this question because it's always depends on the project itself.
.
The general rule is as following:
.
You need Mipmaps if...
Your asset might have a different level of details rendered on a screen at the same time. For example, if you got some generic props for the background that are repeated at many places in the screen (close to the camera as well as far from it), those asset will require mipmaps if you want to optimize the amount of memory used per-asset as well avoiding pixel artifacts when the rendering pipeline is forced to cut out 2/3 of the pixels of the texture as the asset is way too far in the background for it to display every details on its surface. You might also need mipmaps if you use any kind of LOD that uses the same texture between each layer of LOD.
.
You don't need Mipmaps if...
If your assets are always displayed from the same range and you don't allow the player to zoom in. This is the case for games like 2.5D isometric view games (like Diablo-style) in which the player can't zoom-in and might also be the case of some of the assets in a game with very limited depth visibility such as a a game focused on sidescrolling for its movement. A game like Little Nightmares doesn't need mipmaps for example because the level of details between the background assets and the forth assets doesn't really maters as it's mostly the same due to the game limited depth interactivity (meaning you mostly move on a 2 axis with limited depth-based movement toward the Z axis) In such cases, you need to control the source files directly by testing and attributing the right resolution to the assets' texture and settings. (In those case, the trick is usually to start with a 2K texture and, in Unity, drop the Max Size of the texture until it gets too ugly from the actual gameplay camera view. It's not rare that you can drop by half or even at a 1/4 a couple of textures as the impact is almost not noticeable unless you know about it. When you build the game built, the textures will get resized automatically based on the Max Size setting.)
.
The rule is usually a per-asset rule meaning that you got to think the same question for each texture. For example, if you're making a Metroidvanilla styled game where you can have a far-off view in the background that includes assets (such as rocks or trees) you also use close to the camera, those will mostly require mipmaps. On the other hand, if you got some walls and some props (like animated doors) that never appears far from the camera (like the assets used in a part underground), those don't need mipmaps at all and you should avoid those at all cost! Another example in a more mainstream kind of game would be a FPS. Your player's arms which mostly floats in the air... as well as your player model (if unique) doesn't need any mipmaps. They are only seen from up close so you don't need to allow the engine to waste any resources that would allow it to display a less-then-required level of details. Enemies that might appears over 100m away will requires mipmaps.
.
Now, one of the most asked question is about how to avoid mipmaps to look ugly. There are multiple possibles reasons for a mipmaps to look ugly or visually create artifacts on the textures.
The mipmaps settings are wrong. Obviously, if the settings are wrongs, the result will be wrong.
The model's UVs aren't properly set. This is the less obvious part that might make you hate yourself now and then. The general rule for the UVs of the model to be properly setup with mipmaps is to avoid having UV seams anywhere near important details in the model's texture. If you got some emissive bits on your model, makes sure there are no seams close to those emissive bits. Otherwise, you might be forced to turn mipmaps off from the emissive texture as it will make the seams visible from a mile away once the mipmaps kicks in.
Use clamp and avoid repeat wrap mode. Repeat wrap mode is basically when you need the texture to loop so that you can use extend and use the same part of the texture multiple times through its UVs. For example, a fence's texture might use Repeat Wrap mode to allow a relatively high level of details while keeping the texture size small. Such things works really badly with the mipmaps as the Repeat wrap Mode might generate artifacts in the alpha channel which end up displaying seams in-between the tiled texture. For such things, instead, you should use a Clamp Wrap mode and, in the model and its UVs, manually set the faces/vertex so that it repeat within the UVs bounds.
Very nice explanation @$$anonymous$$ax_Bol . Can you also clarify one question. I have checked with Adreno that mipmaps are actually placed in the same texture. so the question is if we have 100 textures and each increase their size somewhere 1.3 times. that is actually a real down side. no?
Your answer
Follow this Question
Related Questions
iOS: Specify Top Level Texture Mipmap 0 Answers
Why the object is pixelated in build? 1 Answer
Mipmap view not working in editor. 0 Answers
How to disable mipmaps? 1 Answer
Floor - aliasing 0 Answers