Dynamic Detail In Games

  Рет қаралды 55,360

Acerola

Acerola

Күн бұрын

An overview of dynamic model detail (level of detail) in video games and how it improves performance.
Twitter: / acerola_t
Twitch: / acerola_t
Discord: / discord
References:
catlikecoding.com/unity/tutor...
The opening line is from Staring At The Sun by TV On The Radio
Music:
Gold Falls Casino - HuniePop OST
Chapters:
00:00 Intro
01:39 Preliminary Knowledge
04:00 Level Of Detail
05:35 Frustum Culling
07:45 Addendums
08:48 Conclusion
Thanks for watching!
This video is dedicated to my friend, Alotryx.
also please subscribe haha please man please just subscribe dude please just like one sub I swear I'm not addicted please man please just one sub please
#acerola #gamedev #graphics #unity #unity3d #unity2d #madewithunity #indiedev

Пікірлер: 104
@csxcatgirl9896
@csxcatgirl9896 Жыл бұрын
maybe the real gpu optimization was the friends we made along the way
@saul8510
@saul8510 Жыл бұрын
or frustrum culling .
@NikolaZagorac
@NikolaZagorac Жыл бұрын
As an og gamer, I remember flat trees suddenly becoming 3d when i approach them
@Roxor128
@Roxor128 8 ай бұрын
I seem to recall that technique being called "billboarding" and the individual flat objects being called "impostors".
@FurryWrecker911
@FurryWrecker911 8 ай бұрын
Just Cause 2 is probably the most memorable example I have seen. If you were up high enough in a plane, the tree cards would flip around to face you if you looked down as you flew overhead. If you were low enough, they shifted into 3d shapes.
@Suzuki_Hiakura
@Suzuki_Hiakura 4 ай бұрын
@@FurryWrecker911 My only grip with Just Cause 2 is rather unrelated, about how it never saves my settings after closing and relaunching the game. It would always be blaring music with the resolution set to about half my screens base resolution. I never noticed the tree cards, which seems impressive as I figure I will have to look to see it, only knowing now what I am looking for lol. Plus, as I am mostly traveling on the water or road, I figure I wont really see it anyways.
@monkeysfromvenus
@monkeysfromvenus Жыл бұрын
i love the editing and your way of talking in these vids, it's super comfy
@perplexedsnowmobile
@perplexedsnowmobile Жыл бұрын
Vampires can't see themselves in a mirror because they're frustum culled
@cloudgaming927
@cloudgaming927 Жыл бұрын
I was so focused on the content of the video that it took me 8 minutes to realize you were using Huniepop music. Niche game dev topics are my new favorite side of this website, your channel is awesome.
@crimsondragon2677
@crimsondragon2677 9 ай бұрын
Wait wut
@clearskyy
@clearskyy Жыл бұрын
I never thought I'd be learning something with the Huniepop BGM going on. My eyes widened at the realization.
@samuelkurz5814
@samuelkurz5814 Жыл бұрын
Love your videos. Stumbled across your channel yesterday and even tough I’m not a game dev myself I find your videos very interesting and entertaining.
@ashisharky
@ashisharky Жыл бұрын
I have learned a ton about game development from your channel. You've somehow nailed both informative and easy to understand and entertaining
@jameswaters95
@jameswaters95 7 ай бұрын
really like your page, you answer a lot of questions I have in great but understandable detail
@samuelgrahame3617
@samuelgrahame3617 Жыл бұрын
really love the way you explain stuff :)
@dziarskilisek
@dziarskilisek Жыл бұрын
Nicely explained. Thanks a lot.
@sedativeman
@sedativeman Жыл бұрын
You make fantastic videos bro. I'm just starting to learn UE5 and Blender, I can't wait to figure out how to actually put some of this information in use lol.
@Browsinghard
@Browsinghard 7 ай бұрын
I am watching this in the future and I appreciate you acknowledging me
@gameguy301
@gameguy301 8 ай бұрын
would love a rundown on mesh shaders, they seem promising but Im not aware of any games that use them.
@Acerola_t
@Acerola_t 8 ай бұрын
probably wont happen for a long time, I'd have to write my own engine to do it rn and I doubt unity will be adding mesh shader support anytime soon
@gameguy301
@gameguy301 8 ай бұрын
@@Acerola_t unfortunate but understandable, thank you.
@gtsteel
@gtsteel 3 ай бұрын
True mesh shaders (that can use barriers and control workgroup layout) don't have very good hardware support yet so they don't get a lot of use, as devs would have to include a fallback option. We can already get a lot of the benefits of mesh shaders by using a (near-universally-supported) pull-based pipeline layout, which disables the traditional vertex fetch and indexing stages and instead gives the vertex shaders full random access to the vertex data in storage buffers. This allows the vertex shader to use any data layout it wants interpreted however it wants to, which includes the ability to do custom tessellation without needing the (often inefficient) fixed-function tessellation and geometry shaders. There is a little bit of duplicated effort due to the lack of coordination between invocations (which can be minimized by the use of a compute shader prepass) but it is a very flexible way to render all sorts of geometry other than pre-baked meshes.
@Cloud-Yo
@Cloud-Yo 10 ай бұрын
Acerola knew I would be watching this in the future and prepared for that contingency. 10/10...programming at its best.
@nguyenhoangminhtrung2779
@nguyenhoangminhtrung2779 Жыл бұрын
Nice video, to refresh what I learnt back in the OpenGL days.
@yummystuff238
@yummystuff238 2 жыл бұрын
Seeing slime’s blender bit got me dying
@slimeinc.3822
@slimeinc.3822 Жыл бұрын
bro these videos are so good to watch while high fucking thank you
@thebumblecrag61
@thebumblecrag61 Жыл бұрын
This is a good video, I feel better after watching it!!
@bartholemumk1437
@bartholemumk1437 2 жыл бұрын
Looks good!
@Nayckron
@Nayckron Жыл бұрын
I have praised your videos several times & i have nothing new to say, just commenting to boost interaction.
@SomeRandomPiggo
@SomeRandomPiggo Жыл бұрын
i'm so glad youtube is pushing small channels into the almighty algorithm, i've found so many good channels lmao
@oby1
@oby1 Жыл бұрын
Out of pure curiosity- think you'd be able to do non Euclidean spacial rendering?
@Acerola_t
@Acerola_t Жыл бұрын
Yeah but I think CodeParade has done a great job covering that niche on his own lol
@CaveyMoth
@CaveyMoth Жыл бұрын
1:41 Aw, I expected The Devil is in the Details by Boards of Canada.
@Acerola_t
@Acerola_t Жыл бұрын
For me, it's The Devil Is in the Details by The Chemical Brothers
@cpab27
@cpab27 9 ай бұрын
i think the example with the mountains is actually very easy to fix,what you have to do is bake a normal map of the high poly one,and make a very low poly one that capturas just the big and important stuff,than you put the baked normal map into the low poly mountains,and now it will look like the high poly one when is low poly.
@radicant7283
@radicant7283 8 ай бұрын
Acerola I love you! 😩👌
@Suzuki_Hiakura
@Suzuki_Hiakura 4 ай бұрын
I created an amazing world map with the help of Blenders mesh Terrain addon... was upset I had to remove all the detail since I couldn't figure out LOD lmao. Also messed up setting up culling on a scene with a 3d printable Warhammer 40k Hive city... basically about 3k towers, each with about 50-100 vertices and a random number of bridges between them; I merged towers surrounding the center, which meant that the culling I was using in Unity would only cull the "groups" of towers that the camera didn't happen to look at. Its nice thinking back on how bad I was at world building. Even made a small room scene that put my 1070ti usage at a hard 70%, with a spike to 81% every time I moved the camera.
@ivanpirogov9373
@ivanpirogov9373 Жыл бұрын
Great videos! You explain everything in a simple and clear way. I have some old questions about lods. Is it possible to get rid of models jittering in the moment of the transition between different lods? Also in some games it is noticeable how abruptly the grass is loaded. Are there known solutions to these problems?
@Acerola_t
@Acerola_t Жыл бұрын
Yeah, usually games will use dithering to fade between LODs or fade objects in/out of view.
@ivanpirogov9373
@ivanpirogov9373 Жыл бұрын
@@Acerola_t Thanks! Will try to search.
@Acerola_t
@Acerola_t Жыл бұрын
@@ivanpirogov9373 Genshin impact is an example that comes to mind, if the camera is too close to the character then they dither the player model. It's the same technique.
@4.0.4
@4.0.4 Жыл бұрын
I don't get it. If the geometry shader runs after vertex shader / CPU bottleneck, how can it boost performance? It's not like the fragment shader has pixels to render outside the frustum.
@funkyjug2107
@funkyjug2107 Жыл бұрын
insane
@jacklaplante3184
@jacklaplante3184 Жыл бұрын
I'm confused about what you mentioned about passing huge meshes into the gpu being expensive. without passing in a huge mesh, how will the terrain still have high LOD? i get that you are adding more verts but if you don't have the high LOD verts to begin with then wouldn't you just be dividing the polys from the low LOD mesh into flat planes that have more verts?
@Acerola_t
@Acerola_t Жыл бұрын
the tessellated triangles are created on the gpu, rather than being passed in. So you pass in a "low LOD" plane and then the gpu tessellates the triangles and then the terrain shader samples the terrain height map to displace the vertices, resulting in higher detail terrain.
@jacklaplante3184
@jacklaplante3184 Жыл бұрын
@@Acerola_t ok but at the end of the day the GPU still needs the terrain heightmap data. so hopefully that data is smaller than the mesh would be. but probably wont be much less if it has the same resolution of detail as the high LOD mesh. btw I love your videos! not tryna argue just want to make sure i understand
@Acerola_t
@Acerola_t Жыл бұрын
@@jacklaplante3184 Yeah a height map texture is considerably less expensive than a really high resolution plane especially since this also allows you to control how detailed the plane is at runtime rather than always drawing the same amount of vertices.
@danielfinley509
@danielfinley509 10 ай бұрын
Learning about LOD when I started modding ruined my eyes.
@CranJ1213
@CranJ1213 9 ай бұрын
I'm watching this in the future
@JinKee
@JinKee Жыл бұрын
7:27 are we gonna talk about backface culling?
@Ragchomp
@Ragchomp Жыл бұрын
I WILL NOT look at videogames the same way EVER again
@Acerola_t
@Acerola_t Жыл бұрын
he really never looked at video games the same way ever again
@Dexef_
@Dexef_ Жыл бұрын
Hey i'm watching this in the future :)
@panickal
@panickal Жыл бұрын
How can I actually go about these with a simple shader or whatever in Unity? And with the Built in Render Pipeline? Thanks
@Acerola_t
@Acerola_t Жыл бұрын
This vid is an adaptation of Jasper Flick's tutorial on the same subject, he goes over how to actually write the shader. catlikecoding.com/unity/tutorials/advanced-rendering/tessellation/
@panickal
@panickal Жыл бұрын
@@Acerola_t Oh. This seems a little more complicated than I expected.. I haven't had experience with writing shaders in the past. I was hoping there'd be a quick way to do frustum culling on meshes at least. I may need to get into this sometime.
@VladimirDev
@VladimirDev Жыл бұрын
Hey acerola! You got a patreon or something? I'm a render programmer/tech artist myself and I enjoy brushing up my rendering knowledge looking at your stuff and I'd like to support your endeavor in the future!
@Acerola_t
@Acerola_t Жыл бұрын
I do! www.patreon.com/acerola_t Everything I make will always be freely available and open source so no need to worry about that, but I would appreciate any support!
@LonewolfeSlayer
@LonewolfeSlayer Жыл бұрын
Is your intro a reference to something like your new intro and the Monogatari Series or is it something original?
@Acerola_t
@Acerola_t Жыл бұрын
This intro was original, I swapped over to the monogatari title card intro in the newer vids cause it's better for watch retention and more fun to edit.
@starplatinum3305
@starplatinum3305 8 ай бұрын
Idk but, for example, theres the mountain right ?, and theres a lot of trees gameObj behind the moutain mesh, how can we frustum those ? Or frustum those vertices that we cant see but still inside our cams ? Like uhh, checking the depth texture, then render only the vertices that r visible in the depth texture 😔🤨🤔 sorry man im dumb ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯
@Acerola_t
@Acerola_t 8 ай бұрын
yeah that is called occlusion culling, it is a different topic.
@starplatinum3305
@starplatinum3305 8 ай бұрын
@@Acerola_t can we "disable" those vertices with the occlusion culling collidee system ?
@johnlock807
@johnlock807 Жыл бұрын
"Performance police" 🤣 i cant stop rolling on the floor lmao
@TinchoX
@TinchoX Жыл бұрын
Noice
@AltamishM
@AltamishM 8 ай бұрын
Here from the future to say nice TVOTR reference
@hoodio
@hoodio Жыл бұрын
NANIIIIIIITE
@jansidlo
@jansidlo Жыл бұрын
Hello from the future
@lclMetal
@lclMetal Жыл бұрын
The fps was almost 3000 after the level of detail addition, but after applying frustum culling it's only ~150?
@Acerola_t
@Acerola_t Жыл бұрын
I turned the tessellation to max so that you could actually see the fps increase when moving the camera away from the terrain hence the overall fps decrease, pretty sure I said this in the video on screen
@lclMetal
@lclMetal Жыл бұрын
@@Acerola_t ah, I see, thanks. Yeah, I think you mentioned it in the video, I just misunderstood it somehow.
@Smoah
@Smoah Жыл бұрын
my poor, poor brain.
@popogeejo
@popogeejo Жыл бұрын
Weird to have found a computer graphics information channel directed by Akiyuki Shinbo...
@MrLordFireDragon
@MrLordFireDragon Жыл бұрын
Genuine question: why do you always state things in terms of FPS? I understand that's the 'gamer metric', but given you're measuring the performance of a game, I'd have thought the time between frames (displayed to the right of the fps in unity) would be the more important, since as a developer you'll be layering effects, which will cause an additive linear effect on the time between frames (but a non-linear effect on the FPS). I mention this in particular because in one video you say that post-processing effects shouldn't take more than 3ms to execute, so sometimes you use that as a measure, but overwhelmingly you seem to use FPS. It might be just a habit or done in the name of being accessible, just interested to know what the reasoning is.
@Acerola_t
@Acerola_t Жыл бұрын
Because I'm self taught and didnt realize that fps isnt as useful as ms when i was making this video so nowadays I use ms as a performance metric
@ADRENELINEDUDE
@ADRENELINEDUDE 9 ай бұрын
Is Nanite a one size fits all?
@Acerola_t
@Acerola_t 9 ай бұрын
technically yeah, but nanite doesnt work on transparent materials.
@OtesOtesOtes
@OtesOtesOtes 8 ай бұрын
TV on the Radio (finally being a hipster has paid off) Crazy you don't even cover lod in a 9:50 video (oh lod have mercy)
@Acerola_t
@Acerola_t 8 ай бұрын
yeah cause lod is a more intentional thing where as this is about programmatic lodding with tessellation shaders
@OtesOtesOtes
@OtesOtesOtes 8 ай бұрын
@@Acerola_t I'm trolling you because u didn't use the acronym and everybody likes acronyms keep it up tho I had to keep with the theme of trolling bc tbh TV on the Radio dunno if they're a hipster band I was just being cringe to show my appreciation for content nobody else in the comments got the reference dunno if staring at the sun music video kinda has synthy equalizer pulsing vibes that looks like the geometries you're talking about or why u even made that reference pls explain
@Acerola_t
@Acerola_t 8 ай бұрын
@@OtesOtesOtes lol it's just a song i like and oh i see what you mean, yeah I try to avoid jargon when I can to keep the vocab accessible.
@cinderheart2720
@cinderheart2720 Жыл бұрын
So, how does this work for minecraft, which doesn't use levels of detail?
@Acerola_t
@Acerola_t Жыл бұрын
Minecraft is a pretty unique problem and I dont know the specifics of how they render their chunks with more than 0 fps. It doesnt need level of detail though since the meshes are so low poly already.
@cinderheart2720
@cinderheart2720 Жыл бұрын
@@Acerola_t There's a mod that adds LoD to minecraft. With the right settings, it lets you see the entire world from high up enough without significant frame drops. Clearly the vanilla system is having some effect on performance, low poly or not.
@Aura42069
@Aura42069 Жыл бұрын
If I'm right, then Minecraft uses chunking (pretty obvious), chunks are removed with Frustum Culling, and, minecraft optimizes the rendering by NOT rendering any triangle that doesn't have air nearby, so, 4 blocks inside a grass plane are just 4 quads, instead of an entire cube. In short of this strange explanation I did: Cull chunks, draw only seen faces of the cube, add faces if there is no block nearby, so player won't see out of bounds And also, minecraft packs it's textures into an atlas at runtime, so it doesn't reload every texture every draw call.
@hyeve5319
@hyeve5319 Жыл бұрын
Minecraft has.. pretty garbage optimization and performance overall anyway, (though being written in Java really doesn't help), but the main technique used by the rendering is dynamic chunk caching. Whenever the blocks in a chunk are changed, the render pipeline re-builds a cache of the chunk data, which ONLY includes the exposed surfaces of blocks. The actual mesh data is essentially re-generated each time the chunk is altered, and then that cache is used to draw it each frame. Additionally, for exposed surfaces that are not currently visible - such as the insides of caves, while standing on the surface - there is an additional culling check done when rendering the cache each frame.
@hyeve5319
@hyeve5319 Жыл бұрын
Oh, and if I remember rightly, the chunk cache builders are threaded with usually 2-4 chunk worker threads at any time, which is why some kinds of changes to chunks can have a slight visual delay - player break/place actions normally never do, because they force a same-frame chunk rebuild, but a lot of things don't.
@gleetR
@gleetR Жыл бұрын
came here from the grass rendering vid
@yrorysinger5313
@yrorysinger5313 11 ай бұрын
1:28 Well, now I know that acerola is actually pronounced "asserola" instead of "ackerola," like I had thought.
@Acerola_t
@Acerola_t 11 ай бұрын
it's technically pronounced like ah-say-ro-la but i say it like ace-rola like it's two words just cause it's my name and i can say it how i want
@hyeve5319
@hyeve5319 Жыл бұрын
UE5 and Nanite would like to contend with your addendum (;
@Acerola_t
@Acerola_t Жыл бұрын
UE5 is the antichrist please do not fall for it
@hyeve5319
@hyeve5319 Жыл бұрын
@@Acerola_t Ehhh.. If you're talking about the fact that games can usually bake everything and don't need to care about realtime lighting, then that's certainly true to some extent, but Nanite specifically is ONLY a dynamic triangle-rendering-machine that actually does have pretty massive performance benefits, especially for rendering high-quality meshes on low-end platforms. Also dynamic lighting (lumen) is cool. Useful for games? Maybe less so. But still very cool. (im definitely biased haha, i write realtime 3D rendering in fragment shaders for fun. Speaking of, I was wondering - you ever heard of Shadertoy or dipped into SDFs and raymarching? Very fun graphics stuff.)
@Acerola_t
@Acerola_t Жыл бұрын
@@hyeve5319 I'm mostly joking I just dislike Unreal's attempt to monopolize the engine market as proprietary engines are my favorite aspect of the industry Yeah I've done ray marching stuff, havent made any vids about it because everyone and their mom has made ray marching videos. Might make a vid on parallax mapping soon though which would mean I have to talk about ray marching.
@hyeve5319
@hyeve5319 Жыл бұрын
(also yes the code is golfed to hell, i do not and would never write any other kind of code anything like I do that, it's just fun to golf the essentially one-time-use shader code that never needs to be touched ever again)
@ali32bit42
@ali32bit42 Жыл бұрын
@@Acerola_t huh. same here and i thought i was alone. dont get me wrong i like their attempt of bringing good tools to masses but it also means less people will be learning the hard ways and we loose some creativity in the market . if everyone uses the exact same solution for a problem we might never find a better one. imagine if all games today were built with the quake1 engine and never improved on it by themselves and relied on id software to try and keep up . soo many amazing technologies would not have been possible if someone didnt try to find a new way to do something .
@Pockeywn
@Pockeywn 8 ай бұрын
why did I think the forza horizon 5 image was a goat simulator screenshot
@curtmack
@curtmack 9 ай бұрын
...I was about to correct you, only to realize that "frustum" is correct and I've incorrectly been calling it "frustrum" for years.
@Acerola_t
@Acerola_t 9 ай бұрын
lol i was calling it frustrum before i double checked for this vid
@spookiepoogie5139
@spookiepoogie5139 9 ай бұрын
Anyone who has played a Bethesda game should be distinctly aware of LOD
@imfine3792
@imfine3792 9 ай бұрын
Bro made nanite terrain befor it existed. UE5 should set up there game💀💀
@beplh5242
@beplh5242 10 ай бұрын
Hello from the future
What's The Deal With Depth Of Field
14:36
Acerola
Рет қаралды 111 М.
Color Quantization and Dithering
11:55
Acerola
Рет қаралды 401 М.
UFC 302 : Махачев VS Порье
02:54
Setanta Sports UFC
Рет қаралды 1,2 МЛН
CAN YOU HELP ME? (ROAD TO 100 MLN!) #shorts
00:26
PANDA BOI
Рет қаралды 36 МЛН
How I prepare to meet the brothers Mbappé.. 🙈 @KylianMbappe
00:17
Celine Dept
Рет қаралды 57 МЛН
Fixing The Graphics Of Pokemon Legends: Arceus
10:17
Acerola
Рет қаралды 215 М.
How Do Games Render So Much Grass?
15:52
Acerola
Рет қаралды 314 М.
This is the Difference of Gaussians
19:03
Acerola
Рет қаралды 236 М.
I Tried Simulating The Entire Ocean
27:19
Acerola
Рет қаралды 465 М.
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Рет қаралды 350 М.
How I (Almost) Won My First Game Jam
33:25
Acerola
Рет қаралды 42 М.
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,3 МЛН
Early CGI Was Horrifying
33:36
KnowledgeHusk
Рет қаралды 2,9 МЛН
I Tried Sorting Pixels
18:03
Acerola
Рет қаралды 874 М.
What I Did To Optimize My Game's Grass
8:13
Acerola
Рет қаралды 121 М.
Main filter..
0:15
CikoYt
Рет қаралды 331 М.
cool watercooled mobile phone radiator #tech #cooler #ytfeed
0:14
Stark Edition
Рет қаралды 7 МЛН
iphone fold ? #spongebob #spongebobsquarepants
0:15
Si pamer 😏
Рет қаралды 593 М.
как спасти усилитель?
0:35
KS Customs
Рет қаралды 524 М.
How To Unlock Your iphone With Your Voice
0:34
요루퐁 yorupong
Рет қаралды 17 МЛН