Search Unity

Dark Cave in a Lit Environment

Discussion in 'High Definition Render Pipeline' started by Momissimo, Mar 26, 2022.

  1. Momissimo

    Momissimo

    Joined:
    Aug 15, 2019
    Posts:
    18
    Hello everyone. I building an environment that has a cave which I would like it to be completely dark; And for this i am using the HDRP pipe line.

    upload_2022-3-26_13-54-46.png

    First I have created a Global Volume with the following settings:

    upload_2022-3-26_13-58-8.png

    Then I created the Sun: a Directional Light with the following settings

    upload_2022-3-26_13-59-35.png

    Then I created a Local Volume for the cave and now I am stuck.
    upload_2022-3-26_14-5-24.png

    upload_2022-3-26_14-5-1.png


    I can not figure how to make the cave completely dark. What is the best way to make the cave completely dark? Can someone guide me?
     
  2. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    This is going to be uber difficult if you are planing to do it using real time lighting.

    Your cave is not dark because you have ambient light.

    Volumes works when your camera is inside not when the object is inside.
    This is why for real time light it is actually quite difficult to do it.

    With baked lighting it is easier, you put light probes everywhere and bake the light.
    If you are lucky and you have successfully baked, you will not have specular lighting and you will have leaking light probes probably ;)
     
  3. Momissimo

    Momissimo

    Joined:
    Aug 15, 2019
    Posts:
    18
    I have placed Light Probes everywhere.

    upload_2022-3-26_14-29-52.png

    This is the result inside the cave

    upload_2022-3-26_14-30-4.png



    It is still very bright inside. Is there anything else I can do?
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Did you place reflection probes inside?
     
  5. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    @Momissi Search for lightmap and light probes tutorial. It's not that simple unfortunately.

    It's not the problem with reflection probes, this is ambient light problem.
    If OP want to have darkness right now he can set ambient light to black.
    The shadow will be completely black, so the cave.
     
  6. Momissimo

    Momissimo

    Joined:
    Aug 15, 2019
    Posts:
    18

    Yes I have also added two reflection probes
    upload_2022-3-26_14-51-49.png

    Shall I get rid of them?

    But by setting the Ambient light black i wont have any transition right?
     
  7. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    As I said problem is that volumes are for camera not for object.


    Example:
    You set ambient to black for volume inside cave.
    You set ambient to some light for outside profile.

    When camera is outside and you look into the cave the cave will have bright ambient light.
    When you stand inside the cave and look outside the outside will have ambient set to black.
     
  8. Momissimo

    Momissimo

    Joined:
    Aug 15, 2019
    Posts:
    18
    Ok; I have set the So do you suggest me to overdrive the visual Environment Component for the Cave?
    upload_2022-3-26_15-37-29.png
     
  9. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    I suggest you do lightmap and ditch ambient light generated by Volume.

    Or completely dismiss the idea of going through light to dark places seamlessly when using real time lighting. (so no caves basements etc. until you accept that moving from light to dark will be unrealistic.
     
  10. Momissimo

    Momissimo

    Joined:
    Aug 15, 2019
    Posts:
    18
    Sorry just to make sure that i understand: I generate the lightmaps with my ambient light on - i ditch the ambient light (my directional light --> so i do not have real time lighting) right?
     
  11. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    I'm not a specialist on lightmaps, you would have to do some tutorial/docks.

    But generally when you bake lightmaps you should not bake ambient light, the ambient should be calculated by light bouncing and hemisphere.
     
  12. Deleted User

    Deleted User

    Guest

    Hey u can use the new adaptive probe volume system or u can use SSGI with reflection probes setup
     
  13. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Hey, you should study the HDRP scene template (created via the Unity Hub 3), and follow the in-editor tutorial for it. In room 2 and 3, there are good examples of "cave-like" lighting, with light maps, local exposure volumes, reflection probes, and physically-based lighting.

    As a reminder, Light probes are mainly meant for small and/or dynamic objects, not really for large static structures. For optimal results, you should use light maps. We are also adding a more refined version of Adaptive Probe Volumes (APVs) in Unity 2022.2, but I'd suggest you familiarize yourself first with light maps.
     
    Kirsche likes this.
  14. OhIcanchangethenamethatsgood

    OhIcanchangethenamethatsgood

    Joined:
    Apr 8, 2021
    Posts:
    24
    Seems like you have encountered the same problem as we had:
    https://forum.unity.com/threads/hdr...or-scene-completly-wrong-2020-3-22f1.1205476/


    Reflections probes are not the issue here. The Sky(box) is affecting the enclosed areas somehow.
    Its like a global light which is applied to every object in the scene, even if its in complete darkness.
    Its not even baked global illumination, just "reflected" sky light whch is is obscured by objects.
    One workaround is to disable the Sky Reflections in the HDRP settings (look at #2 Post the last image).
    Its not a proper solution, but it should do the trick.
     
    PutridEx likes this.
  15. ElevenGame

    ElevenGame

    Joined:
    Jun 13, 2016
    Posts:
    146
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    use ambient occlusion? this works without any volumes and lets you look from a bright ouside into a dark inside.