Search Unity

Is any way to force HDRP to use cluster lighting instead of tiles in deferred mode?

Discussion in 'High Definition Render Pipeline' started by BattleAngelAlita, Sep 23, 2020.

  1. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    Is any way to force HDRP to use cluster lighting instead of tiles in deferred mode?
     
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi, this is not supported currently. Deferred only support fptl.
    Could you provide reasons for such request? I suppose you are aiming to avoid the fptl build light list at all? But in this case what you will win can be easily loss by wrong positive of cluster.
     
  3. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    Tiled lighting is fine for short-range, 2D or shooter like environment. But my game have a long highways, so 32 lights that avaible for 1 tile is immediately get fully saturated. But according debug view, it's just 4-8 lights per cluster. And i personally prefer clusters or XZ tiles, instead of XY tiles.
     
  4. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Alright, so correct me if I am wrong but then you problem isn't being tile or cluster, your problem is the maximum limit of 24 light that we have per tile. As chose of tile vs cluster shouldn't be based on preference but on performance (and isn't related to being a 2D shooter, 3D game benefit a lot of tile tested against depth buffer for opaque material).

    What we usually do in game for long highways is to use light lod. Far lights are replace by emissive cards to save performance. And thus you usually don't end with such amount of light in a tile. More than 24 light per tile should be a warning that you can get performance issue.

    If you still want to get more than 24 light per tile, then In HDRP right now there is only two way to solve your problem:
    - change to forward lit mode and uncheck the enable FPTL in lightloop debug , thus you will be full forward cluster (but performance maybe affected)
    - Disable tile mode in light loop debug (i.e dont' use tiled/cluster lighting at all), but if you have a lot of light, it will be a huge performance overhead), all depends you context.

    https://docs.unity3d.com/Packages/c...igh-definition@6.5/manual/Frame-Settings.html Lightloop section
     
  5. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    Classic.
    Multiplayer racing game, 16 cars, 2 light per car(maybe more). Players gathered in one place. Voila - disco of flickering lights in the middle of the screen.
     
    JoNax97 likes this.
  6. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi,
    Note that it is 24 light per tile, not on screen.
    But I can see what kind of issues you have. Good point. Sadly as explain above we can't go above this limit for now. Changing this limit is not trivial at all. There is work on this but it will come only in 2021 version.

    I don't think Cluster can help here, but you can still try it by moving Lit shader mode to full forward (and disable area light in shaderConfig.cs/hlsl to save performance).
     
  7. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    Is there more tight restrictions on xbox/ps? Don't have a devkit, but guys i working with says that on consoles all screen is covered with small black squares, mainly where light/ground intersects.
     
  8. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Normally, head lights of cars use only one light source. The shape is faked with a light cookie. So you should not wasting to light sources for a car.

    For a night time street scenario: The lights are normally faked with billboards of emissive lens flares. This technique is heavily used in GTA V.
     
    mowax74 likes this.
  9. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    In the times of HD4k8k, nex-nex-gen consoles, and 30tflops hardware we still need to use 25 years old fake tricks? No, thanks. This is not a problem of performance, this is a problem of tech that used in HDRP.
     
    AcidArrow likes this.
  10. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    It's just not always about performence. For example caustics are not there yet, yes even after 25 years, so you can display better details and realism by baking your lamps and use cookies. You won't get these caustics and fine shadows in a real time renderer. RTX is not there yet nor everybody has it. For the lamps in the distance: Why using a real light if a normal player would not see the difference when the light is a small spot, so it is either a billboard or a real light source? If your game has so many resources left just for graphics, you can go the real time way but I think you could spend the resources in other areas better. It's about the ratio of costs and benefits. Even the manual of Unreal states to use a few light source as possible and faking car head lights. I'm not against another lighting mode for different scenarios, in fact HDRP needs to be improved in many fields but I'm just saying there are other ways to achieve the desired effects.
     
    mowax74 likes this.
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    Faking stuff has developer cost, it takes up my time, so I don’t understand what your “you can fake it” argument is about.
     
  12. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    And processing things in real time has cost for the consumer and the fps. So what?
    If you already have the machine in order to try many real time lights, than you can also do a render for a light cookie. Setting up billboards is also not so much work. You would already need billboards for other LODs.
    And if the studio cannot afford the costs, it maybe should drop some high quality visuals or a map scenario that needs so much light sources? Many developers think, when they drop some spot lights or point lights, they created stunning lighting. But it's not. Many games actually miss the opportunity of creating better and rich lighting with light cookies.* Just because you could do everything in real time does not mean it's worth it or better. It depends highly on the free resources and the studio which I don't know. You can take the recommendations of faking strategies like everyone is using, even AAA or try real time techniques. Your choice.

    *Nice guide from Unity: https://blogs.unity3d.com/2019/02/05/create-high-quality-light-fixtures-in-unity/
     
  13. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    Nice platitudes. I should be able to choose which parts I want to spend resources on and which parts I want to have processed at real-time.

    Unfortunately Unity has made a lot of these decisions for me, most of which I disagree with.
     
  14. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    You are free to choose the lighting techniques and the engine that fits the budget and needs. :)
     
  15. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    Yes, to overcome this light issues i do fake stuff, projectors instead of lights, billboards, reduce angle for spot lights, manual light culling. But still... HDRP is pretended to be "modern, hi quality, cinematic, mind blowing graphics, buzz, buzz, etc" but have this basic lighting problem.
     
  16. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    I don't think AAA titles do anything so much different. Any big map with a lot of light sources will use at some extend faking strategies for distance lighting and cull / fade out lights. Why processing things which are so small in the distance or not the main point of interest? Your scenario perfectly would fit for the techniques GTA V is doing (many car lights, many street lamps). Nevertheless it's not an excuse that Unity needs to be improved regarding the lighting performence and features. :)

    http://www.adriancourreges.com/blog/2015/11/02/gta-v-graphics-study-part-2/
     
    Last edited: Oct 27, 2020
  17. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    GTA V is a 7 year/2 generation old game.
     
  18. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Sure, but GTA 6 and graphics studies for it are not out yet. :)
    Next generations will use the extra power for one or two RTX effects, mostly real time reflections or better shadows. So I don't think there will be room for hundreds of light sources soon. They better spend the power in their physics and amount of animated rigs (people walking around). Distance lights will be always low priority.
     
    Last edited: Oct 27, 2020
    mowax74 likes this.
  19. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    Again, there are techniques that allow for hundreds of lights, new and old alike.
     
  20. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Than use the engine which allows doing so?
     
    mowax74 likes this.
  21. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    If I currently had the choice to not use Unity I would not be using Unity.

    Unless of course you're willing to port for us all the work we've done in Unity for our project in the last.... 5+ years or so.

    Otherwise, I have no use for your "if you don't like it then leave" attitude.
     
  22. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    Light cookies cannot fake the specular reflection of two headlights, which is the most distinctive visual cue at a distance, unless you do something like billboard reflections.
     
  23. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    If you have no use for switching the engine and neither trying out alternatives way of lighting, then there is really no other options to solve this. Unless you want to wait another five years for Unity doing some updates.
     
  24. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    I will work my way around Unity's features and bugs. I've been doing it for years.

    My point is that complaining about Unity's shortcomings is valid and "use another engine" is not an appropriate retort.
     
  25. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Sure you can complain, but it won't help you with your game. New features develop very slow if they even come.
     
  26. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    I see you have the SRP Life icon. Isn't that a form of complaining? Why are you doing that if it's not going to help you with your game? (you know whatever structural changes they make to SRP in general are at least a couple of years away, right?) If you're not happy with SRPs, you can use another engine that fits your needs better.
     
    lilacsky824 and Ruchir like this.
  27. HandsomelessKing

    HandsomelessKing

    Joined:
    Jul 1, 2021
    Posts:
    6
    Thank you so much, i tried out the forward Rendering one and it worked, yeah the fps changed from ~100 to ~110 (i have no idea how it went up), but thank you
     
  28. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    What I don't get from time to time is that when people start to ask and complain about technical decisions that Unity devs make, there is always another person just chiming in to say "then don't use Unity".

    We should really stop doing this.

    I don't know why I have to convince my fellow customers to engage in technical discussion about a product I am paying for. If you disagree, then disagree, if you have other opinions then provide it. But we should really stop playing "Here comes the calvary!" anymore. I mean, you do realize that there is no bad guy here. In fact, you are not doing anything at all other than just adding more noise to an open forum.

    Please we got to stop doing this as a community.
     
    azmi_unity, pwka and Ruchir like this.
  29. mowax74

    mowax74

    Joined:
    Mar 3, 2015
    Posts:
    97
    Exactly THIS! Even in 2024. Realtime graphics is still and will be at least for the next decade all about good faking!

    What do people expect what they can render in 16ms?

    Who uses realtime lights for a distant car light or street light and really thinks that is the way to go will never make a great game, because when your attitude is to waste the limited resources that way, you always will have less resources left for more details and richer scenes than the guys who keep care on their resources and are able do deliver good and believable fakes.
     
  30. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,796
    I mean, if you use deferred and disable shadows, it is very viable to actually use a light. Here is a Unity blog post 14 years ago about the ability to render a lot of lights without extra cost : https://blog.unity.com/technology/unity-3-feature-preview-deferred-rendering

    Yes gamedev is all about faking, but the things we need to fake change with time and then there are choices to be made on what to fake and what not, both because some may be more work than you have time for, or before not faking something makes a difference in your game.

    So the answer to "You can fake it" when someone complaints about a feature not working well enough, is "Well, DUH".

    Finally, nice necro.