PBF: Occlusion Culling and General Lighting Review with Q&A [Tim Hobson]

**Twitch Stream: Occlusion Culling and General Lighting Review and Q&A **

Stream Subject: Occlusion Culling and Lighting

When: Saturday, October 10th

Time: 2:00 PM to 3:30 PM-ish (EST)

Outline:

YouTube link: PBF: Brief Overview of Occlusion Culling - YouTube

Part 1:

  • General overview of what is Occlusion Culling.
  • Simple Examples of how the system works in UE4
  • Methods to basic level design with Occlusion culling
  • Methods to reduce pop-in of meshes
  • Respond to Questions

Part 2:

This section will be more open forum. We’ll go through the following Levels in Content Examples:

  • Lighting
  • Dynamic Scene Shadows

This part of the stream will focus more on general questions asked and see where we go. I’ll setup some fringe case examples that are asked sometimes if time allows or there is any interest.

  • Review Content Example Maps
  • Answer Questions in each Section.
  • Explore some simple examples not necessarily demonstrated in CE demos
  • Quick look at Swarm Agent/Lightmass
  • Explore a few of the settings for Lightmass in World Settings panel
  • Answer questions along the way.

Post any questions you have here in this thread or in this Google doc (no need for sign-in): https://docs.google.com/document/d/1LJHDxQSOy8FtVaaCb0Un7LYvQt_NCdvWbWd8Tgk5JxE/edit?usp=sharing

Be sure to check out my other projects and tutorials here: [TUTORIALS] Photons Be Free: Mini-tutorials and other curiosities - Community Content, Tools and Tutorials - Unreal Engine Forums

Oh man, this is just the topic I’ve been fighting with recently! My questions:

How does occlusion culling work, exactly? What are the perhaps hidden advanced/console command options to tweak it?

More specifically: why do I get a weird flickering here with an ambient cubemap active?

What could cause a dynamic material instance to revert to default parameters when an actor’s root component is moving out of view?

As you can see, I’ve had my share of troubles with this :smiley: If the questions are too specific, don’t worry about it though. Looking forward to the stream, hope the gamejam will allow for time to tune in :slight_smile:

This will be covered. Not really any console commands that I’m aware of to tweak, but there commands to troubleshoot and change to the alternative method using HZB Occlusion that I plan to cover.

Not sure how this is setup that may be causing the issue. Possibly updating the ambient cubemap at runtime? If so, that could be a reason, but I’ve not invested the time to look and see what’s going on there. If you have a specific setup that reproduces this and want to post on the AnswerHub, then post the link here I can have a look when I get the time to see what may be going on. But more than likely, if you’re updating the skylight capture at runtime this may be the reason why.

Also, not sure on the Dynamic Material Instance, but that sounds like a buggy kind of thing. You may want to post that in the AnswerHub Bug Reports section and we can confirm if that’s the case or not. But it does sound like that should be happening.

Hey Tim,

Unfortunately I am a few months too late to the party. Is there an archived video for this stream like the ue4’s training streams? I think some of us could really benefit from this type of thing. I would be really interested in finding out more about the topics that were covered in this stream.

Hey kabirpunde,

At the moment, it’s not archived anywhere. I never uploaded this one to my YouTube channel, but I’ve still got the source video. I’ll see if I can find this and get it uploaded tonight once I’m at home. This will depend on where I stored it.

In the meantime if you have any questions feel free to post them and I’ll gladly answer what I can or if I get it up tonight and you have any follow-up questions you can post those here as well. :wink:

Tim

I concur with the above. When I started reading the thread I got super excited and then realized that this is old. I’d give up my firstborn to hear the “reduce mesh pop in” section.

Once I get the video uploaded, it pretty much will walk through these settings:

Here is the info taken from the post above.

At some point I’d like to go back and do one with Precomputed Visibility Volumes and Cull Distance Volumes, which I don’t really touch on in the video.

I’ve got some notes and things I’ve written up that I would probably consider putting up.

looking forward to watching :slight_smile:

Hey Tim,

That is great news! Can’t wait to watch this stream. It will be hugely helpful for a lot of people I’m sure.

I’ve added the video to YouTube. I removed the part just going through the Lighting examples in Content Examples. It wasn’t that useful really, just overview stuff. If I were to do anything there I would just record it over again.

