Dynamic Detail In Games

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 พ.ค. 2024
  • 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 ปีที่แล้ว +403

    maybe the real gpu optimization was the friends we made along the way

    • @saul8510
      @saul8510 ปีที่แล้ว +6

      or frustrum culling .

  • @NikolaZagorac
    @NikolaZagorac ปีที่แล้ว +82

    As an og gamer, I remember flat trees suddenly becoming 3d when i approach them

    • @Roxor128
      @Roxor128 8 หลายเดือนก่อน +8

      I seem to recall that technique being called "billboarding" and the individual flat objects being called "impostors".

    • @FurryWrecker911
      @FurryWrecker911 8 หลายเดือนก่อน +7

      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 3 หลายเดือนก่อน

      @@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.

  • @perplexedsnowmobile
    @perplexedsnowmobile ปีที่แล้ว +22

    Vampires can't see themselves in a mirror because they're frustum culled

  • @monkeysfromvenus
    @monkeysfromvenus ปีที่แล้ว +115

    i love the editing and your way of talking in these vids, it's super comfy

  • @cloudgaming927
    @cloudgaming927 ปีที่แล้ว +61

    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.

  • @samuelkurz5814
    @samuelkurz5814 ปีที่แล้ว +8

    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 ปีที่แล้ว +7

    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 หลายเดือนก่อน +3

    really like your page, you answer a lot of questions I have in great but understandable detail

  • @gameguy301
    @gameguy301 7 หลายเดือนก่อน +5

    would love a rundown on mesh shaders, they seem promising but Im not aware of any games that use them.

    • @Acerola_t
      @Acerola_t  7 หลายเดือนก่อน +3

      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 7 หลายเดือนก่อน +1

      @@Acerola_t unfortunate but understandable, thank you.

    • @gtsteel
      @gtsteel 2 หลายเดือนก่อน

      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.

  • @samuelgrahame3617
    @samuelgrahame3617 ปีที่แล้ว +5

    really love the way you explain stuff :)

  • @dziarskilisek
    @dziarskilisek ปีที่แล้ว +8

    Nicely explained. Thanks a lot.

  • @clearskyy
    @clearskyy ปีที่แล้ว +4

    I never thought I'd be learning something with the Huniepop BGM going on. My eyes widened at the realization.

  • @sedativeman
    @sedativeman ปีที่แล้ว +7

    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.

  • @yummystuff238
    @yummystuff238 2 ปีที่แล้ว +6

    Seeing slime’s blender bit got me dying

  • @nguyenhoangminhtrung2779
    @nguyenhoangminhtrung2779 ปีที่แล้ว +2

    Nice video, to refresh what I learnt back in the OpenGL days.

  • @thebumblecrag61
    @thebumblecrag61 ปีที่แล้ว +1

    This is a good video, I feel better after watching it!!

  • @Cloud-Yo
    @Cloud-Yo 9 หลายเดือนก่อน +1

    Acerola knew I would be watching this in the future and prepared for that contingency. 10/10...programming at its best.

  • @slimeinc.3822
    @slimeinc.3822 ปีที่แล้ว +1

    bro these videos are so good to watch while high fucking thank you

  • @Browsinghard
    @Browsinghard 6 หลายเดือนก่อน +1

    I am watching this in the future and I appreciate you acknowledging me

  • @bartholemumk1437
    @bartholemumk1437 2 ปีที่แล้ว +2

    Looks good!

  • @radicant7283
    @radicant7283 8 หลายเดือนก่อน +1

    Acerola I love you! 😩👌

  • @Nayckron
    @Nayckron ปีที่แล้ว +1

    I have praised your videos several times & i have nothing new to say, just commenting to boost interaction.

  • @UnholySycamore
    @UnholySycamore 8 หลายเดือนก่อน

    I'm watching this in the future

  • @SomeRandomPiggo
    @SomeRandomPiggo ปีที่แล้ว +2

    i'm so glad youtube is pushing small channels into the almighty algorithm, i've found so many good channels lmao

  • @cpab27
    @cpab27 8 หลายเดือนก่อน +1

    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.

  • @AltamishM
    @AltamishM 8 หลายเดือนก่อน

    Here from the future to say nice TVOTR reference

  • @funkyjug2107
    @funkyjug2107 ปีที่แล้ว

    insane

  • @oby1
    @oby1 ปีที่แล้ว +4

    Out of pure curiosity- think you'd be able to do non Euclidean spacial rendering?

    • @Acerola_t
      @Acerola_t  ปีที่แล้ว +3

      Yeah but I think CodeParade has done a great job covering that niche on his own lol

  • @johnlock807
    @johnlock807 ปีที่แล้ว

    "Performance police" 🤣 i cant stop rolling on the floor lmao

  • @TinchoX
    @TinchoX ปีที่แล้ว

    Noice

  • @Suzuki_Hiakura
    @Suzuki_Hiakura 3 หลายเดือนก่อน

    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.

  • @danielfinley509
    @danielfinley509 9 หลายเดือนก่อน +1

    Learning about LOD when I started modding ruined my eyes.

  • @CaveyMoth
    @CaveyMoth ปีที่แล้ว +2

    1:41 Aw, I expected The Devil is in the Details by Boards of Canada.

    • @Acerola_t
      @Acerola_t  ปีที่แล้ว +1

      For me, it's The Devil Is in the Details by The Chemical Brothers

  • @ivanpirogov9373
    @ivanpirogov9373 ปีที่แล้ว +6

    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  ปีที่แล้ว +3

      Yeah, usually games will use dithering to fade between LODs or fade objects in/out of view.

    • @ivanpirogov9373
      @ivanpirogov9373 ปีที่แล้ว +1

      @@Acerola_t Thanks! Will try to search.

    • @Acerola_t
      @Acerola_t  ปีที่แล้ว +2

      @@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 ปีที่แล้ว +2

    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.

  • @JinKee
    @JinKee ปีที่แล้ว +1

    7:27 are we gonna talk about backface culling?

  • @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  ปีที่แล้ว +1

      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.

  • @Dexef_
    @Dexef_ ปีที่แล้ว

    Hey i'm watching this in the future :)

  • @starplatinum3305
    @starplatinum3305 8 หลายเดือนก่อน +1

    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 หลายเดือนก่อน +1

      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 ?

  • @jacklaplante3184
    @jacklaplante3184 ปีที่แล้ว +1

    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  ปีที่แล้ว +2

      @@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.

  • @Pockeywn
    @Pockeywn 7 หลายเดือนก่อน

    why did I think the forza horizon 5 image was a goat simulator screenshot

  • @hoodio
    @hoodio ปีที่แล้ว

    NANIIIIIIITE

  • @ADRENELINEDUDE
    @ADRENELINEDUDE 8 หลายเดือนก่อน

    Is Nanite a one size fits all?

    • @Acerola_t
      @Acerola_t  8 หลายเดือนก่อน

      technically yeah, but nanite doesnt work on transparent materials.

  • @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.

  • @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 8 หลายเดือนก่อน

    Bro made nanite terrain befor it existed. UE5 should set up there game💀💀

  • @lclMetal
    @lclMetal ปีที่แล้ว +1

    The fps was almost 3000 after the level of detail addition, but after applying frustum culling it's only ~150?

    • @Acerola_t
      @Acerola_t  ปีที่แล้ว +3

      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.

  • @jansidlo
    @jansidlo ปีที่แล้ว +1

    Hello from the future

  • @popogeejo
    @popogeejo ปีที่แล้ว

    Weird to have found a computer graphics information channel directed by Akiyuki Shinbo...

  • @Ragchomp
    @Ragchomp ปีที่แล้ว +2

    I WILL NOT look at videogames the same way EVER again

    • @Acerola_t
      @Acerola_t  ปีที่แล้ว +5

      he really never looked at video games the same way ever again

  • @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 หลายเดือนก่อน +1

      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.

  • @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  ปีที่แล้ว +3

      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

  • @gleetR
    @gleetR ปีที่แล้ว

    came here from the grass rendering vid

  • @cinderheart2720
    @cinderheart2720 ปีที่แล้ว +1

    So, how does this work for minecraft, which doesn't use levels of detail?

    • @Acerola_t
      @Acerola_t  ปีที่แล้ว +2

      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 ปีที่แล้ว +2

      @@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 ปีที่แล้ว +4

      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 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      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.

  • @Smoah
    @Smoah ปีที่แล้ว +3

    my poor, poor brain.

  • @hyeve5319
    @hyeve5319 ปีที่แล้ว +1

    UE5 and Nanite would like to contend with your addendum (;

    • @Acerola_t
      @Acerola_t  ปีที่แล้ว +1

      UE5 is the antichrist please do not fall for it

    • @hyeve5319
      @hyeve5319 ปีที่แล้ว +1

      @@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  ปีที่แล้ว +1

      @@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 ปีที่แล้ว +2

      (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 .

  • @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 หลายเดือนก่อน +1

      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

  • @beplh5242
    @beplh5242 9 หลายเดือนก่อน

    Hello from the future