Announcement

Collapse
No announcement yet.

[Request] decouple ambient cubemap feature from postprocess into separate entity

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

    [Request] decouple ambient cubemap feature from postprocess into separate entity

    Ambient cubemap even though it is just flat ambient term, can really help light local environment (especially if lights are stationary), but current workflow with it, is clunky to say at least. It can also be helpfull with fully dynamic environment if we just capture ambient light, without directional information.

    To make use of it you need:
    1. Place cube capture actor.
    2. Create cubemap asset in editor.
    3. Assign this asset to actor.
    4. Capture cubemap.
    5. Create static texture from cubemap.
    6. Place post process volume in place you want you cubemap.
    7. Assign your cubemap to post process volume.

    Repeat 1-7 for every time you need cubemap.

    What would be nice is to have new Actor, like "Ambient Cubemap Light/Probe" or something like that.
    Actor would peaceable on level.
    Basic properties are:
    1. Capture radius and light radius (these are the same values)
    2. Light intensity.

    Once placed actor would capture cubemap in set radius, and then use it to apply local lighting (ambient), just like post process volume, just without all this clunky steps.

    In advanced options, there could standard texture properties (hue, brightness, saturation, RGBCurve, etc. which can be found in any texture options window).
    https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

    #2
    This is already possible! First of use a dynamic Skylight, this one can either capture the wohle scene as cubemap (and the capture radius can be tweaked) or you can render out one static cubemap and apply it to the skylight. Intensity can be tweaked on the actor. If you want to, you can use the DFAO, but its not necessary. Since you go fully dynamic, you wont have a reflection environment, but now comes the neat new trick...use the command "diffusefromcapture=1". This a) enables the reflection environment again for both, the skylight and reflection probes (sphere and cube). However, b) they now also store local indirect illumination (diffuse capture) and can be used not only to distribute local reflection, but to distribute local lighting as well! There are some smaller issues with it, but try it out and see if it helps.

    I have to admit though, its not yet as neat as the cryengine does it, but its a good step forward

    Let me know if this was what you were looking for.

    Cheers!
    Last edited by Daedalus51; 09-18-2014, 05:36 PM.
    Check out UNREAL 4 Lighting Academy
    https://forums.unrealengine.com/show...ng-like-that-)

    Comment


      #3
      Originally posted by Daedalus51 View Post
      but now comes the neat new trick...use the command "diffusefromcapture=1". This a) enables the reflection environment again for both, the skylight and reflection probes (sphere and cube). However, b) they now also store local indirect illumination (diffuse capture) and can be used not only to distribute local reflection, but to distribute local lighting as well!
      Hey! I didn't know about this. Thanks a lot.
      FREE VR Drum Kit Project
      FREE Color LUT Collection
      FREE Physics Driven Spacecraft Project
      FREE GTA Style Vehicle Interaction
      Dynamic DoF(Depth of Field)
      Camera Crossfade

      Comment


        #4
        Originally posted by Daedalus51 View Post
        This is already possible! First of use a dynamic Skylight, this one can either capture the wohle scene as cubemap (and the capture radius can be tweaked) or you can render out one static cubemap and apply it to the skylight. Intensity can be tweaked on the actor. If you want to, you can use the DFAO, but its not necessary. Since you go fully dynamic, you wont have a reflection environment, but now comes the neat new trick...use the command "diffusefromcapture=1". This a) enables the reflection environment again for both, the skylight and reflection probes (sphere and cube). However, b) they now also store local indirect illumination (diffuse capture) and can be used not only to distribute local reflection, but to distribute local lighting as well! There are some smaller issues with it, but try it out and see if it helps.

        I have to admit though, its not yet as neat as the cryengine does it, but its a good step forward

        Let me know if this was what you were looking for.

        Cheers!
        It's whole different thing. Skylight is omnidirectional light source that is coming from infinite sphere. around world.

        I'm asking for very localized actor, which would work like ambient cubemap from post process volume, just with more smooth workflow.
        https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

        Comment


          #5
          Then you should try out the diffuse from capture thingy^^ The skylight thing was just mentioned because it makes sense to use both systems together. But of course you can do without it as well. From your description, I would say the diffuse capture is what you want. But yeah...dunno...try it out
          Check out UNREAL 4 Lighting Academy
          https://forums.unrealengine.com/show...ng-like-that-)

          Comment


            #6
            Originally posted by Daedalus51 View Post
            Then you should try out the diffuse from capture thingy^^ The skylight thing was just mentioned because it makes sense to use both systems together. But of course you can do without it as well. From your description, I would say the diffuse capture is what you want. But yeah...dunno...try it out
            I think you should re read my post again ;p.

            All componenets that I need are in engine. The only issue I have right now, is workflow.

            I have to place SceneCaptureCube actor, to capture cubemap.
            In content browser I have to create Cube Render Target.
            Then I have convert the CRT to Cubemap Texture.

            Then I have to place post process volume in place where I want Ambient Cubemap to be appiled.
            And Then I have to assign cubemap.

            All those steps could be condensed into single actor, which would capture cubemap in set radius, and then apply it in the same radius.

            Skylight is for global lighting, I want something localized, which post process volume provides.
            https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

            Comment


              #7
              Argh^^ I dont get it^^ The reflection capture actor does exactly all that for you with the console command I just mentioned Its a local cubemap capture that applies what it captures to the scene around it based on the radius you set. It captures diffuse and reflection. Exactly like like what you described but without that bad workflow^^ There is no difference in capturing the scene with a reflection capture actor vs. scene cube capture if you use the command, only the workflow is better.

              So either I really dont understand you, or you dont understand me Sorry^^
              Check out UNREAL 4 Lighting Academy
              https://forums.unrealengine.com/show...ng-like-that-)

              Comment


                #8
                Originally posted by Daedalus51 View Post
                Argh^^ I dont get it^^ The reflection capture actor does exactly all that for you with the console command I just mentioned Its a local cubemap capture that applies what it captures to the scene around it based on the radius you set. It captures diffuse and reflection. Exactly like like what you described but without that bad workflow^^ There is no difference in capturing the scene with a reflection capture actor vs. scene cube capture if you use the command, only the workflow is better.

                So either I really dont understand you, or you dont understand me Sorry^^
                well that console command doesn't see to do anything ;/
                SphereReflectionCapture still affects only specular reflections, and doesn't add anything to diffuse.
                https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

                Comment


                  #9
                  It only captures indirect light from a stationary skylight or direct light from stationary point/spot/directional lights. Movable lights dont work atm for a strange reason^^ try to boost the probe intensity for a stronger effect.

                  I do the following: I make a dynamic skylight with shadowcasting turned off, then I put the intensity to something like 0.1. Then I capture all the cubemaps placed in the scene and after that, I put the intensity of the skylight back to 1. We Implemented a new reflection environment flag that allows us to fully replace all content from the skylight inside the radius of the probe with the local capture (by default, it just blends). This allows us to make interiors still moody and dark, while having a somehow good and ballanced outdoor lighting.

                  Cheers!
                  Check out UNREAL 4 Lighting Academy
                  https://forums.unrealengine.com/show...ng-like-that-)

                  Comment


                    #10
                    Originally posted by Daedalus51 View Post
                    It only captures indirect light from a stationary skylight or direct light from stationary point/spot/directional lights. Movable lights dont work atm for a strange reason^^ try to boost the probe intensity for a stronger effect.

                    I do the following: I make a dynamic skylight with shadowcasting turned off, then I put the intensity to something like 0.1. Then I capture all the cubemaps placed in the scene and after that, I put the intensity of the skylight back to 1. We Implemented a new reflection environment flag that allows us to fully replace all content from the skylight inside the radius of the probe with the local capture (by default, it just blends). This allows us to make interiors still moody and dark, while having a somehow good and ballanced outdoor lighting.

                    Cheers!
                    Unfortunately it doesn't work. No matter what I try, reflection probes do not contribute to diffuse.
                    https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

                    Comment


                      #11
                      Hmmm....I am sorry to hear that, for me this works fine. Will try out in my build at home and give you some updates on this.

                      Cheers!
                      Check out UNREAL 4 Lighting Academy
                      https://forums.unrealengine.com/show...ng-like-that-)

                      Comment


                        #12
                        Okay, so I am at home now and I did a test for you to illustrate what I do^^ Be aware...lots of screenshots incoming

                        First of all, I am using 4.4.3

                        So, I have my small testmap with some basic house shapes. Lightmass is deactivated in world settings and I am using just a movable directional light with LPVs turned off.

                        It looks like this:
                        Click image for larger version

