Announcement

Collapse
No announcement yet.

Lighting Scenarios for mobile VR ?

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

    [GEAR VR] Lighting Scenarios for mobile VR ?

    Saw this one: https://github.com/EpicGames/UnrealE...30c58a319c67d7

    Lighting Scenarios and lightmaps moved to separate package
    * Levels can be marked as lighting scenarios (eg Day, Night). Lighting is built separately for each lighting scenario with actors / lights in all other scenario levels hidden. Only one lighting scenario level should be visible at a time in game, and its lightmaps will be applied to the world.
    * Most outputs of the lighting build now go into a separate _BuiltData package. This improves level Save and AutoSave times as the separate package will only be dirtied after lighting rebuilds.
    * If a lighting scenario is present, all lightmaps are placed inside it's _BuiltData package. This means that only the currently loaded lighting scenario's lightmaps will be loaded (Day or Night, but not both). This also means that lightmaps for a streaming level will not be streamed with it.
    * For backwards compatibility, existing lightmaps are moved to a new _BuiltData package on load.
    * Reflection captures and precomputed visibility were not moved to the separate package. Reflection captures are force updated on load of a lighting scenario level, which can increase load times.
    Is it in 4.14 ?

    Will we have docs explaining how to do this black magic?

    Will it work on Gear VR or is it too demanding (maybe takes too much RAM or something) ?

    Thanks

    #2
    Yes, 4.14. Should work on all platforms. Description in upcoming 4.14 release notes.

    Comment


      #3
      Originally posted by DanielW View Post
      Yes, 4.14. Should work on all platforms. Description in upcoming 4.14 release notes.
      Sweet!

      Is it possible to blend from day to night (or at least unload one scenario and stream in another, kinda like with streaming levels, but for lightmaps only) ?

      Comment


        #4
        Not with a smooth transition. You can show a cinematic or fade the screen to black and then switch.

        Comment


          #5
          Originally posted by DanielW View Post
          Not with a smooth transition. You can show a cinematic or fade the screen to black and then switch.
          That might work. Will you guys post docs with 4.14 release explaining how to load/unload (stream) lighmap scenarios using Blueprint during gameplay? (assuming level stays the same and doesn't need to be reloaded)

          Comment


            #6
            You make a lighting scenario level active (such that its lightmaps are used) like this:

            Click image for larger version

Name:	temp.png
Views:	1
Size:	25.4 KB
ID:	1117423

            Comment


              #7
              So they are sub-levels where the lightmaps and other optional actors particular to that "scenario" (like the lights) are stored? This sounds perfect for making different "lighting quality" variations for each level like the Disc Jam devs did. This will help a lot making highly scalable games, specially for mobile.

              Comment


                #8
                I think I am missing the point of this lighting scenarios in 4.14

                I could do it already with 4.11, 12 and 13 - just have 2 levels, each having its own lighting, and stream them in and out.

                So what's the point in having these "scenarios" if it works exactly like in older versions of the engine, except lightmaps are external now (only helps with version control perhaps?) ?

                Thanks

                Comment


                  #9
                  Originally posted by motorsep View Post
                  I think I am missing the point of this lighting scenarios in 4.14

                  I could do it already with 4.11, 12 and 13 - just have 2 levels, each having its own lighting, and stream them in and out.

                  So what's the point in having these "scenarios" if it works exactly like in older versions of the engine, except lightmaps are external now (only helps with version control perhaps?) ?

                  Thanks
                  It's not dissimilar to level streaming with the setup. The key here is that the Environment isn't changing only the lighting setup. In the Levels window you will create a new level or add an existing one and when you right-click on it you have the option now to select "Lighting Scenario".

                  As an example for a Day/Night level setup and your level geometry you should have something like this:

                  - Persistent Level or other level for Geometry.
                  - Day Scene - This will house any lighting or setup for your day lighting. So, any light sources, skylight, etc that are needed to make it appear and bake for a lit day scene.
                  - Night Scene - This will house any lighting or setup for your night scene. So if you had street lamps or a skysphere with a moonlit sky and stars, you would have these here.

                  For each of these you would hide one in the Levels Window and then build lighting. You will get a warning about the hidden level. Just select Yes and then Build on the pop-up windows. Then hide that level and do the same for the other lighting scenario.

                  Now you can do what Daniel shows above and just call to load the Day/Night lit scenario. The awesomeness here is that the level geometry doesn't have to be reloaded for each of these lighting setups just the precomputed lighting.

                  Click image for larger version

Name:	DayNight.gif
Views:	1
Size:	271.1 KB
ID:	1117470

                  If anyone is unfamiliar with how to setup the level streaming portion of this the documentation here is helpful to get you started. https://docs.unrealengine.com/latest...nts/index.html
                  Tim Hobson | Learning Resources | Epic Games
                  UE4 Documentation

                  Comment


                    #10
                    Originally posted by Tim Hobson View Post
                    As an example for a Day/Night level setup and your level geometry you should have something like this:

                    - Persistent Level or other level for Geometry.
                    - Day Scene - This will house any lighting or setup for your day lighting. So, any light sources, skylight, etc that are needed to make it appear and bake for a lit day scene.
                    - Night Scene - This will house any lighting or setup for your night scene. So if you had street lamps or a skysphere with a moonlit sky and stars, you would have these here.
                    Makes more sense now, thanks.

                    Getting ahead of myself (haven't installed 4.14 yet), should day/night scenes in the Level window be children of streaming levels ?

                    The reason I am asking is that I will have more than one streaming level which will require different lighting scenarios.

                    For example, I will have outdoor streaming level that will need day/night lighting. Then I will have indoor area that will need normally lit and power outage lighting scenario. So I am wondering how would I make sure that each of the streaming levels that needs 2 scenarios will have proper corresponding day/night lighting scenario referenced.

                    Also wondering if each level can have more than 2 scenarios. For example, morning, day, evening, night for outdoors.

                    Thanks

                    Comment


                      #11
                      [MENTION=6547]Motorsep[/MENTION]

                      No need for them to be children. When converted to a lighting scenario they will have a Sun symbol to indicate its status.

                      Click image for larger version

Name:	Scenario.png
Views:	1
Size:	12.0 KB
ID:	1117482

                      Only a single lighting scenario should be used at a time. While you can load both at the same time the results would not be correct.

                      For something like you're describing, you could easily just create the lighting scenario for your outdoor environments, and then as you transition inside have a switch to load the interior lighting scenario. It's just a matter of making sure you're switching out the ones that are needed. No different than it would be if you were loading in different levels, you would need a trigger to do so if controlling it via Blueprints

                      The scenarios are not assigned specifically to a level. This is how they are tagged and the information that they store. It's best to have only one loaded at a time. You can have as many different lighting scenarios as you want because they are just a level that stores specific information for lighting along with your lights and other assets for your scenario without having to reload an entirely different level since you would have a level or levels that store your geometry.
                      Tim Hobson | Learning Resources | Epic Games
                      UE4 Documentation

                      Comment


                        #12
                        Hi Tim Hobson sorry for resurrect this topic,

                        I am using a different approach in our project to load levels, what I am doing to create a level is this:

                        Code:
                        UWorld* const World = GEngine->GetWorldFromContextObjectChecked(WorldContextObject);
                        ULevelStreamingKismet* StreamingLevel = NewObject<ULevelStreamingKismet>(World, ULevelStreamingKismet::StaticClass(), NAME_None, RF_Transient, NULL);
                        World->StreamingLevels.Add(StreamingLevel);
                        And then I can bind some delegates in order to know if is visible, loaded, etc, The reason why we are doing this is because we want 0 transitions time, so basically I am loading a huge list at the beginning, even if that takes 1 minute and then we have all in memory, we do not care because we are not doing video games.

                        But now we are trying to improve our project using lightning scenarios, if I understood well your answer if you set a level as a lightning scenarios is just a tag for the information they need store, so I tested on my method loading 2 lighting scenarios at the same time and in fact UE is telling me that I can't have 2 light scenarios at the same time!, but how can I be sure that is working and all I have is the same geometry loaded?

                        I'd read this function to see how is handle the visibilty for streaming levels: UWorld::ProcessLevelStreamingVolumes, but I don't see anything relevant to lighting scenarios
                        Also I checked my draw calls with stat scenerendering and apparently all is in order
                        One last thing I did was track back the BP node for load streaming levels, but I could not find anything relevant to Lighting scenarios.

                        Instead go further reading blindly source code, may you give me a better hint about what cpp should I look, or if my level load method is ok?

                        Comment

                        Working...
                        X