Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question HDRP Lighting Artifacts

Discussion in 'High Definition Render Pipeline' started by Floggy, Feb 22, 2021.

  1. Floggy

    Floggy

    Joined:
    Nov 10, 2017
    Posts:
    4
    Hi Guys and Girls,

    I've been trying to wrap my head around HDRP for a while now, but I seem to be incapeable of getting the same results as in the preview scene. I set up a simple small two story house.

    There is a Global volume with HDRI Sky, 13,5 exposure and a directional light.
    I created a volume for inside with exposure limits, a refelction proxy volume, all the reflection probes and a light probe group. Just as the sample scene taught me.

    But when I bake the GI with my 2080 Super this happens (even with OpenImageDenoise instead of Optix).
    GPU_Bake.png

    Ok I can remedy that, I thought, and switched to CPU bake (witch I am not thrilled about but what can you do).
    And now the result looks somewhat believeable but there is still an issue with the spot lights!
    CPU_Bake.png

    You see there are spotlights on each of the little cylinders on the ceiling. In the sample scene, lights with the exact same settings, in a Volume with the exact same settings are clearly visible on the walls and floor almost washing it out a bit. But here you cannot see them at all.
    Volume_Settings.png
    Spot_Settings.png

    That is not until I crank up the Spots to 400,000.00 (Yes !) Lumen then thy are visible but I get horrible artifacts!
    Spots_Cranked.png

    If that helps, the size of the steps in the artifacts stays constant on the screen if you get closer.
    So I tried diagnosing my problems with the Render Pipline Debugger, and compared it with the sample scene:

    I can see the spots when selecting DirectDiffuseLighting, so they are rendered, but still including those artifacts.
    When I select LuminanceMeter I get a completely white screen, unlike in the sample.
    The others look similar to the sample scene.

    I feel like I am staring the problem in the face but I can't make sense of it.
    Any pointers would be appreciated.

    P.S.: I am sure it's nothing inherent in my setup, since I can regenerate the lighting data in the sample scene and get a perfect result, at least with a CPU Bake.

    Thx Floggy
     

    Attached Files:

  2. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    431
    Hey, thanks for the detailed images.

    For the difference in bakes between GPU and CPU lightmapper, this is not expected at all, the UV atlasing should be strictly identical, so this is a very odd issue. You might want to share it here, or open a bug for it.

    For not being able to see the light during the day when using physically-based units: that's expected. If you turn on the light inside a real interior with a lot of access to the outside lighting, you will have difficulties noticing the light. In the same way that noticing the light of a campfire during the day is also very hard (or it needs to be huge). Also, in the HDRP sample scene (in 2020.2), if you were to place one of the floor lamps or strong spotlights in the 2nd room with the trees, they won't be very obvious in this area that already has a lot of indirect lighting which is much stronger than the artificial light coming from these lamps.
    upload_2021-2-22_19-45-16.png

    But then the exact same lamp will be way more noticeable in an area without much indirect lighting from the sky at all.
    upload_2021-2-22_19-46-57.png

    Now, the blocky artifacts you see are probably visible because you have a huge number of lights in your scene (from the floors above?) that overlap. Go to Window > Render Pipeline > Render Pipeline Debug > Lighting > Tile/Cluster Debug:
    upload_2021-2-22_19-39-48.png

    See if the artifacts you see match the clusters or tiles. Then try to reduce the number of lights (via Fade distance in the light properties) for instance. You might also have too many reflection probes (they both count in the same way).
     
  3. Floggy

    Floggy

    Joined:
    Nov 10, 2017
    Posts:
    4
    Thank you for you Time.
    Yes I will create a bug report where you mentioned.

    And I will look into the lighting diagnostics you suggested! I don't seem to have a complete grasp of how that exposure thing works yet. Though I know the lights sould be visible because the room exists in real life and even spots with less light output are clearly visible in reality. Maybe I need to tweek my volume settings a bit.
     
  4. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    431
    No problem. Yes if you want to see the indoor light more visibly, you'll need to tune the exposure in the volume (lowering it a bit).
     
  5. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    927
    Just to be clear, the (no. of lights) + (no. of reflection probes affecting a cluster) <= 24 (that's the hard coded limit if I remember correctly)

    Also, how does it translate to forward rendering in HDRP, Does it also use some kind spatial clustering (guessing based on Forward+ renderer in development for URP), also is spatial cluster size dynamic or fixed?

    A little clarification for forward renderer would be really helpful.

    I am having a hard time deciding which one to chose given emissive material are forced to be rendered in forward pass (if selected in the material), what are some of the scenarios I should choose forward renderer in?:p
     
  6. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    431
    It all depends on your project, the type of materials, etc. HDRP is a hybrid renderer, so the old recommendations "sun only = use forward" or "many lights = use deferred" don't necessarily apply anymore. You can switch between both for the lit shader at the flick of a switch. It's up to you to profile your project and see how it performs and pick what's best for you.

    Btw, that forward/deferred switch only applies to the lit shader. Any complex shader is still going down the forward pass regardless, for transparency for example. And you can even force forward on specific cameras and deferred on others depending on the scenes/areas. You're in full control. :)

    See doc:
    https://docs.unity3d.com/Packages/c...s.high-definition@12.0/manual/HDRP-Asset.html
    https://docs.unity3d.com/Packages/c...0/manual/Frame-Settings-API.html?q=frame sett
     
    Ruchir likes this.