Announcement

Collapse
No announcement yet.

Dynamic GI : Getting the Most out of LPV ( Light Propagation Volume )

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

    [TUTORIAL] Dynamic GI : Getting the Most out of LPV ( Light Propagation Volume )

    Hi All,

    I decided to write a little guide about getting the mode out of LPV as a Dynamic GI solution. I believe we have achieve a very solid use-case with Dynamic GI and have gained some insight into the usage. With this we would like to give back to the community, there were very little guide on using LPV properly in Unreal Engine 4. I hope this would help someone along the way. Note that this is something I continue expand on as I learn more about LPV , so right now it might be a very long guide.

    A lot of people seems to suggest that LPV isn't production ready. I don't quite agree ; but I digress since this isn't the point of discussion.
    But before we begin , I'd like to point out that this isn't a guide on how to setup LPV but how to maximize it's usability using LPV settings in post process and in general our experience of using it.
    Official guide on how to setup can be found here

    What's great about LPV :
    • Easy to Setup. One edit of .ini is all it takes.
    • Relatively Cheap in performance comparing to other solution
    • Cost is highly scalable to your liking. You can adjust the size, and easily turn on and off with a single boolean.


    There are 2 major highlights that I want to cover in this tutorial/guide. It's the thing that LPV doesn't do out of the box(default settings)
    • LPV is great but it does NOT look good out of the box. It's inaccurate and make things look weird. You will need to adjust some extra settings when using it.
    • LPV isn't just used to add GI to areas. It's also use to occlude ( darken certain areas ). For dynamic light setup , this is good because skylight fills the world up with constant light and if you have large shadowed area , it looks somewhat 'unlit' on these areas. I will cover occlusion as an important aspect of LPV ( again this isn't automatically there out of the box ).




    Firstly before we being, in order for you to unlock LPV's settings. If you have yet to have a post process volume. Drop one in , uncheck 'unbound' and proceed to edit it's LPV settings. Everything we're talking about here deals with this section.
    Click image for larger version

Name:	settings.jpg
Views:	1
Size:	80.7 KB
ID:	1203718


    Let's begin to deal with each issues of LPV:


    Light Injection Bias

    The first problem we face when we use LPV was the fact that light leaks through surfaces, making them look translucent. LPV works by splitting the affected area into small cube area and then calculate which area is affected by bounce and what color value it is. I don't know the full working behind this , but adjusting this value prevents light from spilling over small surfaces. I noticed that somehow BSP are less affected by this. Here's how it looks like with and without adjustment. Note the huge differences.

    Click image for larger version

Name:	LightInjection.jpg
Views:	1
Size:	926.3 KB
ID:	1203719


    Occlusion
    The second most useful option is occlusion. As mentioned earlier , most people tend to use LPV to light up additional areas with extra light bounces. But what they tend to forget is that occlusion is as important.
    When you got with full dynamic lighting ( assuming you use DFAO ) , the skylight tend to flood shadowed area with a very uniform light , this create a very monotonous lighting. Turning on occlusion and adjusting them gives
    you the advantage of darkening occluded areas. Some might think this is too subtle , however, when it comes to lighting , I believe subtle notes are sometimes the key factor in creating realistic environment..

    To enable this , just increase the Occlusion intensity to above 0.0.


    In the screenshot below , note the area behind the tree on the first picture and the general ambient inside the cafe. It has a very strong contrast. In the second picture , you can see shading of the pavement area totally differ from the one before tweaking.

    Click image for larger version

Name:	Occlusion.jpg
Views:	1
Size:	686.0 KB
ID:	1203720

    Some extra info:
    • In LPV settings . The Size parameter could significantly impact performance. It's the size area where the LPV affects. You can tweak this value to balance performance vs quality.
    • To allow scalability options for user to enable/disable Dynamic GI ingame, you can always enable/disable 'DynamicIndirectLighting 'boolean in DirectionalLight. This is the easiest way IMO.
    • Secondary Light bounce can be enabled , I personally don't find them significant , but the cost is extremely low. I suggest trying them out.









    Here are some extra screenshot of what it wouldn't be possible without LPV.
    Additionally here are also some GIF Comparison of LPV turning Off and On; with the right tweaks the difference are quite significant.

    Note that these are screenshot from our WIP game and there are some untextured assets, the point of this is to appreciate the subtle lightbounce of the environment.

    Click image for larger version

Name:	Extra.jpg
Views:	1
Size:	278.9 KB
ID:	1203721

    Click image for larger version

Name:	Extra2.jpg
Views:	1
Size:	411.7 KB
ID:	1203722
    Click image for larger version

Name:	Extra3.jpg
Views:	1
Size:	374.2 KB
ID:	1203723
    Last edited by Frozenfire; 12-12-2016, 03:38 PM.
    Developer at AmmoboxStudios.



    Eximius ( An FPS/RTS Hybrid )

    #2
    Thanks for the tutorial Frozenfire.

    I was tweaking a bit the LPV settings few days ago. For now i am making mobiles games, but for a future project i was looking for some real time GI solution, for an open world type of game.

    How would you handle a big landscape for example 5kmx5km with LPV?

    By the way great work so far on Eximius, and on Puzzle Match-3 Template too.
    Pandora Entertainment
    github.com/PandoraEntertainment
    [PLUGIN][FREE] AdColony, AppLovin, Chartboost, UnityAds, Vungle, Sharing, OneSignal, Facebook, Everyplay.

    Comment


      #3
      Originally posted by Makis View Post
      Thanks for the tutorial Frozenfire.

      I was tweaking a bit the LPV settings few days ago. For now i am making mobiles games, but for a future project i was looking for some real time GI solution, for an open world type of game.

      How would you handle a big landscape for example 5kmx5km with LPV?

      By the way great work so far on Eximius, and on Puzzle Match-3 Template too.
      LPV isn't dependent on map size. It generally only calculate a certain distance from where the player is. Hence it's a very viable solution for big map as long as it's majority an outdoor map.
      Developer at AmmoboxStudios.



      Eximius ( An FPS/RTS Hybrid )

      Comment


        #4
        thanks for the guidance, but im not quite sure about what LPV does and the reason behind its creation. is it some kind of solution (analog to lightmass importance volume for static lighting) for quality dynamic ligthing? and in what cases this would be convenient to implement?

        Comment


          #5
          Thank you for posting this
          Assets: Military Ammunition (Released)
          Plugins: BlueManBPFunctionLibrary C++ plugin (Free), Blue Man Vehicle AI Plugin (Released), Air Resistance C++ Plugin (WIP), Blue Man Vehicle Physics Plugin (Marketplace)
          Projects: Giants Of Destruction

          Comment


            #6
            Originally posted by maquina95 View Post
            thanks for the guidance, but im not quite sure about what LPV does and the reason behind its creation. is it some kind of solution (analog to lightmass importance volume for static lighting) for quality dynamic ligthing? and in what cases this would be convenient to implement?
            @maquina LPV is a dynamic GI solution. It deals mainly with GI only. Because we don't have lightmass/lightmap in Dynamic lighting , what we have is mostly AO ( either from SSAO or DFAO ). This means that other than the AO applied , shadowed area lack the depth of contrast ( they're flatly lit or unlit ). Large shadowed area suffers the most.

            A few points for you:
            - LPV works globally , it's not a volume per se, but it calculates a certain distance from Camera.
            - The post process I mention about is needed because LPV's settings are somehow in post process. Without post process volume , you can't adjust the more important settings.
            - LPV works best for Outdoor scene with very intense lighting ( harsh shadowed environment ), something like sunlight.
            Developer at AmmoboxStudios.



            Eximius ( An FPS/RTS Hybrid )

            Comment


              #7
              thanks man, really appreciate the answer. i have to say after reading this and digging into Ray Traced Distance Field Shadows, DFAO and the stuff related its freaking mind blowing .
              Originally posted by Frozenfire View Post
              @maquina LPV is a dynamic GI solution. It deals mainly with GI only. Because we don't have lightmass/lightmap in Dynamic lighting , what we have is mostly AO ( either from SSAO or DFAO ). This means that other than the AO applied , shadowed area lack the depth of contrast ( they're flatly lit or unlit ). Large shadowed area suffers the most.

              A few points for you:
              - LPV works globally , it's not a volume per se, but it calculates a certain distance from Camera.
              - The post process I mention about is needed because LPV's settings are somehow in post process. Without post process volume , you can't adjust the more important settings.
              - LPV works best for Outdoor scene with very intense lighting ( harsh shadowed environment ), something like sunlight.

              Comment


                #8
                Originally posted by Frozenfire View Post
                - LPV works best for Outdoor scene with very intense lighting ( harsh shadowed environment ), something like sunlight.
                Thanks for sharing!

                We followed your tutorial and have an outdoor scene (large landscape)w with a day/night cycle and only dynamic lighting. However, we cannot see any visual difference with the LPV. Would you have a guess as to what we have not done correctly?

                WIP Thread

                Comment


                  #9
                  Got a question here, what difference you got from one of these right images and the skylight in dynamic, cause looks like LPV is doing near nothing with the colors at all, so you can save probably all of that and use a skylight that gives basically the same result ?

                  By the way thanks for share with the community.
                  Last edited by Hevedy; 12-11-2016, 10:09 AM.
                  Hevedy - Instance Tools: https://hevedy.itch.io/hevedyinstances
                  Hevedy - Image Tools: https://hevedy.itch.io/imagetools

                  Comment


                    #10
                    Originally posted by Hevedy View Post
                    Got a question here, what difference you got from one of these right images and the skylight in dynamic, cause looks like LPV is doing near nothing with the colors at all, so you can save probably all of that and use a skylight that gives basically the same result ?

                    By the way thanks for share with the community.
                    [MENTION=3251]Hevedy[/MENTION] LPV affects the scene subtly but significantly IMO.

                    Here are some animated comparison shots. http://imgur.com/a/eFyPo
                    In a lot of the scene it's mostly use to create tighter shadows around larger objects ( buildings ) etc ,
                    Attached Files
                    Developer at AmmoboxStudios.



                    Eximius ( An FPS/RTS Hybrid )

                    Comment


                      #11
                      Originally posted by Rhynedahll View Post
                      Thanks for sharing!

                      We followed your tutorial and have an outdoor scene (large landscape)w with a day/night cycle and only dynamic lighting. However, we cannot see any visual difference with the LPV. Would you have a guess as to what we have not done correctly?
                      [MENTION=36244]Rhynedahll[/MENTION] do you have some screenshots? I'm not entirely sure where you're stuck at .
                      Do verify if your LPV is actually working , and then you can work on tweaking.

                      I've just posted an animated comparison of what you can expect from a well-tweaked LPV in my reply to Hevedy.
                      Developer at AmmoboxStudios.



                      Eximius ( An FPS/RTS Hybrid )

                      Comment


                        #12
                        Originally posted by Frozenfire View Post
                        [MENTION=36244]Rhynedahll[/MENTION] do you have some screenshots? I'm not entirely sure where you're stuck at .
                        Do verify if your LPV is actually working , and then you can work on tweaking.
                        That's just it. We cannot verify if the LPV is working because no adjustment makes any change.

                        Is there some setting elsewhere that must be enabled in order to make it function?

                        WIP Thread

                        Comment


                          #13
                          Originally posted by Rhynedahll View Post
                          That's just it. We cannot verify if the LPV is working because no adjustment makes any change.

                          Is there some setting elsewhere that must be enabled in order to make it function?
                          have you set the post process volume to unbound ?

                          Comment


                            #14
                            Originally posted by Amiot View Post
                            have you set the post process volume to unbound ?
                            Yes. We have completed all steps listed above.

                            WIP Thread

                            Comment


                              #15
                              Originally posted by Rhynedahll View Post
                              Yes. We have completed all steps listed above.
                              wait let me get this correct... you don't know if youre LPV Is working of if you don't know your 'tweak' is working?

                              if you're not sure if your LPV is even working follow the guide in the official LPV documentation ;
                              https://docs.unrealengine.com/latest...gationVolumes/

                              use the visualize
                              Developer at AmmoboxStudios.



                              Eximius ( An FPS/RTS Hybrid )

                              Comment

                              Working...
                              X