HDRP: tile/cluster lights rendering bug

Hello, Unity team!

There is a problem with spot light in HDRP. Steps to reproduce:

  • get default HDRP scene
  • add multiple (40-80) light sources, to achieve well visible result.
  • no shadows, no AO, no volumetrics - just simple spot light, default HDRP settings

There is noticeable flickering, in shape of squares. Size of it squares equals size of lighting tiles, displayed when “render pipeline debug” → “lighting” → “tile/cluster debug” option enabled. Seems strange that each tile contains 24 or less lights (maybe that is cause of problem - we have ~80 light, but only 24 of them affects tile).
Maybe, some settings can be changed to avoid problem - cannot found something like “tile lights list maximum size”.

Thanks in advance!

Look inside the asset for hdrp, you will find the max lights for each type.

Default settings in “Lighting” section are:
Maximum Directional on Screen: 16
Maximum Punctual on Screen: 512
Maximum Area on Screen: 64

Changing these values does not affect the problem described (also, there are no “24” anywhere).

This is a hardcoded value, made like this for optimisation purpose. See here : https://github.com/Unity-Technologies/ScriptableRenderPipeline/blob/master/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs (line 90).
Technicaly you could change it, but I haven’t tested personally, and I wouldn’t suggest it.

If you’re hitting this limit, I suggest you think again how you light your scene to have similar look but with less lights.

2 Likes

Hi,

currently the limit of light per tile (8x8) is restrict to 24. This is hard coded and can’t be change. (i.e this is not a single number to change, the code is optimize for a uint (so technically this could be increase with a bit of work to 31).

so sadly, currently your scenario don’t work in HDPR… The question is do you have a real scenario where this is required or was it just a stress test? Reaching such amount of light per tile is very expensive for a game.

1 Like

Our case - rendering cinematic video (using HDRP + Recorder). So, we are not limited in FPS so much, and there are really many light sources.

Hi,

I had the same problem with the HDRP and area lights. I was able to fix it reducing the RANGE of the lights. They were Overlaping.

1 Like

Will HDRP 14 allow rendering more than 24 light per tile ? Is this commit an upgrade for this?

This was actually backported to 2021.2, so you can already pass the previous 24 light limit.
I think it’s in the latest 2021.2 patch, if not, it’ll be coming soon.

Is it possible to double the amount of lights per tile to 128 lights in HDRP 15?

Not, the limit is still 63.
If you’re using more lights than this per tile, maybe rethink how you did your lighting and use baked lighting.

If you want to exceed the limit and don’t care about performances (movie rendering), you can force disable “Deferred Tile” in the frame settings : https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@15.0/manual/Frame-Settings.html#light-loop-debug .

1 Like