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

HDRP Box artifact with many lights

Discussion in 'Graphics Experimental Previews' started by McDev02, Aug 6, 2019.

  1. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    664
    I see these artifacts when I have many lights (more than 24) in my scene or rather when many lights light up the same areas. I disabled all shadows but that didn't change anything.

    Weirdly, when I move some lights away in the editor and then undo, then the artifact disappears and everything is lit. Once I then start the game or disable and enable some light sources the artifacts come back.

    So is this a bug or will there be a limit of light sources per pixel? I know this is some hybrid deferred/forward rendering but I don't know the details.
    This is 2019.2.0f1 and I used the HDRP example project as a starting point.
     

    Attached Files:

  2. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    703
    You just encountered the hard limit of 24 lights per tile. I suggest that you think again how you did light up your scene and try to optimize it.
     
    McDev02 likes this.
  3. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    664
    Alright, I currently do tests to find these limits to see if the pipeline suits my needs.
    Here I have cars with two light sources and they have a long-range (60). But I can already think of some improvements for further away and higher number of cars like using only one light source with cookies and reducing their range.
    I just have to figure out if I need a true deferred renderer (default pipeline) or not.
     
  4. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Sooo this limitation also applies to the Deferred?

    This doesn't make much sense. In cases where most of the light sources are baked, this just prevents visibility of what's going on in the editor / scene view.

    How big the tile is anyways?

    Any future changes to this?
     
  5. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    703
    Yes, it is the same limitation in deferred (tile) and forward (cluster). Tiles as 8x8 px iirc, and clusters 16x16x"whatever it makes them a cube in view space".

    I don't see your point with the baked lights, those will not be in those counts, as they are not realtime.

    We don't plan to change this, but if you absolutely need it, it's possible to disable the limitation in the frame settings by disabling the "Deferred Tile" toggle in the "Light Loop Debug" section, with the cost of decreased performances.
    upload_2020-3-30_19-11-11.png

    Other option is to edit the renderloop code yourself to increase the limit.
     
    xVergilx likes this.
  6. varsac2

    varsac2

    Joined:
    Jul 27, 2020
    Posts:
    2
    I've been having the same problem because in my scene there are 400 plus realtime lights in a single room and its impossible to avoid overlaps without compromising on lighting accuracy, which is key for the project. I'm using the HDRP and I am interested in significantly increasing the 24 lights per tile limit. Are there any suggestions on how I could edit the renderloop code to change that limit?