Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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:

    http://www.twitch.tv/guigsy1865

    YouTube link: https://youtu.be/6MhsdwTW3SQ

    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:

    Click image for larger version

Name:	Lighting_Header.png
Views:	1
Size:	343.0 KB
ID:	1164578

    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/1...it?usp=sharing

    Be sure to check out my other projects and tutorials here: https://forums.unrealengine.com/show...er-curiosities
    Last edited by Tim Hobson; 02-01-2016, 11:58 PM.

    #2
    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?
    https://vine.co/v/e2FIi2bvFwi

    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 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
    Broad Strokes | Jan Kaluza | Marketplace Release: 'Over 9000 Swords' Modular Melee Weapon System
    Currently not available for freelance work
    Dev Blog & Tutorials | Twitter

    Comment


      #3
      Originally posted by Kashaar View Post

      How does occlusion culling work, exactly? What are the perhaps hidden advanced/console command options to tweak it?
      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.


      Originally posted by Kashaar View Post
      More specifically: why do I get a weird flickering here with an ambient cubemap active?
      https://vine.co/v/e2FIi2bvFwi

      What could cause a dynamic material instance to revert to default parameters when an actor's root component is moving out of view?
      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.
      Tim Hobson | Learning Resources | Epic Games
      UE4 Documentation

      Comment


        #4
        Originally posted by Tim Hobson View Post
        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.

        Comment


          #5
          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.


          Tim
          Tim Hobson | Learning Resources | Epic Games
          UE4 Documentation

          Comment


            #6
            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.

            Comment


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

              https://answers.unrealengine.com/que...ame-lag-1.html


              Here is the info taken from the post above.

              There is a couple of options to try that you may or may not have explored. I used your test scene as a base for any settings I mention below.

              Bounds Scale: This is mesh specific and can be changed via the details panel. The default value is 1.0. Increasing the bounds scale to 1.15 increased the bounds enough that These object rendered before the noticeable pop-in. Since the walls are broken up into smaller pieces they have a smaller bounds (which can be visualized by going to viewport > Show > advanced > bounds). Smaller object bounds will occlude the object more quickly to better optimize the scene.

              - r.VisualizeOccludedPrimitives: enabling this console command will draw a green box around any occluded primitive. This works while editing, but not during PIE/simulate. This can be useful when adjusting the bounds scale of objects to see if they are occluded or not.

              - Project Settings > Rendering: Disabling Occlusion Culling completely. Not really an option for most, but an option none-the-less.

              - r.HZBOcclusion: This setting used to be enabled by default (which if you look at the tip in the output log will indicate 1 use to be the default), but needs to be enabled now to use since it still needs a little bit of work. HZB Occlusion's results are more approximate, but it is meant to scale better.

              0 (default): disabled

              1: Use HZB occlusion system (Less GPU and CPU cost, more conservative results)

              2: Froce HZB occlusion system (overrides rendering platform preferences)

              Enabling HZB Occlusion will likely provide the better result for you without the need for tweaking bounds scales for any meshes that are causing issues. In your test scene, simply enabling HZB occlusion solves the issue. There is the occasional pop-in from the corners if moving the camera really fast, but it's not as noticeable as before. On the other hand, if it's only a few meshes that are causing issue then I would suggest adjusting just those meshes bound scales slightly until they do not pop-in like so.
              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.
              Tim Hobson | Learning Resources | Epic Games
              UE4 Documentation

              Comment


                #8
                looking forward to watching
                Visual Effects Artist, Weta Digital, Wellington New Zealand
                BLOG www.danielelliott.co.uk
                @danielelliott3d https://twitter.com/danielelliott3d
                Unreal Engine and VFX Tutorials https://www.youtube.com/user/DokipenTechTutorials
                2015 Showreel: https://vimeo.com/116917817

                Comment


                  #9
                  Originally posted by Tim Hobson View Post
                  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.


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

                  Comment


                    #10
                    Hi Tim,

                    Can you say something about dynamic lighting too?
                    (the title covers general lighting questions as well)

                    With no all-encompassing GI dynamic lighting solution yet...
                    Its not clear what we should do meantime, regarding PC games (not archviz / mobile).
                    (DFGI is on hold, VXGI is too thirsty, AHR is WIP, LPV is unloved etc)
                    Last edited by ClavosTech; 02-01-2016, 07:33 PM.

                    Comment


                      #11
                      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.


                      Last edited by Tim Hobson; 02-02-2016, 12:05 AM.
                      Tim Hobson | Learning Resources | Epic Games
                      UE4 Documentation

                      Comment


                        #12
                        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!

                        Comment


                          #13
                          Originally posted by franktech View Post
                          Hi Tim,

                          Can you say something about dynamic lighting too?
                          (the title covers general lighting questions as well)

                          With no all-encompassing GI dynamic lighting solution yet...
                          Its not clear what we should do meantime, regarding PC games (not archviz / mobile).
                          (DFGI is on hold, VXGI is too thirsty, AHR is WIP, LPV is unloved etc)
                          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.

                          Click image for larger version

Name:	bridge_light-into-the-stars-interview-925x1024.jpg
Views:	1
Size:	260.5 KB
ID:	1099736
                          Tim Hobson | Learning Resources | Epic Games
                          UE4 Documentation

                          Comment


                            #14
                            Originally posted by DamirH View Post
                            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!
                            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: https://docs.unrealengine.com/latest...mes/index.html

                            UE3/UDK doc: https://udn.epicgames.com/Three/Visi...ling.html#Cull 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.
                            Tim Hobson | Learning Resources | Epic Games
                            UE4 Documentation

                            Comment


                              #15
                              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.

                              Comment

                              Working...
                              X