Search Unity

Question Workflow to create proper lights sorce in HDRP

Discussion in 'High Definition Render Pipeline' started by seoyeon222222, Feb 21, 2023.

  1. seoyeon222222

    seoyeon222222

    Joined:
    Nov 18, 2020
    Posts:
    187
    I like the physically-correct way concept, one of the motto of HDRP.

    Real brightness and temperature of the sun could be the reference point for Directional Light
    Exposure, brightness of various lights, was also able to use the lighting information in real world.
    Of course I'm not perfect, but I think it's a good starting point and it seems to work well :)

    HDRP Demos, videos and many documents created by Pierre Yves Donzallaz
    (https://pydonzallaz.wordpress.com/)
    These have been very helpful in setting many reference points (Thanks!)

    But I'm still afraid of using light. :(

    I have a few difficulties finding a reference point.
    There are two main questions.
    - How do I make the good light source?
    (How to choice appropriate Light type / shape / range)
    - Is it okay to use very large fake point lights?
    (To light up the space, Is this method commonly used? Is there no problem with the performance?)

    for example, I'll make this lamp.
    This is the lamp included in the HDRP demo.
    upload_2023-2-21_9-12-9.png

    It is a combination of point and spot lights.
    Perhaps the brightness and color of the lights can be set as a starting point through similar real light products.

    But how can I determine the good range outer/inner angle and Radius?

    upload_2023-2-21_9-34-2.png

    this light created using Emissive Lit material.
    Do I have to use Mesh because it's a curved light?

    upload_2023-2-21_10-8-58.png
    (Red Dead Redemption 2)

    upload_2023-2-21_9-44-6.png
    (Cyberpunk 2077)
    There are various kinds of light sources in the game.
    It's hard to figure out how to start making the various light sources
    Is it best to just focus on creating a good feeling by relying on the artist's sense?
    Is there any indicator that can be used as a reference like other factors?

    My aim is not to build a physically perfect interior environment.
    I understand that physical perfection is not necessarily the answer in a game.
    My purpose is to create a good quality game that works in meaningful performance.

    It might be a question that doesn't always have the right answer,
    I want to know the minimum standards for when, what type, and how much range should be set.

    upload_2023-2-21_10-11-26.png

    When I make a light source,
    I'm worried if this is wrong lighting....


    +
    https://pydonzallaz.files.wordpress.com/2019/02/create-high-quality-light-fixtures-in-unity.pdf
    I also read this guide document.
    I also tried the IES Profile provided by the lighting manufacturer,
    which, as the document explains, was not enough.
    Is it really necessary to do additional work using 3d max or separate software?


    Any advice would be appreciated!
     
  2. akent99

    akent99

    Joined:
    Jan 14, 2018
    Posts:
    588
    I am *NOT* a lighting expert. As a novice, what I have found is "avoid the temptation to crank numbers outside realistic ranges because all lights need to be consistent strength ranges for the overall scene to work". So its not just light strength, but exposure etc as well.

    With respect to shapes, I think that is mainly artistic choice. However there are technical implications.
    • You need to check the version of Unity and the render pipeline - e.g. some versions of HDRP don't support all light types.
    • Emission I think is the easiest way (if supported in your pipeline version) for doing unusual shapes)
    • Point lights are more expensive - they are like 6 spot lights (pointing towards each face of a cube)
    • AreaLight can be a useful light for soft patches of lighting - I now often have lights in the ceiling plus a big area light over the whole ceiling in a room as an alternative to using ray tracing with bounce lighting. But beware of it going through the walls.
    • Be careful of very long range lights - there are limits to the number of lights in things like shadow processing. If you get too many overlapping lights, shadows can start being unreliable and flicker.
    • Ground tint is another way to light an overall scene
    I have been adding my own learnings as I go to a blog post, although somethings have changed since with newer versions of HDRP etc. https://extra-ordinary.tv/2022/09/25/lighting-tricks-in-unity-hdrp-for-cinematic-effect/
     
    seoyeon222222 and ElevenGame like this.
  3. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Very good question, I'm also interested in this one.
    I know just the guy for this question.
    @pierred_unity - bless us with your knowledge please
    It's been a while since I've seen you in the HDRP forums, dearly missed :D
     
    seoyeon222222 likes this.
  4. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    Most of what you've asked you've already solved but I think you've questioned yourself on whether you can "break the norm"

    This should be treated in A case by case ( or rather project by project) determined by how accurate you need to be with things.

    Unity does two things, simulates and emulates, in lighting cases it's still emulating light fall rather than simulating it with absolute accuracy. So theirs plenty of room to balance your scene for creative aspects like gameplay and design goals. So striking a balance between you Physically based numbers and design goals is the main goal.

    You've already mentioned much of what's required
    IES profiles
    Physically based numbers
    Temperature
    Etc
    Shape and the modelling matters too as well since a lamp shade for example will throw light different, this is where is profiles help and manufacturers information.

    This also helps with shape too, many lights on product pages and technical docs state what the angle throw is. The inner throw is mostly dependant of the lights use case and shape/technology involved, tactical lights for example have a fixed or adjustable beam angle, they're actually not particularly bright, but focusing the beam able consolidates all that light energy making it brighter.

    (How to choice appropriate Light type / shape / range)
    - Is it okay to use very large fake point light?
    (To light up the space, Is this method commonly used? Is there no problem with the performance?)



    Absolutely no problem making a large light but you need to consider what you consider "fake" fake lighting values if your project is strict on that, probably not, fake in terms of size, seemingly fine. If you took an LED array of lights that equates a bigger over all light value, then it makes sense you can represent that with an area light instead of an large area of tiny lights ( for performance sake)

    if you look at vehicle showcases for example the diffused area lights that are used, are big and are pretty bright too, they're still led arrays with a soft box ( or tubing if they're being creative in the shot)

    Regardless, you can still look up specs for these kind of real world LED arrays too.

    Similar, HDRP uses the inverse square law for lights fall off calculations, so you can even get a better idea of where to place your light according to the fall off you wish to achieve.
    Unity even provides a showroom demo IIRC, this is a very high quality scan and scale, might be worth diving into their lighting there and seeing where physically based Vs look based decisions may have been applied.

    Hope that helps some more.
     
    seoyeon222222 likes this.
  5. seoyeon222222

    seoyeon222222

    Joined:
    Nov 18, 2020
    Posts:
    187

    I was worried that something might have happened to him because he disappeared for a while.
    Fortunately, I saw him on the forum yesterday! I'm glad he's back
    I know he's very busy, But I'd be very happy if he gave advice.

    @pierred_unity
    Can I ask for advice on the principles and processes for making good lights?
    Or,
    Examples of light types that are commonly used in games, clone them would also be helpful. :)

    - How do I make the good light source?
    (How to choice appropriate Light type / shape / range)
    - Is it okay to use very large fake lights?


    +
    Here's a more detailed example of my second question.
    upload_2023-3-29_6-40-20.png



    upload_2023-3-29_6-42-4.png

    It's the middle of the day when the sun shines strongly.
    Use Center weighted Auto Exposure

    It's too dark where the light doesn't reach.
    I don't know if it's normal to look like because it's actually physically correct

    I'm trying to make the area too dark to look bright.
    It was difficult to solve the problem just by adjusting the exposure.
    A slight change will cause the bright area to white out, or the dark area to turn too black.

    Should I place fake lights in these situation?
    In this case, how is it the right approach to solve the problem?
     
  6. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Hey, I'm still here. Thank you for worrying. ;)

    I don't really know how you generated the indirect lighting in your scene (lightmaps? lightprobes? indirect lighting controller hack?), but I can give you a few points to investigate why it's too dark:
    1. Maybe your materials are not PBR and your (albedo) textures are too dark
    2. The indirect multiplier on the Sun light is lower than 1
    3. The indirect lighting controller (volume system) is lower than 1
    4. The Ambient mode in the visual environment is not set correctly (such as "Static", but without a profile set in your "Environment" tab in the Lighting Window)
    5. The Lightmapper (in the Lighting Window) doesn't have enough bounces or has a low albedo/indirect multiplier
    6. The exposure value is too high, and the scene is underexposed as a result: you seem to be exposing for the highlights, hence the shadowed areas are very dark. Lowering the exposure value could help.
    7. You could be using ACES tonemapping. ACES has a more filmic look and will crush dark tones in your frame when underexposed.
      1. You might not use any color grading on top of ACES. For instance, you could use "lift gamma gain" or "shadow midtones highlight" post-processing effects to lift your shadows. ACES often requires some shadow lifting, especially for dark scenarios.
      2. And if you decided to raise the overall exposure (point 6.), you can reduce the gamma or gain (in the "lift gamma gain" postfx to restore the burnt/overexposed areas)
    8. You can use another tonemapping, either Neutral, Custom, or your own LUT to restore shadow details.
    So, the points above are the things you can do if you want to be as "correct" as possible, while not messing around with the lighting itself and staying as much PBR as possible. Then, you can take artistic liberties:
    1. You can place fake bounce/fill lights to brighten certain areas or enhance the lighting locally. If you mark them as "Baked" (for instance baked area lights, handy to cover large areas uniformly), they won't cost anything at runtime. But this can be problematic if you have a dynamic time of day, and it will be problematic if you want to have them set as real time (performance cost may increase significantly).
    2. Increase the indirect multiplier on your lights above 1
    3. Reduce the sun intensity massively, and go down the non-physically-based route. The lighting range will be lower and the contrast/exposure delta could be easier to handle.
    Your scenario, with a top down light, is actually very similar to the Sponza scene I used for this tutorial:


    And as you can see, there is no problem getting sufficient ambient lighting in that space. So, it could be a setup issue on your end. ;)
     
    mikeohc and jiraphatK like this.
  7. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,667
    Thank you for sharing this link, i did not know about it, is always good to learn from @pierred_unity
    I'm watching this thread
     
  8. seoyeon222222

    seoyeon222222

    Joined:
    Nov 18, 2020
    Posts:
    187


    Thank you for your detailed and kind reply!!
    There are some information that I didn't know about the nature of ACES. It was helpful!
    I checked the points you advised one by one.
    Most of the points in the front were fine.

    As for Exposure, it doesn't seem to work out as intended.
    I reduced the Limit Min to make the dark space more visible.
    Then the bright space begins to white out. :(
    "Lift gamma gain, shadow midtones highlight" seems to work. :D
    I'll take the time to adjust the lift gamma gain, shadow midtones highlight, exposure little more and explore Sponza again.

    +
    Can I also ask for advice about the first question?
    (https://forum.unity.com/threads/workflow-to-create-proper-lights-sorce-in-hdrp.1402621/)
    (How to choice appropriate Light type / shape / range)
    Do I have to rely solely on the senses of the artist?
    It sounds too basic, but I think everyone who actually tries to make it for the first time will be having a hard time.

    I've also compared the light sources of several other projects offered by Unity, or the lighting of others on sale in the Asset Store. (ex SpaceShip Demo, Test Track, Cinemachine, VFX Demo etc..)
    Surprisingly, I've seen cases where lights that look like similar types are made in so different ways (type, range, shape, etc.).

    I'm at a loss how to make these things up.:(
     
  9. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    769
    Hi, I think soft shadows and specular shapes are the major differences between lights.

    Small light source: consider spot lights (any shape) first, then point lights.

    Large light source: consider rectangle area lights first, then tube lights (no shadows support)

    Real-time lights only provide direct lighting (imagine that light bounce off objects and stops), so global illumination (+ reflection as indirect specular) is needed to make the scene look better.

    Last but not least, emission as the only / major light source is not recommended. Emissive objects are not lights and can only light up the scene after considering global illumination (real-time / baked) and indirect specular (reflection). They can be either lacking real-time interactions (baking lightmap) or losing detailed shadows (SSGI with strong denoising).

    I assume that you are talking about the (affecting) range of point lights, not the size of it.

    Yes, but unless you need a larger point light range, it's better to keep it low. (better for light culling & shadow map rendering)
     
    seoyeon222222 likes this.
  10. pierred_unity

    pierred_unity

    Unity Technologies

    Joined:
    May 25, 2018
    Posts:
    433
    Regarding light sources, the reason they are so different each time is because it's a very artistic process and an optimization process: some areas were picked to have a stronger illumination (= stronger intensity, and potentially longer range to increase the area of influence).

    In games or scenarios requiring as much performance as possible, the job of a lighting artist will be to minimise the number of lights and their range. Sometimes one large spotlight casting shadows will be more advisable than several small spotlights for instance, and sometimes a few spotlights will be more advisable than 1 point light. It's a very ad-hoc process, especially when it comes to shadows and light fade distances.

    At the end of the day, for games at least, you'll need to find a compromise between the number of lights, their range, their shadowing, and the visual quality, regardless of the engine.

    Then for light fixtures, this might be a good read:
    https://blog.unity.com/technology/create-high-quality-light-fixtures-in-unity

    upload_2023-3-29_20-16-29.png
    upload_2023-3-29_20-17-19.png

    If someone is doing lighting for the first time, they might just want to light the scene with light prefabs, with relatively large range, and then start to fine tune (= local prefab overrides) for performance and artistic/narrative impact.

    If you look at the HDRP Scene sample (via the hub), it shouldn't look "messy", most of the scene is lit with 3 or 4 light prefabs with very few prefab overrides.
     
    Last edited: Mar 30, 2023
    seoyeon222222 likes this.