Search Unity

HDRP Issues - Tile/Cluster Hard Limit and Reflection Probes

Discussion in 'High Definition Render Pipeline' started by MattForeman-PixelFarm, Dec 19, 2019.

  1. MattForeman-PixelFarm

    MattForeman-PixelFarm

    Joined:
    Dec 19, 2019
    Posts:
    15
    I'm using HDRP 7.1.7 and Unity 2019.3.0f3 for pre-visualization purposes. I'm encountering two issues that are absolutely hindering my progress:

    1. The hard-coded tile/cluster limit of 24 lights per tile.

    I'm using 100 realtime spot lights (yes this is absolutely necessary in my case for previs purposes) and this causes weird flickering pixelated artifacts to appear across the screen because of so many lights overlapping:

    Light Tile Limit Artifacts.jpg

    Is there any way around this? Can I turn off tile/cluster? I saw that someone was able to do this using HDRP in Unity 2018.1.0b11 but I can't find the checkbox to disable tile and cluster in the latest version of Unity and HDRP.

    Here are some additional threads where people had the same issue as myself:
    https://forum.unity.com/threads/hdrp-weird-pixelated-lighting-bug.705785/
    https://forum.unity.com/threads/hdrp-box-artifact-with-many-lights.723179/

    2. When using reflection probes, I can't set the resolution of individual reflection probes like I can in Universal Render Pipeline.

    In Universal Render Pipeline I have individual control over the resolution of reflection probes. I need this level of control because I am pre-visualizing mirrored objects and I need to crank up the resolution for one reflection probe in front of the mirror. In HDRP the reflection probe resolution appears to be a global setting in the HD Render Pipeline Asset, and it gives me an error once I crank it past 512:

    HDRP Reflection Probe Error.jpg

    In the Universal Render Pipeline I can set the resolution of every individual reflection probe, and there is no issue even when going up to 2048 resolution for the same amount of reflection probes. It's as if going to HDRP is a downgrade in terms of reflection probes (besides lack of box projection in URP). How can I achieve the same level of control for reflection probes in HRDP that I can in URP?
     
    keeponshading likes this.
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi,
    You can disable the tile/cluster system with limit of 24 light per tile in the FrameSettings -> LightLoop Debug and uncheck "Deferred Tile"
    https://docs.unity3d.com/Packages/c...igh-definition@7.1/manual/Frame-Settings.html

    Warning: Switch this option can decrease performance a lot.

    Regarding the control of individual reflection probe resolution it is not possible in HDRP currently.
    HDRP use TextureArray to send all reflection probe to lighting system which constrain all reflection probe to have the same size.
    URP use a totally different system that isn't compatible with HDRP architecture thus why it behave differently.

    To solve this on HDRP side, it require to switch to a texture atlas instead of a texture array. This have pros and cons, few pros being: more distortion in cubemap, more memory for equivalent resolution and more alu to handle filtering. We haven't done this work and not planning to do it short term.
     
    Lex4art likes this.
  3. MattForeman-PixelFarm

    MattForeman-PixelFarm

    Joined:
    Dec 19, 2019
    Posts:
    15
    @SebLagarde thank you for the explanations. It's not really what I wanted to hear, but at least I know that's how things are...

    I was able to get rid of the pixelation artifacts (see below), but at a great performance cost like you mentioned. This is a VR previs project using HDRP, and with "Deferred Tile" turned off I'm getting about 25 fps with 109 real-time spotlights and 5 real-time point lights in the scene. This frame rate is obviously not very usable for VR previs.

    Light Tile Limit Artifacts FIXED.jpg

    This is meant to test what Unity can do, and ultimately it's a shame that Unity can't really be used for smooth real-time previs in my case due to the crawling frame rate.

    Any thoughts on how this could be achieved in Universal Render Pipeline, or am I simply out of luck? It seems like URP has some limits for how many real-time lights are rendered in the scene at once? Can this be changed?
     
  4. laurent-h

    laurent-h

    Joined:
    Sep 29, 2016
    Posts:
    78
    Hi,
    I am not sure any render pipeline can give you satisfying framerate with this number of lights, especially if they all affect the entire screen all the time.
    - Narrowing the lights ranges so that they don't overlap as much would help
    - Baking some of these lights in lightmaps would help a lot too. You can bake some lights entirely or bake the indirect/bounced lighting only using the "Mixed" light mode which might help you reach these visuals with fewer lights.
     
    iamarugin likes this.
  5. MattForeman-PixelFarm

    MattForeman-PixelFarm

    Joined:
    Dec 19, 2019
    Posts:
    15
    Thank you for your reply, but unfortunately none of this is possible because this is for previsualization purposes and all of the lights move and could overlap with each other at once. :(
     
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    There probably actually hundreds of ways to achieve a similar visual, from decals to cookies, but these aren't going to correctly shade the object in a physical manner, just colour pixels in.

    So you will need to change to builtin renderer or consider splitting the job up a bit.

    Some more hacks:
    • could loop through 64 vertex point lights in the shader, for your own previs lights
    • write/read from a custom cubemap for IBL (popular in xbox 360 era)
    I understand the need for maximum flexibility with previs but it's really not going to give a good visual now or ever, affecting a tiny tile with 24 lights. So having control over how much distance these lights have should just become part of the previs process. You'd need a lot less of them if you had a shader-based set of fill lights or such as outlined in the first bullet point.

    I suppose a question to ask is - how close to ground truth PBR do you want to go for previs?
     
    soleron likes this.
  7. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    580
    You are testing it wrong. ;)
    Try to work in the way Unity works and not how you expect it to work.
    In engines you can achieve the same results without 109 lights.

    Probably URP is not going to help you.

    From what I see your scene is not even close to being realistic in terms of content.
    Use Emissive Materials instead of lights. Bake them. Use light probes. etc. etc.

    Use practical lights ONLY where it makes sense and is truly absolutely necessary. If you are coming from off-line rendering visualization background, start thinking in more simple and creative ways that the brute force mentality of VRay etc. Game engines can achieve very similar results with much less effort in the lighting and rendering stage.

    i.e. if you want lights moving like a disco, maybe have a look at projections with cookies or using decals.



    or

     
    Last edited: Jan 11, 2020
    Lex4art and hippocoder like this.
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Perhaps you missed the fact he can't bake anything? It's realtime, typically in an office or on site with clients.

    An option for previs is just to do it all with decals. It works, it's unlimited but not accurate. So you could use decals for most of the job and 24 real lights to adjust shading.
     
  9. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,728
    If he can get away with not using shadows, wouldn't the built-in Deferred renderer be much faster?

    The shaders would be a clear step down over HDRP, but he could shop around for better ones (Uber? Alloy?)
     
    hippocoder likes this.
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    And some lights can still do shadows, so the general thinking is for previs, you don't need to do it 100% accurate just do a rough sketch for the client basically in 3D.

    Universal Pipeline is actually getting deferred so it may be worth the OP's time to get an early version of that from Unity. I don't see any reason for Unity refusing the request (YMMV etc)
     
  11. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    580
    I did miss it, that is why I later edited suggesting he should try using decals and cookies.

    I do not believe that there is absolute need to keep everything live. Especially that many lights. It usually is people who come with ArchViz and offline VFX rendering that have this notion. You can always bake the base lighting and fake the rest.

    i.e. setting up animated cookies you can fake multiple moving lights while using just a few.
     
    hippocoder likes this.
  12. MattForeman-PixelFarm

    MattForeman-PixelFarm

    Joined:
    Dec 19, 2019
    Posts:
    15
    Thanks for the suggestions! Indeed it looks like I will have to explore alternatives to Unity's built-in lighting system.

    Decals might be a good thing to try out next if I can get things looking good enough, even if it's not photo-realistic.

    I could get by without shadows, but the built-in deferred renderer doesn't actually seem to increase performance for some reason...

    Any suggestions where I can do more research on this method? Or any existing examples you're aware of? Do the examples you've posted use this method at all?
     
  13. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi,

    There isn't silver bullet for your case here.
    With hundreds of light, both URP and Built-in Render will have very poor performance, only HDRP in Unity currently can support such a case.
    We have indeed chose an algorithm targeting game with a limit of 24 light per tile - This algorithm is based on the GPU Pro 7 tile renderer presented by Morten Mikklesen and optimize for console (XBoxOne / PS4). Others engine may not have this limitation with other pros and cons. This is something that we are discussing internal and may change in the future to at least allow non game to unlock such limit (no ETA).
    However, even without this limit, throwing hundreds of lights, moving, with large bounding volume in VR will never give you a good framerate, whatever the engine.
    Deferred / Tile/cluster approach of all kind is based on the fact that it is a lot of small bounds light. None of the real time technique develop will support well large bounds lights as it will always affect everything anyway.

    Like others people in this thread, only alternative is faking light with unlit emissive quad / mesh, cookie etc...
     
  14. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    580
    Unity HDRP is your best bet for more heavy duty super advanced quality features and complex shaders using a node based approach.

    The old standard rendering is perfect for asset compatibility and great balance between performance and quality.

    Usually searching forums and the web helps when you are looking for specific methods to do things with Unity.
    This forum has a couple of such threads already (how to animate cookies that is).
    YouTube may also have such, and you can always ask in the official Unity Discord too.

    Here's a tutorial about cookies i found on youtube. It's a decent starting point.
     
    MattForeman-PixelFarm likes this.
  15. MattForeman-PixelFarm

    MattForeman-PixelFarm

    Joined:
    Dec 19, 2019
    Posts:
    15
    Thank you very much for the explanation @SebLagarde, and thank you for pointing me to the cookies tutorial @soleron!

    I'll have to find the best compromise in terms of performance for my specific case.