Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

How to add more than 4 Point Lights on the HDPipeline?

Discussion in 'Graphics Experimental Previews' started by DanielGuirelli, May 29, 2018.

  1. DanielGuirelli

    DanielGuirelli

    Joined:
    May 29, 2018
    Posts:
    5
    Hi, I'm new to the HDPipeline, and been having some troubles with point lights. If I add more than 4 the shadows only work properly for 4 of them, the other lights the shadows are screwed up.

    Is there a way to increase the amount of Point lights you have on the scene like the older versions of unity?

    Thank you.
     
  2. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    703
    Have a look at this message : https://forum.unity.com/threads/hd-pipeline-limited-shadows.530315/#post-3507240

    You can have up to 6 point lights with shadows, if they are set to realtime. If they are set to mixed mode and overlap, they are limited to 4 realtime shadow, and the rest fallback to baked (because there is a limit of 4 baked shadowmasks overlap), so they won't lit non static objects. This is maybe what you are seeing.
     
  3. DanielGuirelli

    DanielGuirelli

    Joined:
    May 29, 2018
    Posts:
    5
    I see, I wish in later versions there's a way to change that amount. Thank you for the answer.
     
  4. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    There will be for realtime lights. Shadowmasked mixed lights will stay capped at four as we're using a texture and encode each light into one of the available RGBA channels.
     
  5. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    uy3d, I am slightly confused with the numbers, when we say 4 or 6, are we talking about 4 lights that can be overlapped or 4 lights total in one given scene?
     
  6. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    There are two rules you need to be aware of:

    4 overlapping mixed lights in the case of shadowmasks, as explained here:
    https://docs.unity3d.com/Manual/LightMode-Mixed-Shadowmask.html

    6 shadowed visible lights on screen mixed/realtime. You can set all your realtime lights to shadowed in the scene, but the engine will only provide up to 6 of them with shadows. Which 6 are chosen is decided on a per frame basis.
     
  7. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I've just been looking at the stuff thats been added on github in the last few days, and I see 'Expose shadow budget parameter in HDRP' which I believe is this, coming to life before our eyes :)
     
  8. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    This is indeed in the 2.0.4 version that is available in the package manager. Settings added to the shadow section of HD Render Pipeline Asset.

    ShadowBudget.png