Name:	01.JPG
Views:	1
Size:	137.4 KB
ID:	1057000
                        The green on the base of the building are just bad SSR^^

                        This is what it looks from the inside:
                        Click image for larger version

Name:	02.JPG
Views:	1
Size:	59.2 KB
ID:	1057001

                        Now I add in a box reflection capture actor and nothing changes:
                        Click image for larger version

Name:	03.JPG
Views:	1
Size:	62.1 KB
ID:	1057002

                        Then I put "r.DiffuseFromCaptures 1" into the command line and suddenly it looks like this:
                        Click image for larger version

Name:	05.JPG
Views:	1
Size:	112.4 KB
ID:	1057003

                        This was intensity of 1 as is standard on the capture actor. When I put it down to 0.5 it looks like this:
                        Click image for larger version

Name:	04.JPG
Views:	1
Size:	87.5 KB
ID:	1057007

                        Then, I add a stationary pointlight and recapture the box capture actor and I get nice direct light + captured indirect light:
                        Click image for larger version

Name:	07.JPG
Views:	1
Size:	118.6 KB
ID:	1057004

                        When I turn off the point light, the indirect light from the capture of course stays (until I recapture):
                        Click image for larger version

Name:	08.JPG
Views:	1
Size:	111.3 KB
ID:	1057005

                        And of course the other building, where I didnt place any capture actors stays black with no indirect light applied:
                        Click image for larger version

