Basics of Mipmaps in Unity Part 2! Shaders, Bias, and Texture2DLOD! ✔️ 2021.1 | Game Dev Tutorial

preview_player
Показать описание
✔️ Works in 2020.3 ➕ 2021.1

Mipmaps are scaled down versions of textures Unity generates which look and perform better when the texture shrinks on the screen. In this video, I wrap up this series on mipmaps by investigating how the renderer chooses which mip level to use and how you can influence this with SampleTexture2DLOD and mipmap biases. I also show how to sample textures outside of the fragment shader stage.

👋 Subscribe for weekly game development videos!
► ✨ Watch the full tutorial on Wednesday! ✨

👑 Join my Patreon to watch videos early, download all project files, vote on future topics, and more! Thank you so much!

🔗 Check out my website for a searchable list of tutorials!

🎬 Previous videos

💬 Video transcript

⏲️ Timestamps:
0:00 Intro
0:55 Using GetTextureLOD
3:06 Reimplementing the mipmap choice algorithm
5:04 Mipmap bias
6:11 Sampling textures in the vertex stage
7:03 Wrap up and credits

🎖️ Credits, references and further reading:

Music:
Perspectives by Kevin MacLeod

#GameDev #IndieDev #Unity
Рекомендации по теме
Комментарии
Автор

Hi, thanks for watching! This wraps up my mipmaps series, at least for now! Are there any other mipmap uses or features you'd like me to make a video about?

NedMakesGames
Автор

"you may remember that derivatives are not available during the vertex stage" - worth it!

daslolo
Автор

I really enjoyed watching this one! ☺

stephapie
Автор

Hi Ned! First of all, thank you for all your tutorials, they are totally amazing!!
Second, I'll like to ask something about mipmaps on Unity. Currently I have an atlas texture with different textures that changes by shader (I can choose where UV points so, pointing different place of atlas = shows different texture). My question comes: at long distances I see mipmaping reducing the quality of my atlas, making blurry the edges between textures and making one undesired texture appearing from the sides of the desired texture. Maybe I'm setting it wrongly, but I have no honest idea on how to force mipmaps not blurr the tiles of my image atlas. At first I thought on making custom mipmaps, but I'll like to know if there is a roundabout to it from unity (maybe setting image 2D as other type? And if so, how can I make it work with shadergraph?) In some moments on the video I've seen some similar to my case, an atlas with different textures, and on your case they were correctly cutting the edges on them before blurring the mipmap (not sure if made by video editing or in Unity heh). Thank you so much in advance :)

MarcosPS
Автор

is this even possible for the standard/legacy/built in pipeline? Also is it possible to have at 5:30 work for materials to set shader mipmap bias?

Smash_ter
Автор

Hi Ned. Amazing tutorial. I need mipmaps for a research project and it seems that if I try to use texture.requestedMipMapLevel the same way as you did when writing the scrip for mipmapbias, the mip level does not update. Have you encountered this before? any idea what could be wrong?

dptrsq
Автор

How to do this with built-in rendering pipeline?

andhikadimas