[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).

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 :wink:

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

Cheers! :slight_smile:

Hey! I didn’t know about this. Thanks a lot. :slight_smile:

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.

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 :wink:

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.

Argh^^ I dont get it^^ The reflection capture actor does exactly all that for you with the console command I just mentioned :smiley: 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 :smiley: Sorry^^

well that console command doesn’t see to do anything ;/
SphereReflectionCapture still affects only specular reflections, and doesn’t add anything to diffuse.

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.

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!

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 :wink:

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:
a028dfe982682618f1287dfdb477faa9d2eb6805.jpeg
The green on the base of the building are just bad SSR^^

This is what it looks from the inside:
0faead53db12bc35f721a0bdcfc21376148af57a.jpeg

Now I add in a box reflection capture actor and nothing changes:

Then I put “r.DiffuseFromCaptures 1” into the command line and suddenly it looks like this:

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

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

When I turn off the point light, the indirect light from the capture of course stays (until I recapture):
edcdc4cd854b7175516c19ab83c44501b948c05b.jpeg

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

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 :smiley: Of course you couldnt do archviz with it xD

Let me know if this helps!

Cheers :slight_smile:

Edit: even if it doesnt work for you, I would still be interested in knowing if this is basically what you were looking for :smiley:

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 :wink:

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 :frowning:

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:

Cheers! :slight_smile:

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! :slight_smile:

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!

:heart:

Rama

Wow…thanks a lot man! :slight_smile: Glad I was able to help^^

Cheers!

I know this is an old thread, but I just wanted to ask a simple question:
If I use Reflection Captures and not Post-Volumes then these captures modulate both the reflection and the diffuse, right? The default value of 1 is OK for reflection but too high for diffuse, so when I change the value to something lower I consequently loose a part of the reflection. So, is it possible to adjust these two contributions separately? Because, if not, then the initial post-process approach, while cumbersome, provides better flexibility, as the reflection can still be separately modulated by reflection captures, leaving the adjustments of the diffuse to the Post-Volume.

EDIT: 4.9 I tested it. It doesn’t work, the only thing that changes after the console command is that probes affect the reflection a lot more, but still have no diffuse contribution. Please, help. :frowning:

Bumping this - similar situation to ZuiQuan where I want to use localized ambient cube captures to add diffused lighting but can’t get the above solutions to work in 4.9 :frowning:

Was this an intentional change to nuke the DiffuseFromCapture command or did its functionality get replaced by something else?

I am also very interested in a 4.9 solution

A bit of a necro-bump, but this doesn’t seem to be working anymore. The diffusefromcapture works, but as soon as the lighting and materials change it breaks. Here is a quick video I recorded showing the issue: - YouTube

Was wondering if anyone else was getting this, or if Im doing this incorrectly.

Thanks!