Curious you said you're making a game engine, is it Open Source? Any chance I could get my stinking paws on it? I'd like to contribute if possible. If not, curious about what type of research you did beforehand, maybe see if you had any useful references for making an engine. It's something I'd like to give a try after my first game.
What LIBs/Tools do you use in game engine development?? I'm trying to dive deep and make developing Game Engines my entire focus in life, but I'm uncertain where to start, so I just been teaching myself Higher Maths while I try to find a starting point 😥
@@monkeyhorizon hey it’s not open source currently but I have a few blog posts up and a GitHub account with accompanying code (it’s super old though) I plan to open source parts of the engine (terrain, vegetation lazy multithreading, particle engine, voxel destruction, skeletal animation, networking, importing models, UI, postprocessing, etc) and make videos + blogs about them I created this engine mostly through trial and error and a lot of time haha, unfortunately other engines are very closed-off, or only have vague talks and presentations about them. learnopengl.com taught me nearly everything I know about OpenGL, and my goal is for these videos to cover all the other aspects of creating a game engine
@@Prodby.Mvl7R all of the code is custom, but if I were to start again I would use Silk .NET as it handles all the boring stuff for you (window creation, keyboard and mouse input, OpenGL setup), so you can focus on the cool 3D rendering side of things My maths knowledge and skills is terrible, I’ve made it a surprisingly long way without fully understanding how quaternions, matrices and lines/vectors work! I recommend jumping in and starting experimenting with 3D rendering with OpenGL. learnopengl.com taught me so much and was a great starting point
…that’s pretty much the reason why I deliberately target the Raspberry Pi 3 for development. If it runs well on that, it will run very well almost anywhere.
Didn't realize how deep you can get with optimizing your environments, I've always kept a consistent LOD with my environments without realizing how much memory i was wasting. Thanks for the video it was very informative!
@@Vercidium Considering the choices the GPU vendors are making concerning the amount of memory on their cards, that's a great mission to have in life! :p Will help reduce the need for these extremely expensive cards, which I think would be a good thing. Now that I think of it, kind of a environmentally friendly thing too!
@@perhapsyes2493 yep it’s very easy to forget about all the gamers that use older hardware, not everyone has the latest tech. Lower specs means the game is more accessible too, it’s a win win
@@Vercidium That is also a deed in the mission of climate change. Unoptimised games are like gas guzzling cars. Use a lot of energy without getting anywhere.
@@Vercidium The work you did on the animations is by no means wasted. They were very aesthetically pleasing and helped the presentation of the video immensely. Amazing job on this video!
If we had to graph it out: it seems as though hardware is rising, but software is becoming a straight line (or worse, declining) in performance and efficiency. Optimization can bring a whole lot more out of modern computers, and we don't even have to do unrealistic amounts of it to get much better results.
Yeah. I think it's a good thing that with modern tech programming is very accessible, and almost anyone can easily learn to write a working program. But the problem is that this also generates a lot of laziness in programming, since you no longer need to optimize to have your program run at all (or run well), so people just don't bother. And optimization is pretty much only done by people who personally care about it. I think that this won't stop things improving for as long as technology keeps improving. But it's holding us back at least a few years in progress.
I am not a game developer, but a video game enthusiast. Never dived behind the scenes like this and it's beautiful seeing you explain everything on how to optimize and make something run quicker. That, and the presentation and music choise were top notch! Thanks for this entertaining video!
I feel like there should be a definitive list of optimizations devs should just go through whenever making games, I've seen some really bad optimized games from AAA devs and I wonder how it's so bad sometimes.
A) Dev time. You can optimize everything to a close to infinity time. More time = less achieved... because the more optimized, the less you gain. B) You have a game to release, you focus on making... well... the game.. and the QA team is not seeing any major issues, so it is fine... This one is more down to there exists infinite amount of hardware combinations... your game will hate some of those... period...
@@SioxerNikita And i'll add: An unreleased game is a money black hole. The earlier you can get it out, the better (to reduce the costs of making it). But of course, too early and it'll flop, not recovering the huge sums of money already put into it in its development time. You can never know for sure how much a game will make, so you can never know for sure for how long you can keep developing it and still be worth it.
@psst4849 There is one example of this that is real though. Crysis 2 deliberately used more polies than necessary, but that was so it ran better on nVidia cards than AMD.
As an alternative to pitch/yaw for compressing normals, you can also use GL_INT_2_10_10_10_REV which also lets you store the 3 vector components in 4 bytes at a lower precision.
@@aidanm5578 it depends if the vertex shader is the bottleneck. If it isn’t, the FPS won’t change at all, but if it is maybe 5% faster? I can’t imagine the sin and cos being that expensive
@@aidanm5578 Honestly, I think those professional AAA programmers very much prioritize this because it's so basic. Their games are just so complex (especially with graphics) that they need very large teams and still lack manpower.
Also, culling triangles and using sprites can help a lot. Shamus Young has a project where he could generate the texture for the terrain at full detail, then cull triangles, then when rendered, looks full detail but runs way faster. OLC demonstrates that relying on sprites, even transforming them all, can be blazingly fast with insane numbers of sprites.
Absolutely, I would love to experiment with that! Is that where distant terrain and trees get converted to billboards (sprites) that always face the player?
@@Vercidium Afaik, culling is usually skipping rendering of triangles, when they are outside the camera's view cone or sometimes even when they are occluded by other non-transparent triangles. I think what @SomoneElse-fr8yu is referring to is baking details from high resolution meshes into lower resolution meshes + displacement maps. This works best on details that the player can't see at sharp angles, so mostly flat floors or walls with details such as bricks and so on. Not sure what the process of converting mesh detail into displacement maps is called though.
@@Vercidium Something else interesting to mess with related to bill boarding is drawing lines using sprites. It's very interesting, you can position a sprite between two points then scale it according to the length of the line between the two points, in 2d this will look terrible, but in 3d it works surprisingly well mostly because where one sprite fails another one will kick in to take its place. It's entirely possible to make a game with nothing but bill-boarded sprites and it can look very good even though it lacks the textured triangles so often used.
I just finished my bachelors in game development this september, and I have been really losing interest in coding etc.. But watching this video reminded me of how cool i used to think it was, and I actually feel extremely motivated to get back to it, Its insane what you were able to accomplish and I cannot wait for more on this. Please keep posting blogs on this topic or anything related to it !!! I genuinely feel like I've had my eyes reopened to coding. Despite not being the best at coding nor remembering how to do things properly, I can't wait to see more and get back into the swing of things!
@@LavaCreeperPeople For game development? Unless you have spent years teaching yourself and developing games before reaching college age and wanting to get into the industry, absolutely. Otherwise, you are starting from scratch and you will not get a game dev job for years. Even if you teach yourself for years straight, there is a lot you will not learn without college, including how to properly work with teams and what the industry is like. I highly recommend Champlain College. They have degrees for each industry discipline and you worth together as teams of designers, programmers, artists, and producers for multiple years. It simulates an industry environment.
@@anonymousperson26223heavily depends on the country, degree, specific college and your self study skills for example in quite a few countries you can find a job with skills and or work experience even without a college degree, in others you can't do anything without a degree then there's the issue of study discipline and motivation, I've met quite a few junior devs with a college degree that are barely able to write a solution to a fizz-buzz type problem
4:45 as someone with over 15 years in customer service and retail , lemme tell you when you say you ONLY had to talk to the man once that by far is the most true statement of the video.
As an artist who doesn't know code.....I had no idea you could reduce the data on terrain like that! Always amazes me what can be done when you reeeaallly know how to manipulate the 1's and 0's
I have a little insight into how Vercidium creates these videos. The "animations" you see in his videos are not animated in any traditional sense. They're animated using code, which I think is so cool. Vercidium isn't animating anything (in the traditional sense), it's all just code!
I was astonished by the performance of Sector's edge on laptop integrated graphics Also, I've never seen such short loading times on an HDD, kinda reminiscent of old Source Games/Battlefield/Early Minecraft where It's basically just click and play Hope this gets the recognition it deserves some day
In a similar vein, I've been playing well optimized old games on newer hardware, and the experience is glorious. It can actually be a little annoying, because now I don't get to read the cool load screens anymore.
When I first learned graphics programming, I was tricked into thinking instancing was the same as batching hah, so I'm glad you went over that. I had to rewrite all my rendering at the time 😥 Nice going over modern GL too, like multiDraw and SSBOs
@@Finding_Fortune I avoided modern OpenGL for so long because I thought it would increase the specs for the game. But I realised I can check the OpenGL version, and only use newer functions if they’re supported
I use batching in real life at my job. I put stickers onto boxes. How it works is as follows: A pallet of boxes arrives. Someone puts those boxes onto the table and opens them up so we can get at the smaller boxes inside, then they push it toward me (and several other people also applying stickers) Sometimes each box (opened by the previous person) contains six smaller boxes which need stickers on them. Strategy 1 (slow): - apply stickers to all boxes within a container box - close that box - push that box forward to the tape machine to be closed Batching (faster): - apply stickers to all boxes within several container boxes (let's say 3) - close all 3 boxes - push all 3 boxes forward Batching has the potential to make me a bottleneck depending on circumstances and isn't always the best, but if I'm working alone it's much faster (especially if the stickers are weird and need an extra step to apply them, like folding them over the side of a box because they're too big, one can apply many then fold them all in a batch)
The first optimization technique has one drawback: GPUs calculate texture mip mapping levels by screen space partial derivatives. That means: There will be visible seams for fragments where the UVs wrap (i.e. where a u or v component suddenly changes from 1 to 0 or from 0 to 1). Ben Golus has a very good article about that issue titled "Distinctive Derivative Differences".
@Vercidium You're welcome. I'm not sure what you mean by "same values". Let's assume a uv coordinate where one fragment has uv.x == 1 and its neighboring fragment has uv.x == 0. In this case the GPU basically "thinks" that the whole texture is used between these two fragments and uses the smallest mip mapping level. That's what causes the seams as the color of the lowest mip mapping level will probably be different from the "correct" one. With "real" uvs that only happens if the texture actually is between those two fragments, e.g. a textured model only occupying one pixel on a screen. But since you are calculating the UVs based on the position, it will always happen where the UVs wrap as mentioned above. Ben Golus has some solutions in his article as well. Hope that helps. :)
@@BrightBitGAMES As far as I can tell, the Ben Golus article and associated woes only apply to equirectangular projection textures onto a sphere. The reason the GPU assumes the whole texture must be present within the discontinuity is because the texture is being projected onto a single contiguous sphere mesh; the fragment shader sees a discontinuity within the same mesh and freaks out. This terrain generation code is not doing that: it is chunking the terrain into separate square meshes and composing them together into one scene, so there shouldn't be any visible seam. Caveat emptor: I'm a CUDA compute shader guy, not an OpenGL graphics shader guy, so I may be wrong.
I recognise that trick at 6:49. I was logging a load of data and needed to store and graph it. When i wanted to draw the graph the data resolution was one second, but if drawing a 1 year graph it was painfully slow, until said trick was employed.
I got into blender not too long ago and it´s amazing how I can actually understand stuff like that now (to a certain degree) when it would have made absolute no sense like half a year ago. That really shows what climbing the learning curve does for you, even when you might don´t see it when getting stuck at a new concept again.
my god. im a gamer of 30 years watching this and i KNOW, because i remember seeing this from inside games, how poeple were making the same mistakes over and over again. THANKYOU for sharing this, all the indy guys and the AAA studios too should see this, imagine if you could 4x or even just double the fps in any AAA title today?? you could double the sales
I know nothing about game developing nor do I have any plans to do game developing but this was still very entertaining and educational to watch because optimization just feels good :D It's sad to see that computing power has grown so much but we're not taking full advantage of it in games because so much is spent on skipping the optimization that was previously obligatory to make any game run well.
If people optimized code the same amount as they used to, then games would take so long to develop that they would already be outdated by the time they were released. Modern games are much, much bigger than old games were, and it's simply unfeasible to spend the same amount of effort optimizing each individual feature when there are 1000x more features than there used to be.
Didn't know about the sinking terrain trick! Nice one. It seems much easier than having to stitch vertices together where the LOD changes (as in only render LOD 1 outside of LOD 0's area).
I don't do any development but your graphics are super clean and intuitive and get your point across perfectly. Your production value is genuinely good enough for a channel a thousand times the size.
Great video! Definitely gonna start writing my 12 friends' ice cream orders on a piece of paper and passing it to the ice cream guy now 😂 My only comment would be it was harder to see the difference between the levels of detail of terrain than in previous example clips you've posted for some reason.
I had 1 time where I collaborated with my friend on a game development for our college project. Bro's a genius at programming since highschool, I knew a bit of game dev and how the basic works but I mostly works as designer and making sprites, fixing animations and enhancing models he made before. He said that in game development, programming was never the hard part of it, optimization is. Apparently making games nowadays have gotten so easy with all these popular game engine like unity or UE, so game dev is 20% programming, 40% graphic design and 40% optimization. That's why you have to get everything organized properly, as efficient as possible. "If you can't optimize your game, it's already a failed project, so it's better to start a new and fix everything"
You can compress the vertex data even further by storing the height in a GL_R32F texture and rendering without any vertex data at all. Having the height in a texture means that you can access the height of neighboring vertices and therefore calculate the normal using finite differences. Another thing you can do is replace your 8x8 grid with a 1x1 grid (6 vertices) and then use the tesselation shader to tesselate it again. By calculating the tesselation factors using distance to the camera (or even the view frustrum) you get levels of detail "for free". At least in theory. In practice you'd have to benchmark this approach to see if it's actually faster.
this is obscenely fantastic. Clear explanations paired with gorgeous animations which make the explanations intuitive? On the topic of coding for games, but that in a very concrete manner? Solving tangible problems? So many different and incredible notes were hit. I just had to subscribe. I _must_ see more from you.
This comment has made all the effort I put into this video worth it. My goal is to help other devs solve problems that had me stumped for months, and I hope my future videos have the same effect!
@@Vercidium I’m so glad I could voice something that could inspire you to keep going. Seriously, I’ve been looking for someone like you a while. Understanding where to start and where to go in coding is difficult. Having these tangible points explained so well has given intuitive guidance that I haven’t seen elsewhere
Just a gamer here, thought it was a free FPS trick video😅, such a good explanation. Hope all the talented game devs in the comment section put all these optimisations techniques and much more and help us the people who still use the good old gtx 1050ti to enjoy good games without the need to make the games look almost as a distorted water painting to make it playable.
I have not the slightest understanding of programming or game (engine) development. Yet, I found myself intrigued by this video and feel like I understand the basic concepts you are explaining. That is some top shelf teaching right there!
Facinating stuff. The biggest problem I have as a self-taught hobbyist programmer is that I wouldn't even know what to research in order to find stuff like this. Thanks for sharing!
As a cheap gamer I really appreciate optimization, and I notice the most when it is not there, I swear most games never try to optimize, and if they did console games could suddenly run on mobile devices easily, it is amazing how much they miss out on
Amazing, such good visuals. Even as someone that knows nothing about programming and game dev, I could understand the concepts intuitively. Very cool, looking forward to what you put out in the future!
Great video. You ver thoroughly explained the steps required to optimize a game. I'm currently working on my own one, and this video will certainly come in handy, once I'll be optimizing it.
This can really be abstracted into an ultimate balance of RAM vs flops. As cores getting more efficient in the future, with MLSS and other techs, more and more things will be inferred from even less information. It is exciting to experience this transition in our lifetime.
Awesome video btw. I recently started my own little gamedev journey. Found this very enlightening from a programmer's stand point. Looking forward to your current and future content!
Bro wtf is this video!!?? Not only that the content is just soo expensive but also the way it's presented is so flawless. It's like seeing a perfect website project from front end to backend
Ahh, I've noticed a couple of places in Tears of the Kingdom, and a few other modern games where terrain just kind of melted away. I knew it had something to do with LOD, but I just thought low quality meshes were transforming to higher quality meshes, and vertices were repositioning accordingly. I didn't consider the much more sensible conclusion that the terrain was just sinking below the higher quality mesh to be hidden.
This is one way of doing it, there's a few different techniques. You can also use quadtrees or clip maps, which are both very optimized ways of sorting your detail.
You can just store the XY components of the normal, since the length of a normal should be 1.0 you can reconstruct the Z with z = sqrt(saturate(1.0 - (x*x + y*y))), a little bit nicer than having to use euler angles
Sorry if my question is stupid, a bit new to graphics programming but won't we lose time by computing sqrts here, which I have heard is an expensive operation?
@@Sh-hg8kf it depends on its speed vs the other alternatives: running sin and cos, or reading a vec3 normal from memory I’ll have to benchmark sqrt vs sin, but I’m certain both are faster than reading more data from RAM
Hinter all dem steckt so viel Wissen und Ingeneureskunst. Auch wenn es hier nach ganz einfache Lösungen aussieht, fließt so viel zusätzliches, tiefergreifendes Hintergrundwissen mit ein. Danke für das Video, hat mich sehr an meinen Kurs und die Inhalte zu Visualisierung im Masterstudiengang erinnert. Das Video ist top!
This is incredible- Like, borderline revolutionary techniques level addition to the scene. I can't believe this stuff is just on TH-cam to stumble across randomly.
Very nice. I thought I might have to stitch the low and high levels of detail together. I never thought about sinking. I also need to upgrade my heightmap terrain to be more robust so that I can handle tunnels, natural bridges, overhangs, and underground caverns.
Battlefield uses stitching to connect their LODs together, where they modify the edge of the higher-detailed mesh to match the lower-detailed mesh I tried this but it meant high quality terrain pops in when moving around the map, whereas with sinking it appears gradually
dude, those are basic things, mostly done by modern game engines automatically. No dev need to watch this thing. It's focused on triangles which are extremely cheap to render nowadays, this topic is obsolete already
Don't be overwhelmed by all the stuff there is to learn. Just because this type of optimization exists, doesn't mean you NEED to know it right away. I've been learning Unity all year and I barely understood a thing in the video. At the same time, I've never had to optimize anything to this level, because i'm not to the point where I'm making games complicated enough to need much optimization. If you're interested but nervous, check out the Learn Unity courses, it'll help a lot.
@@mattc9598 I've been learning game dev for a few years, encompassing a lot of different aspects, and while I understand the concepts, I wouldn't even know where to start on the implementation. My experience with writing shaders was not the best.
@@mattc9598Knowing it ahead of time and implementing it early can save you lots of time and headache. It's always a pain to get something working but runs like trash and then you find out in order to optimize it properly you practically have to re-write a large chunk of code.
You won't get bored! As soon as you get rolling, you won't be able to stop. It's insanely fun learning why; how; and what can I use it for in my everyday experience on PC or otherwise?
TH-cam suggested your video to me since I’m starting game development and have been searching for optimization tips, 10/10, the way you explain it just makes sense and I plan on utilizing your tips and watching your other videos. I want the games I make to not require a NASA super computer to run while still looking good. Thank you for this!
These are fun! Can you make a series where you explain from scratch about how to make games? It doesn't have to be deep, you can use simple examples that are more tailored to beginners who are discovering the programming world of games
yeah. something that is kind of from the start. I mean, anybody can install Unity and follow a couple tutorials. I did that, for a mechanical design course. the goal was just to get our models into a VR environment, but we did learn how to make said environment with buttons and moving stuff... what I'm saying, is that I don't know where to even begin, if I had to code from scratch
That's a different approach to how I render my terrain. I generate a heightmap + normal map texture, then draw instances of the same mesh that covers exactly one tile. Each instance uses different texture coordinates for the height map and normal map. The height map is used in the vertex shader to set the vertex height, and the normal map is used in the fragment shader for lighting. For LOD, I generated different resolutions of the per-tile mesh. I wonder how this compares to your approach? The sinking technique is interesting. I haven't seen this approach used before.
Battlefield uses the same approach, it has one mesh and samples textures in the vertex shader to get the heightmap data. As I don’t have a traditional mesh, I can store the heightmap data in the vertex buffer instead. This means it’s available to the vertex shader already, rather than having to sample a texture to get that data Also when sending new terrain data to the GPU as the player explores the world, I’m more comfortable with asynchronous buffer updates than asynchronous texture updates. But both approaches work! I’m not sure what the performance difference is
@@VercidiumAh, okay. Your system has different goals and requirements from mine. I needed the height texture for grass and water rendering, so I had it available anyway.
Hold up, my time stopped and YT lagged within the first few seconds when you were asking if we were disappointed with lags and stutters. That was perfectly timed. xD
This is truly a great video and explanation, incredibly instructive to watch. As an embedded software developer, this was counterintuitive to me - in the beginning, I was thinking "but you are adding operations, you'll have to perform an additional division, how can it be faster", then you explained how the memory was the bottleneck and all made perfect sense. Great work!
Thank you! When I first started making games I prioritised precalculating as much as I could and storing it in memory, so that the code I wrote would ‘be quicker’, but I discovered the hard way that less lines of code doesn’t always mean it will run faster. I haven’t seen these topics presented this way before, so I’m glad the visuals helped!
This isn't just valuable for aspiring developers, this is really valuable to understand for your average consumer. Understanding the kind of work that goes into these sort of things is really valuable for nurturing realistic expectations and an appreciation for the creativity behind solving these problems.
Man, i really wasn't that interested in my "Intro to Computer Graphics" course this quarter, but after watching this and understanding everything you were talking about, it really put into perspective how cool it all is.
Very incredible video, visually and content wise. I would like to know what tools you used to animate some segments of the video, I have personally been messing around with things like manim but I never found anything for code specifically. Regardless, keep up the awesome work!
Thank you! I tried motion canvas and Manim but ended up creating my own with C#, SkiaSharp and OpenGL I use RichTextKit for the syntax highlighting in the code snippets I’ll create a video that shows how I animate these devlogs (devlogception!) and upload the code to Patreon
This is absolutely fascinating stuff. I'll have to watch it a few times to grasp all of it, but brilliant work, mate. Some extremely clever solutions here.
7:35 Can we all just take a second to admire the genius of this approach? I spent like 2 years trying to create a terrain system capable of rendering full scaled planets, and the biggest problem was making all the LOD quads play nice with each other, because in just about 100% of cases you end up with "cracks" in the terrain if you don't render low LOD terrain meshes near the player, since lower LOD's and higher LOD's don't have the same vertices on each edge, and therefore don't connect correctly. There's a few approaches I've tried, like calculating where lower LOD's met higher ones and adjusting the meshes so they were seamless (which is a pain in the ass to get working on spherical worlds), and extruding triangles down from the LOD edges. There's a few more approaches which are more complicated that use tessellation on the GPU which I haven't tried, but this was a problem I just couldn't solve on spherical worlds. The approach shown here is so beautifully simple and fast and looks pretty good! I would have *never* thought to just render extra patches of lower level LOD and just have them intersect to hide the seams like you did. I am definitely going to have to steal this idea for whenever I get back to trying to create spherical worlds lmao
The terrain code + demos are available here: patreon.com/vercidium
If you have any technical / game engine questions, ask them here!
Curious you said you're making a game engine, is it Open Source? Any chance I could get my stinking paws on it? I'd like to contribute if possible. If not, curious about what type of research you did beforehand, maybe see if you had any useful references for making an engine. It's something I'd like to give a try after my first game.
What LIBs/Tools do you use in game engine development?? I'm trying to dive deep and make developing Game Engines my entire focus in life, but I'm uncertain where to start, so I just been teaching myself Higher Maths while I try to find a starting point 😥
What do you use to make your videos? Is it Manim?
@@monkeyhorizon hey it’s not open source currently but I have a few blog posts up and a GitHub account with accompanying code (it’s super old though)
I plan to open source parts of the engine (terrain, vegetation lazy multithreading, particle engine, voxel destruction, skeletal animation, networking, importing models, UI, postprocessing, etc) and make videos + blogs about them
I created this engine mostly through trial and error and a lot of time haha, unfortunately other engines are very closed-off, or only have vague talks and presentations about them.
learnopengl.com taught me nearly everything I know about OpenGL, and my goal is for these videos to cover all the other aspects of creating a game engine
@@Prodby.Mvl7R all of the code is custom, but if I were to start again I would use Silk .NET as it handles all the boring stuff for you (window creation, keyboard and mouse input, OpenGL setup), so you can focus on the cool 3D rendering side of things
My maths knowledge and skills is terrible, I’ve made it a surprisingly long way without fully understanding how quaternions, matrices and lines/vectors work!
I recommend jumping in and starting experimenting with 3D rendering with OpenGL. learnopengl.com taught me so much and was a great starting point
As someone wise said once upon a time, "The real programming starts when you run out of memory".
That is a great quote
This is actually true in my experience
So true. Sql to c++
@@Vercidiumit is ,
Imagine if JS had a hard limit of 2MB of RAM per page.
Then maybe it would be real programming and would stop being a toy.
…that’s pretty much the reason why I deliberately target the Raspberry Pi 3 for development.
If it runs well on that, it will run very well almost anywhere.
Didn't realize how deep you can get with optimizing your environments, I've always kept a consistent LOD with my environments without realizing how much memory i was wasting. Thanks for the video it was very informative!
My mission is to reduce memory usage across the globe, so I'm glad this was helpful!
@@Vercidium Considering the choices the GPU vendors are making concerning the amount of memory on their cards, that's a great mission to have in life! :p
Will help reduce the need for these extremely expensive cards, which I think would be a good thing. Now that I think of it, kind of a environmentally friendly thing too!
@@perhapsyes2493 yep it’s very easy to forget about all the gamers that use older hardware, not everyone has the latest tech. Lower specs means the game is more accessible too, it’s a win win
@@Vercidium
That is also a deed in the mission of climate change.
Unoptimised games are like gas guzzling cars.
Use a lot of energy without getting anywhere.
@@Vercidium You should tell people to stop using JS then I guess lol
This is some incredible production value. Very nice visuals to go alongside your explanations!
Thank you! I spent a bit too long on these animations so I’m glad they help
This is insane, amazing quality video, thank you
@@Vercidium I don't think you did. I feel like the engagement regarding the animations just brought the video to my recommended. Thanks!
@@Vercidium The work you did on the animations is by no means wasted. They were very aesthetically pleasing and helped the presentation of the video immensely. Amazing job on this video!
coding version of 3Blue1Brown
optimization enables the potential of modern tech, if we optimize badly it's like optimizing well on worse tech. So this is really damn important.
Exactly, leaning on raw compute power as a crutch is anti-innovative
If we had to graph it out: it seems as though hardware is rising, but software is becoming a straight line (or worse, declining) in performance and efficiency.
Optimization can bring a whole lot more out of modern computers, and we don't even have to do unrealistic amounts of it to get much better results.
@@XeZrunner software is absolutely declining.
Yeah. I think it's a good thing that with modern tech programming is very accessible, and almost anyone can easily learn to write a working program. But the problem is that this also generates a lot of laziness in programming, since you no longer need to optimize to have your program run at all (or run well), so people just don't bother. And optimization is pretty much only done by people who personally care about it. I think that this won't stop things improving for as long as technology keeps improving. But it's holding us back at least a few years in progress.
@@XeZrunner can't agree more than that
I am not a game developer, but a video game enthusiast. Never dived behind the scenes like this and it's beautiful seeing you explain everything on how to optimize and make something run quicker. That, and the presentation and music choise were top notch! Thanks for this entertaining video!
I feel like there should be a definitive list of optimizations devs should just go through whenever making games, I've seen some really bad optimized games from AAA devs and I wonder how it's so bad sometimes.
But if all games were optimized, you wouldn't buy new hardware every few months / years.
A) Dev time.
You can optimize everything to a close to infinity time. More time = less achieved... because the more optimized, the less you gain.
B) You have a game to release, you focus on making... well... the game.. and the QA team is not seeing any major issues, so it is fine...
This one is more down to there exists infinite amount of hardware combinations... your game will hate some of those... period...
@@SioxerNikita And i'll add: An unreleased game is a money black hole. The earlier you can get it out, the better (to reduce the costs of making it). But of course, too early and it'll flop, not recovering the huge sums of money already put into it in its development time. You can never know for sure how much a game will make, so you can never know for sure for how long you can keep developing it and still be worth it.
@@besknighter Yeap
@psst4849 There is one example of this that is real though.
Crysis 2 deliberately used more polies than necessary, but that was so it ran better on nVidia cards than AMD.
As an alternative to pitch/yaw for compressing normals, you can also use GL_INT_2_10_10_10_REV which also lets you store the 3 vector components in 4 bytes at a lower precision.
That's a great alternative and avoids using sin and cos in the vertex shader
@@Vercidium What sort of percentage increase in FPS would you presume to see from rewriting that portion?
@@aidanm5578 it depends if the vertex shader is the bottleneck. If it isn’t, the FPS won’t change at all, but if it is maybe 5% faster? I can’t imagine the sin and cos being that expensive
@@Vercidium Fair enough. It's good to see you doing what the gaming industry seems to prioritise least. Keep it up mate, love from Perth.
@@aidanm5578 Honestly, I think those professional AAA programmers very much prioritize this because it's so basic. Their games are just so complex (especially with graphics) that they need very large teams and still lack manpower.
Also, culling triangles and using sprites can help a lot. Shamus Young has a project where he could generate the texture for the terrain at full detail, then cull triangles, then when rendered, looks full detail but runs way faster. OLC demonstrates that relying on sprites, even transforming them all, can be blazingly fast with insane numbers of sprites.
Absolutely, I would love to experiment with that! Is that where distant terrain and trees get converted to billboards (sprites) that always face the player?
@@Vercidium Afaik, culling is usually skipping rendering of triangles, when they are outside the camera's view cone or sometimes even when they are occluded by other non-transparent triangles.
I think what @SomoneElse-fr8yu is referring to is baking details from high resolution meshes into lower resolution meshes + displacement maps. This works best on details that the player can't see at sharp angles, so mostly flat floors or walls with details such as bricks and so on. Not sure what the process of converting mesh detail into displacement maps is called though.
@@Vercidium You should look at WARNO from Eugen Systems, the Iris Zoom engine does this and more when it comes to drawing the terrain and the trees ;)
@@InDieTasten as a normal person... best guess is parallax mapping
@@Vercidium Something else interesting to mess with related to bill boarding is drawing lines using sprites. It's very interesting, you can position a sprite between two points then scale it according to the length of the line between the two points, in 2d this will look terrible, but in 3d it works surprisingly well mostly because where one sprite fails another one will kick in to take its place. It's entirely possible to make a game with nothing but bill-boarded sprites and it can look very good even though it lacks the textured triangles so often used.
I just finished my bachelors in game development this september, and I have been really losing interest in coding etc.. But watching this video reminded me of how cool i used to think it was, and I actually feel extremely motivated to get back to it, Its insane what you were able to accomplish and I cannot wait for more on this. Please keep posting blogs on this topic or anything related to it !!! I genuinely feel like I've had my eyes reopened to coding. Despite not being the best at coding nor remembering how to do things properly, I can't wait to see more and get back into the swing of things!
is college really that worth it
@@LavaCreeperPeople For game development? Unless you have spent years teaching yourself and developing games before reaching college age and wanting to get into the industry, absolutely. Otherwise, you are starting from scratch and you will not get a game dev job for years. Even if you teach yourself for years straight, there is a lot you will not learn without college, including how to properly work with teams and what the industry is like. I highly recommend Champlain College. They have degrees for each industry discipline and you worth together as teams of designers, programmers, artists, and producers for multiple years. It simulates an industry environment.
@@LavaCreeperPeople yes for anything
@@anonymousperson26223 trade school?
@@anonymousperson26223heavily depends on the country, degree, specific college and your self study skills
for example in quite a few countries you can find a job with skills and or work experience even without a college degree, in others you can't do anything without a degree
then there's the issue of study discipline and motivation, I've met quite a few junior devs with a college degree that are barely able to write a solution to a fizz-buzz type problem
4:45 as someone with over 15 years in customer service and retail , lemme tell you when you say you ONLY had to talk to the man once that by far is the most true statement of the video.
These dev videos are really high quality and interesting to watch.
yeah
As an artist who doesn't know code.....I had no idea you could reduce the data on terrain like that! Always amazes me what can be done when you reeeaallly know how to manipulate the 1's and 0's
Might I recommend kishimisu's intro to shader art. I'm a coder, one of my favorite ways to recreate.
THE NON-ANIMATED ANIMATIONS ❤
What do you mean? Can you give an example?
?
I have a little insight into how Vercidium creates these videos. The "animations" you see in his videos are not animated in any traditional sense. They're animated using code, which I think is so cool.
Vercidium isn't animating anything (in the traditional sense), it's all just code!
@@SatisfiedOnionits called procedural animation,moving bones from code
@@SatisfiedOnion Probably not everything, that intro would take 100x less time to make in something like After Effects
The visuals are INSANE! You really put a lot of effort into it! Good Job!
i don't understand shit but it looks useful
hahaha same
wait.. it's all... triangles?
I don't see them anymore, all I see is blonde, brunette... ;)
🔫 Always has been
… Always has been
42!
Yeah for At least 20 years
I was astonished by the performance of Sector's edge on laptop integrated graphics
Also, I've never seen such short loading times on an HDD, kinda reminiscent of old Source Games/Battlefield/Early Minecraft where It's basically just click and play
Hope this gets the recognition it deserves some day
In a similar vein, I've been playing well optimized old games on newer hardware, and the experience is glorious. It can actually be a little annoying, because now I don't get to read the cool load screens anymore.
Wow those animations are clean. Nice stuff, this is very high quality and interesting!
When I first learned graphics programming, I was tricked into thinking instancing was the same as batching hah, so I'm glad you went over that. I had to rewrite all my rendering at the time 😥
Nice going over modern GL too, like multiDraw and SSBOs
@@Finding_Fortune I avoided modern OpenGL for so long because I thought it would increase the specs for the game. But I realised I can check the OpenGL version, and only use newer functions if they’re supported
I use batching in real life at my job. I put stickers onto boxes.
How it works is as follows:
A pallet of boxes arrives. Someone puts those boxes onto the table and opens them up so we can get at the smaller boxes inside, then they push it toward me (and several other people also applying stickers)
Sometimes each box (opened by the previous person) contains six smaller boxes which need stickers on them.
Strategy 1 (slow):
- apply stickers to all boxes within a container box
- close that box
- push that box forward to the tape machine to be closed
Batching (faster):
- apply stickers to all boxes within several container boxes (let's say 3)
- close all 3 boxes
- push all 3 boxes forward
Batching has the potential to make me a bottleneck depending on circumstances and isn't always the best, but if I'm working alone it's much faster (especially if the stickers are weird and need an extra step to apply them, like folding them over the side of a box because they're too big, one can apply many then fold them all in a batch)
The first optimization technique has one drawback: GPUs calculate texture mip mapping levels by screen space partial derivatives. That means: There will be visible seams for fragments where the UVs wrap (i.e. where a u or v component suddenly changes from 1 to 0 or from 0 to 1). Ben Golus has a very good article about that issue titled "Distinctive Derivative Differences".
I’ll check it out thank you. If the same values are being passed to the texture sample call, what would cause the seams?
@Vercidium You're welcome. I'm not sure what you mean by "same values". Let's assume a uv coordinate where one fragment has uv.x == 1 and its neighboring fragment has uv.x == 0. In this case the GPU basically "thinks" that the whole texture is used between these two fragments and uses the smallest mip mapping level. That's what causes the seams as the color of the lowest mip mapping level will probably be different from the "correct" one. With "real" uvs that only happens if the texture actually is between those two fragments, e.g. a textured model only occupying one pixel on a screen. But since you are calculating the UVs based on the position, it will always happen where the UVs wrap as mentioned above. Ben Golus has some solutions in his article as well. Hope that helps. :)
@@BrightBitGAMES As far as I can tell, the Ben Golus article and associated woes only apply to equirectangular projection textures onto a sphere. The reason the GPU assumes the whole texture must be present within the discontinuity is because the texture is being projected onto a single contiguous sphere mesh; the fragment shader sees a discontinuity within the same mesh and freaks out. This terrain generation code is not doing that: it is chunking the terrain into separate square meshes and composing them together into one scene, so there shouldn't be any visible seam. Caveat emptor: I'm a CUDA compute shader guy, not an OpenGL graphics shader guy, so I may be wrong.
I am so happy I clicked on this video
Awesome, high quality and thoughtful content. 100% subscribing, thank you!
That means so much, thank you! I hope it’s useful for your games
I recognise that trick at 6:49. I was logging a load of data and needed to store and graph it. When i wanted to draw the graph the data resolution was one second, but if drawing a 1 year graph it was painfully slow, until said trick was employed.
I got into blender not too long ago and it´s amazing how I can actually understand stuff like that now (to a certain degree) when it would have made absolute no sense like half a year ago.
That really shows what climbing the learning curve does for you, even when you might don´t see it when getting stuck at a new concept again.
I feel like the freshman who accidentally walked into a 300 level graphics class.
my god. im a gamer of 30 years watching this and i KNOW, because i remember seeing this from inside games, how poeple were making the same mistakes over and over again. THANKYOU for sharing this, all the indy guys and the AAA studios too should see this, imagine if you could 4x or even just double the fps in any AAA title today?? you could double the sales
Damn! That was an insane amount of quality in both the visuals AND explanation!
"It's likely every game you've played is just a bunch of triangles moving around."
Minecraft: Triangle? What's that?
Half of a face
Insanely high quality and easy to digest, this video made me subscribe. I don't code to this level but love to see optimizations done. Well done!
I know nothing about game developing nor do I have any plans to do game developing but this was still very entertaining and educational to watch because optimization just feels good :D It's sad to see that computing power has grown so much but we're not taking full advantage of it in games because so much is spent on skipping the optimization that was previously obligatory to make any game run well.
If people optimized code the same amount as they used to, then games would take so long to develop that they would already be outdated by the time they were released. Modern games are much, much bigger than old games were, and it's simply unfeasible to spend the same amount of effort optimizing each individual feature when there are 1000x more features than there used to be.
they only ever optimized because of technical drawbacks, with those gone they can focus on features
Didn't know about the sinking terrain trick! Nice one. It seems much easier than having to stitch vertices together where the LOD changes (as in only render LOD 1 outside of LOD 0's area).
I don't do any development but your graphics are super clean and intuitive and get your point across perfectly. Your production value is genuinely good enough for a channel a thousand times the size.
Great video! Definitely gonna start writing my 12 friends' ice cream orders on a piece of paper and passing it to the ice cream guy now 😂
My only comment would be it was harder to see the difference between the levels of detail of terrain than in previous example clips you've posted for some reason.
Get those orders ready! Thank you for the feedback
I had 1 time where I collaborated with my friend on a game development for our college project. Bro's a genius at programming since highschool, I knew a bit of game dev and how the basic works but I mostly works as designer and making sprites, fixing animations and enhancing models he made before.
He said that in game development, programming was never the hard part of it, optimization is. Apparently making games nowadays have gotten so easy with all these popular game engine like unity or UE, so game dev is 20% programming, 40% graphic design and 40% optimization. That's why you have to get everything organized properly, as efficient as possible.
"If you can't optimize your game, it's already a failed project, so it's better to start a new and fix everything"
I dont understand shaders but Im fascinated by code optimisation & graphics. Subscribed so I can learn!
This is the first time I see you on TH-cam and it's an instant sub, my friend.
I’m glad you liked the video! I have more coming up
that was awesome, cant believe you got to render 16000 times more terrain with 5x more fps than at the start
You can compress the vertex data even further by storing the height in a GL_R32F texture and rendering without any vertex data at all. Having the height in a texture means that you can access the height of neighboring vertices and therefore calculate the normal using finite differences. Another thing you can do is replace your 8x8 grid with a 1x1 grid (6 vertices) and then use the tesselation shader to tesselate it again. By calculating the tesselation factors using distance to the camera (or even the view frustrum) you get levels of detail "for free".
At least in theory. In practice you'd have to benchmark this approach to see if it's actually faster.
this is obscenely fantastic. Clear explanations paired with gorgeous animations which make the explanations intuitive?
On the topic of coding for games, but that in a very concrete manner?
Solving tangible problems?
So many different and incredible notes were hit. I just had to subscribe. I _must_ see more from you.
This comment has made all the effort I put into this video worth it. My goal is to help other devs solve problems that had me stumped for months, and I hope my future videos have the same effect!
@@Vercidium I’m so glad I could voice something that could inspire you to keep going. Seriously, I’ve been looking for someone like you a while. Understanding where to start and where to go in coding is difficult. Having these tangible points explained so well has given intuitive guidance that I haven’t seen elsewhere
Just a gamer here, thought it was a free FPS trick video😅, such a good explanation. Hope all the talented game devs in the comment section put all these optimisations techniques and much more and help us the people who still use the good old gtx 1050ti to enjoy good games without the need to make the games look almost as a distorted water painting to make it playable.
We should all send this video to the interns at respawn trying to fix Jedi survivor!
this dude started creating such crazy genius videos, bro needs more subs
Thank you! Could say this video was 6 years in the making… and I have many more to share!
he didnt exactly invent any of these ideas...
@@masterhacker7065 i didnt say he invented, but he is making good videos about compute shaders
The video editing is so crisp and on point.
I have not the slightest understanding of programming or game (engine) development. Yet, I found myself intrigued by this video and feel like I understand the basic concepts you are explaining. That is some top shelf teaching right there!
Woah thank you! Presenting and teaching are both skills I want to improve so this comment means a lot
thank you for making this i love listening to your videos to go to sleep.
I’ll take that as a compliment!
Just found you in my recommended. You are an absolutely underrated game dev TH-cam channel, and I hope your channel will blow up one day! :)
Thank you very much!
This is really clever! Looking forward to seeing more.
I am now a proud subcriber. You crammed so much technical detail into a short and simple explianation that was easy to understgand as a noobie
Having less quality on far away objects is like cutting music into MP3's by removing what the human ears can't hear, but this time for the eyes.
Man I love exactly this type of video, nice visuals, easy to understand but still kinda deep
Facinating stuff. The biggest problem I have as a self-taught hobbyist programmer is that I wouldn't even know what to research in order to find stuff like this. Thanks for sharing!
As a cheap gamer I really appreciate optimization, and I notice the most when it is not there, I swear most games never try to optimize, and if they did console games could suddenly run on mobile devices easily, it is amazing how much they miss out on
This video is absurdly well made.
Amazing, such good visuals. Even as someone that knows nothing about programming and game dev, I could understand the concepts intuitively. Very cool, looking forward to what you put out in the future!
That is great to hear, thank you!
My heard filled with joy when you mentioned Triangle Trip, It became my main weapon for Performance when I was learning to create terrains.
Great video. You ver thoroughly explained the steps required to optimize a game. I'm currently working on my own one, and this video will certainly come in handy, once I'll be optimizing it.
I don’t do game dev (sadly), just programming. A lot of this was very interesting to see, especially how you grouped your triangles!
This can really be abstracted into an ultimate balance of RAM vs flops.
As cores getting more efficient in the future, with MLSS and other techs, more and more things will be inferred from even less information.
It is exciting to experience this transition in our lifetime.
Amazing Video! Nice Animations and super clear explanation. Keep up the good work!
Highly informative and extremely well edited video! Massive kudos.
My mind was blown at the start with the position to uv trick, great job!
Awesome video btw.
I recently started my own little gamedev journey. Found this very enlightening from a programmer's stand point.
Looking forward to your current and future content!
Welcome to the game dev life! Thank you, I hope these videos will make your journey a smooth one
7:41 instead of lowering terrain you can use pixel shader to hide close terrain
Kaze Emanuar does a lot of N64 optimizations that are also very cool to see
I’ll check them out!
Bro wtf is this video!!??
Not only that the content is just soo expensive but also the way it's presented is so flawless. It's like seeing a perfect website project from front end to backend
Ahh, I've noticed a couple of places in Tears of the Kingdom, and a few other modern games where terrain just kind of melted away. I knew it had something to do with LOD, but I just thought low quality meshes were transforming to higher quality meshes, and vertices were repositioning accordingly. I didn't consider the much more sensible conclusion that the terrain was just sinking below the higher quality mesh to be hidden.
This is one way of doing it, there's a few different techniques. You can also use quadtrees or clip maps, which are both very optimized ways of sorting your detail.
You can just store the XY components of the normal, since the length of a normal should be 1.0 you can reconstruct the Z with z = sqrt(saturate(1.0 - (x*x + y*y))), a little bit nicer than having to use euler angles
Now that is good to know, I’ll try that thank you!
Sorry if my question is stupid, a bit new to graphics programming but won't we lose time by computing sqrts here, which I have heard is an expensive operation?
@@Sh-hg8kf it depends on its speed vs the other alternatives: running sin and cos, or reading a vec3 normal from memory
I’ll have to benchmark sqrt vs sin, but I’m certain both are faster than reading more data from RAM
@@Vercidium I am confused. How would a memory read take longer than computing sins or sqrts unless we are heavily memory bottlenecked?
@@Sh-hg8kf sqrts are certainly slower than a simple polynomial but GPUs have very fast sqrt hardware, basic operations like normalize need a fast sqrt
Your videos are great.
Hoping for a shader course from you some day.
Thank you! I would love to make one, shaders are pretty fun to muck around with
Hinter all dem steckt so viel Wissen und Ingeneureskunst. Auch wenn es hier nach ganz einfache Lösungen aussieht, fließt so viel zusätzliches, tiefergreifendes Hintergrundwissen mit ein. Danke für das Video, hat mich sehr an meinen Kurs und die Inhalte zu Visualisierung im Masterstudiengang erinnert. Das Video ist top!
This is incredible- Like, borderline revolutionary techniques level addition to the scene. I can't believe this stuff is just on TH-cam to stumble across randomly.
This video is just amazing! The visuals explaining the sinking illusion are just perfect.
Sub
High quality videos! Thanks for your effort
I don’t make games, but you’re very clear and informative.
Fascinating stuff. Wish you all the luck with your engine, hopefully some big devs pick it up - even if just for a trial run.
I was glued in for the whole video. Excellently done!
I'm no expert at games, but a way to only talk to someone once instead of 12 times sounds great to an introvert like me
Activision devs need to watch this
Very nice. I thought I might have to stitch the low and high levels of detail together. I never thought about sinking.
I also need to upgrade my heightmap terrain to be more robust so that I can handle tunnels, natural bridges, overhangs, and underground caverns.
Battlefield uses stitching to connect their LODs together, where they modify the edge of the higher-detailed mesh to match the lower-detailed mesh
I tried this but it meant high quality terrain pops in when moving around the map, whereas with sinking it appears gradually
@@VercidiumSo the method that requires less coding also looks better. Double win.
i know nothing of this field, and yet even i can get a glimpse of how well made, genious and important this video is.
I recently got you recommended to me and am I happy that it happened. I love learning about optimization!!!
Keep up the great work!
if only devs could watch youtube videos...
dude, those are basic things, mostly done by modern game engines automatically. No dev need to watch this thing. It's focused on triangles which are extremely cheap to render nowadays, this topic is obsolete already
It's like telling developers to create their own game engine.
Did you come up with these ideas? Because this is impressive. I’m thinking of getting into game dev, but there’s so much to learn…
I did not come up with these by any means. These are optimisations I learned from a lot of trial and error, research and analysing other games.
Don't be overwhelmed by all the stuff there is to learn. Just because this type of optimization exists, doesn't mean you NEED to know it right away. I've been learning Unity all year and I barely understood a thing in the video. At the same time, I've never had to optimize anything to this level, because i'm not to the point where I'm making games complicated enough to need much optimization.
If you're interested but nervous, check out the Learn Unity courses, it'll help a lot.
@@mattc9598 I've been learning game dev for a few years, encompassing a lot of different aspects, and while I understand the concepts, I wouldn't even know where to start on the implementation. My experience with writing shaders was not the best.
@@mattc9598Knowing it ahead of time and implementing it early can save you lots of time and headache. It's always a pain to get something working but runs like trash and then you find out in order to optimize it properly you practically have to re-write a large chunk of code.
You won't get bored! As soon as you get rolling, you won't be able to stop. It's insanely fun learning why; how; and what can I use it for in my everyday experience on PC or otherwise?
It's amazing how much memory you can save by just reframing the problem and discarding redundant data. Modern developers can learn a lot from this.
TH-cam suggested your video to me since I’m starting game development and have been searching for optimization tips, 10/10, the way you explain it just makes sense and I plan on utilizing your tips and watching your other videos. I want the games I make to not require a NASA super computer to run while still looking good. Thank you for this!
I have no idea what I just watched but i enjoyed it
These are fun! Can you make a series where you explain from scratch about how to make games? It doesn't have to be deep, you can use simple examples that are more tailored to beginners who are discovering the programming world of games
I will add that to my list of videos to create, will do!
yeah. something that is kind of from the start. I mean, anybody can install Unity and follow a couple tutorials.
I did that, for a mechanical design course. the goal was just to get our models into a VR environment, but we did learn how to make said environment with buttons and moving stuff...
what I'm saying, is that I don't know where to even begin, if I had to code from scratch
@@Klaevinyou begin with... Google. there's a guy named TheCherno, he has a great series on opengl and c++ for beginners
That's a different approach to how I render my terrain. I generate a heightmap + normal map texture, then draw instances of the same mesh that covers exactly one tile. Each instance uses different texture coordinates for the height map and normal map. The height map is used in the vertex shader to set the vertex height, and the normal map is used in the fragment shader for lighting. For LOD, I generated different resolutions of the per-tile mesh. I wonder how this compares to your approach?
The sinking technique is interesting. I haven't seen this approach used before.
Battlefield uses the same approach, it has one mesh and samples textures in the vertex shader to get the heightmap data.
As I don’t have a traditional mesh, I can store the heightmap data in the vertex buffer instead. This means it’s available to the vertex shader already, rather than having to sample a texture to get that data
Also when sending new terrain data to the GPU as the player explores the world, I’m more comfortable with asynchronous buffer updates than asynchronous texture updates.
But both approaches work! I’m not sure what the performance difference is
@@VercidiumAh, okay. Your system has different goals and requirements from mine. I needed the height texture for grass and water rendering, so I had it available anyway.
I only wish Bethesda employees would follow the second step.....
Hold up, my time stopped and YT lagged within the first few seconds when you were asking if we were disappointed with lags and stutters. That was perfectly timed. xD
This is truly a great video and explanation, incredibly instructive to watch. As an embedded software developer, this was counterintuitive to me - in the beginning, I was thinking "but you are adding operations, you'll have to perform an additional division, how can it be faster", then you explained how the memory was the bottleneck and all made perfect sense.
Great work!
Thank you! When I first started making games I prioritised precalculating as much as I could and storing it in memory, so that the code I wrote would ‘be quicker’, but I discovered the hard way that less lines of code doesn’t always mean it will run faster. I haven’t seen these topics presented this way before, so I’m glad the visuals helped!
ark needs to take notes
This isn't just valuable for aspiring developers, this is really valuable to understand for your average consumer. Understanding the kind of work that goes into these sort of things is really valuable for nurturing realistic expectations and an appreciation for the creativity behind solving these problems.
I got pissed just watching the intro of your game freezing, gets me tilted real quick. Love the videos!
Man, i really wasn't that interested in my "Intro to Computer Graphics" course this quarter, but after watching this and understanding everything you were talking about, it really put into perspective how cool it all is.
I’m glad to hear! Programming is way more interesting when it’s visual. I hope you continue learning 3D!
Hope this reach more devs. Having an optimised terrain help massively with open world games, especially if they are procedurally generated.
Very incredible video, visually and content wise.
I would like to know what tools you used to animate some segments of the video, I have personally been messing around with things like manim but I never found anything for code specifically.
Regardless, keep up the awesome work!
Thank you! I tried motion canvas and Manim but ended up creating my own with C#, SkiaSharp and OpenGL
I use RichTextKit for the syntax highlighting in the code snippets
I’ll create a video that shows how I animate these devlogs (devlogception!) and upload the code to Patreon
When Your Game Is Bad But Your Optimisation Is Genius
This is absolutely fascinating stuff. I'll have to watch it a few times to grasp all of it, but brilliant work, mate. Some extremely clever solutions here.
7:35 Can we all just take a second to admire the genius of this approach? I spent like 2 years trying to create a terrain system capable of rendering full scaled planets, and the biggest problem was making all the LOD quads play nice with each other, because in just about 100% of cases you end up with "cracks" in the terrain if you don't render low LOD terrain meshes near the player, since lower LOD's and higher LOD's don't have the same vertices on each edge, and therefore don't connect correctly. There's a few approaches I've tried, like calculating where lower LOD's met higher ones and adjusting the meshes so they were seamless (which is a pain in the ass to get working on spherical worlds), and extruding triangles down from the LOD edges. There's a few more approaches which are more complicated that use tessellation on the GPU which I haven't tried, but this was a problem I just couldn't solve on spherical worlds. The approach shown here is so beautifully simple and fast and looks pretty good! I would have *never* thought to just render extra patches of lower level LOD and just have them intersect to hide the seams like you did. I am definitely going to have to steal this idea for whenever I get back to trying to create spherical worlds lmao
0:03 maybe don't play it on windows XP