Anyways, here is the video link, and I’ve added it to top of the post as well.

This is mostly a broad overview so if there are specific questions I’m happy to help if the video doesn’t explain as clearly.

Awesome Tim, thanks a ton! I have a few questions:

-In one of his videos, Hourences showed that he is using Occlusion volumes in Solus, even though it’s a console title. Can desktop and consoles games benefit from it at all?
-Are there any specific things with regards to open world games?

Thanks again!

At the moment there isn’t a whole lot of options for Dynamic GI in UE4 that are out-of-the-box.

LPV would be the only one at the moment that I have used and would suggest. It’s not that it’s “unloved” it’s just not tech that was created by Epic. This method is being used by Lionhead Studios with their Fable Legends game and they occaisionally send updates that can be integrated. There is some things that are missing from it, like support for Point/Spot lights that make it feel more like a second-class citizen at the moment. Hopefully that is something that can be added and improved in the future, but as far as the use of LPV as a Dynamic GI solution I’ve found it to be well enough to use.

As far as what you should do in the meantime, I would fake it to make it. Games have always been a bunch of smoke and mirrors and if you don’t have a feature or tool you need, but you can do something else to make it work with what you have it’s time to start thinking outside the box. Your question is also a little broad, so my answer can be a little broad.

If you’re doing an interior scene where you need to fake some bounce light you could use lot intensity movable lights that don’t cast shadows. Here is a prime example of the UE4 game “Into the Stars” and a shot of how they lit their bridge on their ship.

By Occlusion Volume, this is really just a Cull Distance Volume in UE4. YES, they absolutely can benefit from using them in their games, whether it’s for PC/Console/Mobile!

For Mobile, Precomputed Visibility Volumes are best since dynamic occlusion is not used. Precomputed Visibility Volumes, much like a Lightmass Importance Volume are used to encompass your playable areas and will create a grid that checks if an objects bounds are within its cell. if it is and it’s not occluded from the camera view it will be rendered.

Cull Distance Volumes, allow you to set up several sizes for objects and anything within the volume that meets the criteria will be culled at the specified distance. You can use these in conjunction with the Dynamic Occlusion that is already on by default in the engine and they can be used with Precomputed Visibility Volumes as well. There may be times where you don’t want an object to cull to which you can just just disable bAllowCullDistanceVolume in the Detail’s panel for the selected object.

So as far as open world games go, it’s best to use large occluders where possible. This can be as simple as a large building near the player that blocks parts of the background scene, or mountains and cliffs that keep the player from seeing for great draw distances. You may think this odd seeing Epic released the Kite Demo and has these huge draw distances. The method there is possible, but you’ll notice it also recommends using a very powerful system. Even Still the grass and trees use extensive LODs to reduce poly count, along with culling by distance for the ground foliage near the player. Keeping the draw calls to a minimum is best here and profiling can really help. For more densely packed areas I would use more cull distance volumes to help offset where the dynamic occlusion system in UE4 is not already helping out.

I don’t know if that specifically answers your question 100%, as there are more things to check when hitting performance bottle necks. Things like Cull Distance Volumes, Precomputed Visibility, and any other performance optimizations would come as I’m building out my levels/games and running into issues. If I start seeing problems with performance, I would start using these more heavily to get my draw calls back down. It’s not something you really start out by placing in your level first and then building around it, at least not for me.

Right now, there isn’t much documentation in UE4’s docs about Cull Distance Volumes, but the old UE3/UDK documentation is still correct on setting up and using these.

UE4 doc: Volume Actors in Unreal Engine | Unreal Engine 5.3 Documentation

UE3/UDK doc: UDK | VisibilityCulling Distance Volumes

Something to keep in mind when using Cull Distance Volumes.

  • They can only use static objects, so it won’t cull any movable objects.
  • The culling will not be visible in the editor. I would suggest just hitting the “G” key to switch to game view to quickly test it working.

If there are more questions or I’ve not been clear enough, feel free to let me know. I can always try and put together some examples or attempt to use my words better. :slight_smile:

That was plenty thank you! Just to note that I misstyped earlier. Hourences used precomputed visibility volumes not cull distance volumes. Although it’s good to be reminded that those exist I keep ignoring them.