Тёмный

#1 How Occlusion Culling Works: Introduction 

thebennybox
Подписаться 38 тыс.
Просмотров 22 тыс.
50% 1

This mini-series introduces occlusion culling as a companion series for my upcoming tutorial on implementing occlusion culling in a game engine. This video introduces what the problem is and why it's important, and the upcoming videos talk about what approaches can be used to solve the problem.

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 75   
@Phenylalanin1979
@Phenylalanin1979 6 лет назад
Hi Benny. Damn, I've missed you man. So good to see you back teaching cool stuff on the 'Tube.
@mathewo9209
@mathewo9209 6 лет назад
This makes me so happy right now.
@leobottaro
@leobottaro 6 лет назад
Nice to see you again mate! I have to ask, could you do a tutorial on WebGL? maybe just an introduction or just the main differences to modern GL
@Merthalophor
@Merthalophor 6 лет назад
Here's a tip for life: If you're to lazy to read written insteuctionns in order to learn something: dont even bother
@leobottaro
@leobottaro 6 лет назад
Merthalophor I never said I don't want to read written docs, in fact, that's exactly what I've been doing, I just like the way Benny explain things and figured it could help me understand some loose points I didn't get very well
@minecraftermad
@minecraftermad 3 года назад
btw i think audacity has an automatic click removal tool. that could probably fix this audio which is crackly
@d.j.peters
@d.j.peters 6 лет назад
You can't simple ignore reported hidden objects from scene graph. It's more complicated the surfaces of "hidden" objects can reflect on visible objects and create shadows or emits light in the visible area also. How ever I will follow your solution. DJ
@Merthalophor
@Merthalophor 6 лет назад
thanks for letting everyone know
@thebennybox
@thebennybox 6 лет назад
Good thinking! Fortunately, in practice this isn't an issue because computing reflections or shadows requires rendering again from a separate viewpoint. That viewpoint would have it's own occlusion culling (or some games/engines opt to skip occlusion culling for those views, it depends on what you're doing), so anything that view can see that the main camera can't see won't be left out. In short, it all works out without subtle omissions with a rasterization approach. Now, if you're using raytracing, then it's a different story because reflections/shadows are directly computed from the "active" set of objects, but that falls firmly in the category of "it's own can of worms" anyways.
@wssdude
@wssdude 6 лет назад
There are so many different approaches to reflections. Screen Space Reflections and Reflection Probes to name a few. These don't really need data about what got occluded and what not. One is simple Post-FX that does reflection from what got drawn and other uses pre-baked cubemaps on static geometry with better implementations allowing some dynamic objects to cast reflections too. Regarding lighting and shadow casting - similar story. You are rendering cubemaps on the fly for point lights (or combining prebaked cubemaps of static geomtery with dynamic ones) and any other directional and spotligths you might have, independent from the main plain scene rendering. Again, no need to necessarily know what is really visible on the screen from the point of camera, as they are doing their own rendering entirely.
@curtischong2459
@curtischong2459 6 лет назад
I love how you refuse to use Libre Office
@Merthalophor
@Merthalophor 6 лет назад
"Occlusion culling is a technique use to detach objects from the scene that are invisible to the player because they're hidden behind other objects in order to save processing power during rendering." There, saved you 13 minutes, you're welcome.
@NoodleFoxYT
@NoodleFoxYT 11 месяцев назад
Culling is the equivalent of If I don't see it it doesn't exist
@子维-u1g
@子维-u1g 5 лет назад
You sound creepy... But really solid content, thanks man
@TheWalrusViking
@TheWalrusViking 6 лет назад
Hey Benny. I'm glad you're back! I'm letting you know you've got some clicking going on in your audio. It deteriorates the quality of your video a little bit but the content is awesome as usual none the less. If you're looking for a cheap microphone solution I recommend using the Neewer NW-700 ($32 on Amazon), as that's what I use.
@diharaw94
@diharaw94 6 лет назад
"Hello everyone it's benny" oh how much i've missed hearing that. glad you're back!
@nessy3338
@nessy3338 3 года назад
With the exception of NPCs and cars in Cyberpunk 2077, the game doesn't use this technique, and it's kinda sad
@brianchung9388
@brianchung9388 3 года назад
I NEED to know how the log relationship was derived. Isn’t occlusion just based off object locations, which is essentially random?
@musabsarjo
@musabsarjo 4 месяца назад
but it wont work with path tracing you know thay may appears in the mirror for example right? sorry for bad english if any
@bibliusz777
@bibliusz777 6 лет назад
can you improve the audio quality? filter it or sth, its really annoying
@kensoupcan4287
@kensoupcan4287 5 лет назад
I respect that the regular blob and the occluded blob have different expressions on their faces.
@stevmjon
@stevmjon 6 лет назад
glad you are back benny, and you got through bad times with a good attitude intact. looking forward to your upcoming video's.
@Tr4pStyLe
@Tr4pStyLe 6 лет назад
Hey Benny, i see a simple solution which might work. Not sure if it is perferct and how the performance is. My explanation is based on your drawing. You start from top left corner of the view. Then you iterate through each angel from top to bottom. In each iteration you look if there is an object in the view of this angle by inspecting the angle from left to right. If there is an object in this angle, you mark it and continue with the next angle. After the iteration you are basicly finished. All marked objects can be drawn, all other objects can be ignored. You also could do some performace improvment. If you hit an object you could quickly determin all angels which also would be found in the iteration so you could skip these and continue with the angle which is after the object. Hope its understandble, if not let me know you questions. I will try to explain it better then.
@thebennybox
@thebennybox 6 лет назад
Yes! What you're describing is the raycasting approach to occlusion culling, and it's been employed successfully in several games, most notably the original Wolfenstein 3D (you can read more about how that works here, under the Engine section fabiensanglard.net/wolf3d/index.php ). It's a great approach, but the issue is performance. For a game like Wolf3D where you can only look left/right and not up/down, you can get away with only casting one ray per column of pixels, so performance is okay. In a more general scene however, you'll need to cast one ray for every pixel on the screen every single frame. That's equivalent to doing real-time raytracing, just only for determining occlusion rather than drawing the scene. Unfortunately, that's impractically slow for most real-time games, so other approaches must be considered.
@Tr4pStyLe
@Tr4pStyLe 6 лет назад
Thank you for you answere. I totaly forgot the 3rd diminsion. You are righht, this might be a bit overwhelming. I'm looking forward for your series. I am realy excited to see the solutions.
@wssdude
@wssdude 6 лет назад
I'm just a bit into the video and realized how bad your microphone static is. As I have a headphones, issue becomes much more apparent and it is not very pleasing to ears :( I don't want to come out rude or something, just something you could look into in the future. Should be matter of few additional clicks in software like Audition to get it clean or cleaner at least to some more bearable level. Hope you'll see this. Back to the video now :)
@thebennybox
@thebennybox 6 лет назад
Unfortunately, this is the audio *after* the noise cleanup; what you're hearing is the leftovers that cleanup software can't catch. Truth is, my microphone is just pretty low quality, and I don't think there's a good software solution to correct it (there were similar complaints when I did videos on my other channel, and I tried some more post processing techniques. I think it's better than it was, but it's still far from perfect). I am trying to save up for a good quality microphone to solve the problem once and for all, but that's a work in progress.
@wssdude
@wssdude 6 лет назад
I'm a sound designer in one small non-profit Czech group (we are doing voice-over to games) and from my experience, this should be removable (with few if any artifacts). Maybe you just didn't hit the right software or tool. Still, I understand that software is just a quick "patch" to real issue anyway (and sometimes doesn't even work as intended, like here) as I have quite crappy microphone myself. Anyway, I enjoyed your video nonetheless so have my like :)
@wssdude
@wssdude 6 лет назад
Okay, last reply (to myself mostly as I'm quite confused right now...) Removed my last reply as I found this may be a bug of sorts (kind of testing it out now...) My reply disappeared here. THAN it reappeared after I asked about it after refresh that moment... THAN after removing it it disappeared again instantly... Weird :/ EDIT: Okay, I'll let it sit here than just so the reply can be seen :D :/
@MaXie132
@MaXie132 6 лет назад
Can you open up a Patreon? I think there are more people than I who want to support your work.
@wssdude
@wssdude 6 лет назад
...Or setup one-time donations if you are opposed against Patreon for whatever reason (and for students like me who couldn't support you there monthly anyway :/ )
@NeilRoy
@NeilRoy 6 лет назад
One idea I had was to use the ZBuffer to identify objects which are not seen. Any object which shows up in the ZBuffer could be flagged for drawing, anything hidden, even by multiple objects like your blob, should not get flagged for drawing unless it has some part of it in the ZBuffer. I have never even tried to implement this, it was just a thought I got after looking into creating shadows using the Zbuffer from the light's point of view.
@Merthalophor
@Merthalophor 6 лет назад
by the point you have calculted the z buffer of your objecr and compared it pixel by pixel, it's to late, you already rendered your object. Besides, if the order of objects you draw is wrong, the zBuffer won't help you at all.
@Merthalophor
@Merthalophor 6 лет назад
I mean you know the purpose of the zBuffer, right? To decide whete to draw a pixel or not? This has been used for ages, thus is not the solution.
@thebennybox
@thebennybox 6 лет назад
This is a very interesting thought. The Z buffer is a seductive solution because it contains per-pixel information about how close every pixel is to the camera; the perfect set of information for occlusion culling. The problem of course, as +Merthalophor pointed out, is to get a complete Z buffer you need to render the entire scene, defeating the point of trying to do occlusion culling. That thought has spawned a whole body of research on how to render _just enough_ of the z buffer to properly cull hidden objects without actually rendering the entire scene. It's some interesting stuff, and it's ultimately resulted in a few successful approaches (though they are non-trivial to do correctly).
@felipellrocha
@felipellrocha 2 года назад
Thoughts on Nanite? 🙂
@UnidayStudio
@UnidayStudio 6 лет назад
So... Is occlusion culling O(logn)? I never thinked about this before. But what about the calculation costs? Which complexity I can reach? I'm really curious to see your solutions! :) NOTE: Nice to see you back again! :)
@thebennybox
@thebennybox 6 лет назад
Done correctly, yes it is O(log(n)). Of course, achieving that isn't necessarily easy, especially without a large constant factor, hence this series.
@DasEtwas
@DasEtwas 6 лет назад
YOU ARE BACK
@That_Awesome_Guy1
@That_Awesome_Guy1 3 года назад
So this is how nanite works. Occlusion culling with dynamic levels of detail.
@jamesmnguyen
@jamesmnguyen 6 лет назад
We need more "The freakin' Blob"
@bitpilot79
@bitpilot79 6 лет назад
I am glad, you are back.
@CJBurkey
@CJBurkey 6 лет назад
He's *_BACK BOIS_*
@killpopers
@killpopers 6 лет назад
Some grate detail in this video most of which i know already but its good to get a refresher and I'm so happy your back
@GameNationRDF
@GameNationRDF 6 лет назад
13.37 nice :)
@anagramconfirmed1717
@anagramconfirmed1717 6 лет назад
GameNationRDF you beat me to it. I do this on every video i watch.
@fredhair
@fredhair 6 лет назад
Nice video, it's a shame I didn't learn anything new but that doesn't mean the video wasn't educational. Would be a good intro for anyone new to the concept and I'm looking forward to next video in the series that might be a bit closer to my level of understanding. Thanks for putting the effort into making these :) 👍
@Merthalophor
@Merthalophor 6 лет назад
thanks for letting us know you didn't learn anything
@fahdv2597
@fahdv2597 6 лет назад
What operating system do you recommend for game designers like you? And which one are you using right now
@thebennybox
@thebennybox 6 лет назад
The most important thing with an operating system is it lets you do what you need to do without getting in your way, and that's going to be a little bit different for everyone. For me, I've found using Manjaro Linux with the i3 window manager is great for that, but your results may vary.
@fahdv2597
@fahdv2597 6 лет назад
Thanks
@simplecastic
@simplecastic 6 лет назад
Yeah Benny is back so glad
@mathewo9209
@mathewo9209 6 лет назад
What screen recorder do you use by the way? :)
@thebennybox
@thebennybox 6 лет назад
I'm using ffmpeg, which works wonders because it's the backend for a lot of video recorders and editors, and I'm just using it directly. I've heard it's a lot harder to set up for direct use on Windows compared to Linux however.
@Unknown-yd5tv
@Unknown-yd5tv 6 лет назад
Nice video, I heard the static too but it didn't bother me too much. Looking forward to seeing the actual solutions (occlusion culling has always been black magic to me)
@stevmjon
@stevmjon 6 лет назад
i thought black magic was cross product? it is all over the code but just works....
@Unknown-yd5tv
@Unknown-yd5tv 6 лет назад
stevmjon I am sure there are cross in the occlusion culling too, haha
@wssdude
@wssdude 6 лет назад
Cross product is actually very easy to grasp your head around, you just may have not yet seen some proper explanation. If I may recommend you some good source, check out 3Blue1Brown's Linear Algebra series. He is doing it with geometric approach with nice animations and very great explanations. Also, he connects it back and forth with algebraic way of thinking about these so you get best of both worlds. I had same problem as you, not understanding it properly and taking it kind-of for granted - it works, just use it. This really helped me to understand it's usefulness though and I fully encourage you to check him out :)
@Unknown-yd5tv
@Unknown-yd5tv 6 лет назад
Man, thanks for pointing me to this series, it's really good!
@wssdude
@wssdude 6 лет назад
No problem man :) Glad you enjoy it!
Далее