Search Unity

Reflection Probes without Light Probes - very dark result.

Discussion in 'High Definition Render Pipeline' started by koirat, Mar 1, 2022.

  1. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    I have noticed that using Reflection Probes very often make objects very dark, I know some people use Light probes to make the result brighter.
    Is the ambient light overwritten ?

    What can a person that don't use light mapping do - to make it more bright ?
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    Add real time lights.
     
  3. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    I have a directional (sun) light, and Physical Based Light ambient light.
    I'm definitely not going to add some additional lights just for Reflection Probes to look good, I would remove Reflection Probes first.

    I thought there is some "legit" way to do this.
    The only idea I got is to script edit the reflection probe texture after baking by increase the brightness of it.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    Reflection probes capture the environment, if the environment is dark, they will also be dark, which is why I suggested adding lights.

    I am unsure what exactly you want to achieve, some images would help.
     
  5. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    Yes I know but, without reflection probe I got the scene ambient light, with reflection probe it looks like the ambient light is no longer taken into account.

    I will play with it a little day after tomorrow, I might do some screenshots.
     
  6. valarnur

    valarnur

    Joined:
    Apr 7, 2019
    Posts:
    440
    Do you have fixed exposure?
     
  7. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    I'm using auto exposure.
    But what is surprising is that reflection probe looks different than what my camera can see, and yes it looks like exposure problem, since entrances to corridor are totally overexposed, and the corridor inside looks underexposed.

    And my models look very dark when I set metallic to some very high values (mirror like)

    Below you can see corridor, and light probe on the right side.

    I'm using HDRP and Physical Based Lighting for ambient.


     
    Last edited: Mar 2, 2022
  8. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    234
    The probe-result looks fine, just what you would expect from a linear space HDRI without any post-processing.
    Your camera output is very different from that (gamma space, low dynamic range and post-processing like auto-exposure, tonemapping etc.).

    EDIT
    Baked reflection probes don't capture indirect light, only realtime probes do that.
     
    Last edited: Mar 2, 2022
  9. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    So what can I do to have functional reflection probes with real time lighting ?
    Because the result right now is definitely unacceptable.
     
  10. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    234
  11. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    Baked Reflection Probes with non baked lighting, and no light probes.
    It is a real time lighting but without changes.
     
    Last edited: Mar 3, 2022
  12. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    Please take a look at the picture below, one is real time reflection probe with on enabled, the second is baked one.
    Is such a huge difference a normal thing ?

     
  13. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    It depends on your setup. First, you should share a skeleton version of this scene to begin with, it's difficult to know what you may be doing that causes this. We still don't know how the ambient is generated in the scene, what's in your custom volume layer mask, how different your frame settings are between your real-time and baked reflection probes, what is in your hdrp asset settings, etc.

    At least, I would expect any reflection probe to be able to capture the fallback ambient, so there's clearly something odd going on if the baked reflection probe sees a black interior constantly.

    BTW the probe preview in the Inspector is not tonemapped nor auto exposed, so it's not necessarily a good indication of "too dark" or "too bright". A mirror in the actual scene is the right way.
     
  14. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    234
    You said your lighting setup is real time, baked reflection probes get their indirect light from light maps, but you dont have any so the result is pitch black.
    Either switch to baked lighting and bake lightmaps, or stick to realtime reflection probes.
     
  15. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    First of all, thank you for the answer, It is always a pleasure to receive it from a trusted source.

    After some hours of messing around with parameters I was able to find what the problem is, I don't know If this should be considered a BUG.

    So as we suspected it is the ambient light problem, In my Volume profile if the VisualEnvironment->Mode is set to dynamic than baked reflection probe is ignoring ambient light.

    I decided to set mode to static and inside Window->Rendering->Lighting->Environment->StaticLightingSky I set to PhysicallyBasedSky

    Reflection Probe was baked correctly, at least it is almost identical to real time one.








    Also I have noticed one thing, when using Realtime reflection probe it will reflect everything, static and dynamic objects.
    This is desirable when using Every Frame mode but might not be desirable when using OnEnable or OnDamand.
    It would be quite useful to be able to enable/disable rendering of dynamic objects even when using Realtime Reflection Probe.
     
  16. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Once you switch to dynamic only objects, you can use the culling masks on the reflection probe, to decide what the probe can see or not.

    In this image, the probe capture the nearby non-static chrome sphere. So the sphere reflects itself, as the capture point is on its right (capture point is the gizmo in the scene view):
    upload_2022-3-3_14-27-0.png

    To prevent the sphere from being seen by the reflection probe, you simply place the reflection probe on a layer that cannot be seen by the reflection probe (via its culling mask). This way, the reflection doesn't capture the sphere anymore, and the sphere doesn't reflection itself anymore:
    upload_2022-3-3_14-27-16.png


    Btw, I just saw in a very recent branch that the time slicing appeared for realtime probes, it refreshes each face of the probe every 7 frames. This will make them quite cheaper.
    upload_2022-3-3_14-29-6.png
     
  17. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    Using Culling Mask is not an option, I'm using layers for physics.
    Anyway this is a minor issue for me right now. Bigger one is the problem of baking dynamic ambient light into Reflection Probe.
     
  18. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    I tried to repro on my end the issue you had when using the "Dynamic" ambient mode. However, I'm unable to, and the reflection probe can always see the ambient light.

    Dynamic ambient light, dynamic objects, baked reflection probe: works as expected
    upload_2022-3-3_14-48-8.png

    Dynamic ambient light, dynamic objects, real-time reflection probe: works as expected
    upload_2022-3-3_14-48-11.png

    There might be something else in your project that causes an issue. But it seems you fixed it by switching the ambient mode to "static". Still, something fishy might be going on your end (either a bug, or a setup issue).
     
    Last edited: Mar 3, 2022
    valarnur and koirat like this.
  19. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    Thank you for your effort I will try to investigate It some more on a clean project.
     
  20. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    I have created totally new project (minimal HDRP) default settings and I see the same problem Baked Reflecton Probe ignoring ambient light.
    Unity3d 2021.2.13f1 HDRP

    I see you are using non static objects in your example.


    Please set your walls and floors to static, and try to bake, you should see the completely black parts on your Reflection probe.

    If it works for you correctly please allow me to send you my minimal project.
     
  21. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    It works as expected on my side, no difference between baked and real-time when using static geos.

    upload_2022-3-3_19-26-52.png
     
  22. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    I'm starting to have some remorse for asking you of additional favor but I have invested some additional hours into experimenting and I think I have narrowed issue even more.

    What I have noticed is that baking reflection probe is using Window->Rendering->Lighting->Environment settings and scene volume kind of at the same time, like not all options but some.
    I have created additional profile (with kind of reddish ambient color) and put it into Environment settings.
    I baked reflection and as a result I get reddish reflection probe.
    When I switch to Realtime OnEnable Reflection probe there is no reddish color and scene profile is used.


    I have tried to send a Bug report (2 times), but I got an error "Unable to Write" (whatever this means) every time.
     
  23. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,074
    I was able to send the report today, it is titled "Reflection Probe types to different from eachother."
    I categorized it as problem with editor, but I'm not sure it is a good choice.