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.
@@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.
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.
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.
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.
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.
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.
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 ¯\_(ツ)_/¯
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.
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.
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?
@@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.
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?
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.
@@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
@@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.
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
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/
@@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.
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!
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!
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.
@@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.
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.
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.
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.
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.
@@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 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.)
@@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.
(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)
@@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 .
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.
maybe the real gpu optimization was the friends we made along the way
or frustrum culling .
As an og gamer, I remember flat trees suddenly becoming 3d when i approach them
I seem to recall that technique being called "billboarding" and the individual flat objects being called "impostors".
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.
@@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.
i love the editing and your way of talking in these vids, it's super comfy
Vampires can't see themselves in a mirror because they're frustum culled
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.
Wait wut
really like your page, you answer a lot of questions I have in great but understandable detail
I never thought I'd be learning something with the Huniepop BGM going on. My eyes widened at the realization.
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.
I have learned a ton about game development from your channel. You've somehow nailed both informative and easy to understand and entertaining
Nicely explained. Thanks a lot.
really love the way you explain stuff :)
Acerola knew I would be watching this in the future and prepared for that contingency. 10/10...programming at its best.
bro these videos are so good to watch while high fucking thank you
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.
I am watching this in the future and I appreciate you acknowledging me
Nice video, to refresh what I learnt back in the OpenGL days.
Seeing slime’s blender bit got me dying
This is a good video, I feel better after watching it!!
I have praised your videos several times & i have nothing new to say, just commenting to boost interaction.
Acerola I love you! 😩👌
would love a rundown on mesh shaders, they seem promising but Im not aware of any games that use them.
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
@@Acerola_t unfortunate but understandable, thank you.
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.
i'm so glad youtube is pushing small channels into the almighty algorithm, i've found so many good channels lmao
1:41 Aw, I expected The Devil is in the Details by Boards of Canada.
For me, it's The Devil Is in the Details by The Chemical Brothers
Looks good!
Here from the future to say nice TVOTR reference
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.
Anyone who has played a Bethesda game should be distinctly aware of LOD
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 ¯\_(ツ)_/¯
yeah that is called occlusion culling, it is a different topic.
@@Acerola_t can we "disable" those vertices with the occlusion culling collidee system ?
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.
7:27 are we gonna talk about backface culling?
Out of pure curiosity- think you'd be able to do non Euclidean spacial rendering?
Yeah but I think CodeParade has done a great job covering that niche on his own lol
Learning about LOD when I started modding ruined my eyes.
I'm watching this in the future
Great vid
"Performance police" 🤣 i cant stop rolling on the floor lmao
I WILL NOT look at videogames the same way EVER again
he really never looked at video games the same way ever again
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.
Hey i'm watching this in the future :)
insane
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?
Yeah, usually games will use dithering to fade between LODs or fade objects in/out of view.
@@Acerola_t Thanks! Will try to search.
@@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.
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?
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.
@@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
@@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.
The fps was almost 3000 after the level of detail addition, but after applying frustum culling it's only ~150?
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
@@Acerola_t ah, I see, thanks. Yeah, I think you mentioned it in the video, I just misunderstood it somehow.
Noice
NANIIIIIIITE
How is there no dynamic LOD feature yet?
How can I actually go about these with a simple shader or whatever in Unity?
And with the Built in Render Pipeline? Thanks
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/
@@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.
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!
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!
Weird to have found a computer graphics information channel directed by Akiyuki Shinbo...
Hello from the future
my poor, poor brain.
So, how does this work for minecraft, which doesn't use levels of detail?
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.
@@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.
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.
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.
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.
came here from the grass rendering vid
Is your intro a reference to something like your new intro and the Monogatari Series or is it something original?
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.
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)
yeah cause lod is a more intentional thing where as this is about programmatic lodding with tessellation shaders
@@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
@@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.
1:28 Well, now I know that acerola is actually pronounced "asserola" instead of "ackerola," like I had thought.
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
UE5 and Nanite would like to contend with your addendum (;
UE5 is the antichrist please do not fall for it
@@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.)
@@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.
(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)
@@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 .
why did I think the forza horizon 5 image was a goat simulator screenshot
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.
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
Is Nanite a one size fits all?
technically yeah, but nanite doesnt work on transparent materials.
...I was about to correct you, only to realize that "frustum" is correct and I've incorrectly been calling it "frustrum" for years.
lol i was calling it frustrum before i double checked for this vid
Bro made nanite terrain befor it existed. UE5 should set up there game💀💀
Hello from the future