Name:	09.JPG
Views:	1
Size:	76.9 KB
ID:	1057006

                        As you can see, its working perfectly fine for me. Hope you can get it to work, because its actually quite cool to work like that depending on what you are doing Of course you couldnt do archviz with it xD

                        Let me know if this helps!

                        Cheers

                        Edit: even if it doesnt work for you, I would still be interested in knowing if this is basically what you were looking for
                        Last edited by Daedalus51; 09-23-2014, 03:51 PM.
                        Check out UNREAL 4 Lighting Academy
                        https://forums.unrealengine.com/show...ng-like-that-)

                        Comment


                          #13
                          Oh...and what I forgot, but is pretty neat as well, you can also use the captures to locally overwrite skylight lighting! This comes in handy when you want to use the skylight for outdoorlighting, but you dont want it to affect interiors

                          For some strange reason, its only working if you use the stationary skylight (which works almost like the movable one with diffusefromcapture enabled, so you get reflection and IBL from it even when you have lightmass deactivated), but yeah, for some reason the captures dont overwite the movable one

                          However, what I did in the following shot was just to turn off the skylight, capture the actor (which was shrinked down a bit to illustrate the transition effect) to get a dark interior and then reenable the stationary skylight.
                          You can clearly see how nicely the skylight gets overwritten by the box capture:
                          Click image for larger version

Name:	10.JPG
Views:	1
Size:	106.2 KB
ID:	1057008

                          Cheers!
                          Check out UNREAL 4 Lighting Academy
                          https://forums.unrealengine.com/show...ng-like-that-)

                          Comment


                            #14
                            Ha! I might found out why its not working for you^^

                            Do you have "AllowStaticLighting=0" enabled? The strange thing is, it works with Lightmass deactivated via "force no precomputed lighting" but as soon as you enable "AllowStaticLighting=0" it does not work anymore. This is actually an error that we fixed in code if I remember correctly. If you dont want to only use "force no precomputed lighting" turned on and get rid of the extra Lightmass stuff from everything as well, I would recommend to the change code too.

                            I think it was in some reflectionenvironment.cpp file were it says that it gets disabled if you use "AllowStaticLighting=0".

                            Let me know if this helps!
                            Check out UNREAL 4 Lighting Academy
                            https://forums.unrealengine.com/show...ng-like-that-)

                            Comment


                              #15
                              Thanks for taking the time to explain everything and put up all those picture Daedalus!

                              I am adding this thread to the wiki because of your wonderful contributions!



                              Rama
                              100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                              UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                              Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                              Comment

                              Working...
                              X