Search Unity

point light becomes WAY too bright when I switch to URP

Discussion in 'Universal Render Pipeline' started by luvcraft, Nov 15, 2019.

  1. luvcraft

    luvcraft

    Joined:
    Aug 22, 2011
    Posts:
    76
    I'm working on a game where the player explores a dark environment, and I've turned off all GI and am using a point light attached to the camera for the player's limited visibility in the dark. The point light has a range of 8 and an intensity of 2, which works great for the legacy render pipeline. Here's a screenshot, and you'll see that the character up close to the camera is well-lit, and the wall further away from the camera is dark but still clearly visible:

    old render pipeline.png

    if I switch to URP, however, with the exact same light setup, the character is totally blown out, while the background is way too dark:
    urp.png

    what can I do to fix this, or is there a different technique that I should be using with URP for the same effect?

    I've tried reducing the base map color of every model from white to gray, which helps a little but not much (and makes distant objects even darker). Likewise, making the point light's color a LOT darker fixes the lighting of the character, but makes the background completely invisible.

    I've also tried switching to global illumination with black fog, but that flat-lights everything instead of giving me the spooky radial lighting that the first screenshot has.
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    I’m confused, why can’t you reduce point light intensity?
     
  3. luvcraft

    luvcraft

    Joined:
    Aug 22, 2011
    Posts:
    76
    because that makes the distant objects even darker. The tricky part is the balance between the foreground character being well-lit, and the background wall being darker, but still visible. That works great with the legacy render pipeline, but I can't figure out how to get it to work in URP.
     
    Last edited: Nov 15, 2019
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    Well URP is supposed to have more realistic light attenuation, so I don’t think there’s too much you can do.
     
  5. xploreygames

    xploreygames

    Joined:
    Jun 14, 2020
    Posts:
    6
    When I switched over all my materials became WAY too bright as well. What seems to work is switching the color next to specular map (HDR color) from white to black.
     
  6. TheOnlyBete

    TheOnlyBete

    Joined:
    Jul 7, 2015
    Posts:
    2
    This is a real problem and I wish it would get fixed. The same issue is apparent when using a spot light as a torch.

    You either light up absolutely nothing with the spot light, or, if you get an inch too close, the shine on the surface from the spotlight becomes completely white.

    I realise this is similar to how real lights work but firstly, real lights don't create a completely white circle, you can see the surface even through the bright light. Secondly, they also don't go completely white unless you've a really strong light source. So this isn't really even close to how real lights work.

    The only solution I can find, is to not use URP/HDRP. The lighting is really buggy in URP and borderline unusable unless in specific scenarios.
     
  7. chzwhz

    chzwhz

    Joined:
    Jun 24, 2019
    Posts:
    2
    If you can move the light back and increase the intensity, the difference in brightness between the far and closer objects will decrease
     
  8. ChuckzM

    ChuckzM

    Joined:
    Mar 17, 2021
    Posts:
    3
    Was this ever addressed somewhere? I Also have this problem :(
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You sure it's not gamma / lack of tonemapping etc?
     
  10. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    I've posted about this as well. The issue isn't so apparent unless you're using the light source (spot or point) as a flashlight or headlights, where you need a decent range but some objects will be close to the light as well. If you increase the light intensity high enough to get the range you want, things nearby will be pure white and lose detail.

    To help visualize this further - in the left image a point light is disabled. In the middle image, the light is enabled with an intensity of how I want the stone to look for that distance. The right image is when the light gets closer - it's the same intensity as the middle image.. and for something like stone, it's probably fine. But for someone's face, or foliage, or other things with detail you don't want washed out.. it's an issue.

    light_issue.jpg

    The "make everyone happy" solution is custom attenuation curves. This way we can make specific lights fall off however we want (i.e. for a flashlight, maybe it looks good with 20 units of distance at full intensity before it starts falling off). If that's not happening, another solution to this in particular would be if we could specify a distance from the light at which attenuation begins (..as opposed to falling off immediately).. so the effective intensity is what we've specified everywhere from the source out to that distance.
     
    KarlKarl2000, Reahreic and nekowei like this.
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    You could tonemap around that if you really wanted to, and it's pretty realistic.

    Lights in reality aren't ever really so close to another surface, and if they happen to be, things will blow out and you may need to adjust your exposure.
     
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Lights won't do that with a correct linear / hdr configuration and tone mapping, so I think they need to learn a bit more about URP.

    The whole point of PBR to begin with was to address these issues, so you'd be able to make a light setup work without blowing out etc.
     
  13. adammpolak

    adammpolak

    Joined:
    Sep 9, 2018
    Posts:
    450
    Any pointers on how to make this work? There doesn't seem to be any solution to this problem. Directional light seems to make everything white.
     
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You just need tonemapping as a post effect. The purpose of tone mapping is to get values that are out of range, say a blast of pure white, and put them within the range of your display.
     
    adammpolak likes this.
  15. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Lighting between old built in renderer and new URP will not match automatically. New URP is using a realistic lighting falloff where old built in lighting used a cheaper approximation. To fight against overexposed white lighting you need to switch from Gamma to Linear color space (Project Settings -> Player). You will also need to use the post process effect Tonemapping. If you don't use it, you basically cannot get over 1 unit of light intensity without getting overexposed areas.
     
    halley likes this.
  16. adammpolak

    adammpolak

    Joined:
    Sep 9, 2018
    Posts:
    450
    This is what I was looking for, thank yoU!
     
  17. Reahreic

    Reahreic

    Joined:
    Mar 23, 2011
    Posts:
    254
    Thanks Bordeaux_Fox, your guidance helped.

    To add Tonemapping Post Processing:
    1. Right click on the hierarchy, then select 'Volume' and add your preferred type.
    2. Select the Volume and either select an existing profile or click new.
    3. Press the Add Override button and select Tonemapping.
    4. Select the Mode Checkbox and choose from either Neutral or ACES modes.
    5. Ensure your camera and Render Pipeline Assets have HDR and post processing enabled.
    6. Ensure your Post Processing Grading Mode is set to use High Dynamic Range.
    It helps a little, but not nearly as much as one would hope/is implied.
     
    KarlKarl2000 likes this.
  18. dnomn8r

    dnomn8r

    Joined:
    Nov 15, 2012
    Posts:
    13