Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Point Light Range has very limited effect

Discussion in 'General Graphics' started by Tapps-VR, Dec 13, 2019.

  1. Tapps-VR

    Tapps-VR

    Joined:
    Mar 10, 2017
    Posts:
    5
    Hi,

    I'm having some trouble lighting a scene.
    I have a realtime point light in the middle of the scene, and I'd like to light objects around it relatively evenly, so I set a very long range (like 50). The problem is that, after about 5 meters , no matter how long is the range I set, nothing changes. I can't get the light to reach farther objects.
    Up to about 5 meters I can see the range changing, but not after that.
    It's the only active light in the scene. Realtime, no shadows.
    I'm using the LWRP.

    Any clues? Is that a bug in the LWRP?

    Thanks!
     
    Argos likes this.
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,256
    The LWRP uses a real world inverse square falloff light attenuation calculation that is technically infinite in range, but means the light gets very dim quickly. The light’s range setting is used to limit that range artificially.
    https://forum.unity.com/threads/lwrp-render-bug-and-spotlight-intensity.601783/

    If you want the light to reach further, make it brighter at the same time as you adjust the range.
     
  3. Tapps-VR

    Tapps-VR

    Joined:
    Mar 10, 2017
    Posts:
    5
    Thank you, bgolus.

    That's what I was trying to avoid. I don't want objects near the point light to be too bright. So what I need is a different attenuation curve.
    For what I've been seeing, this can only be achieved by editing the Lighting.hlsl file. I managed to do that and got the attenuation I wanted, but Unity keeps overriding my changes with the original file.
    Now I need to find out how to edit this file and make it stick :)
     
  4. Indiana-Jonas

    Indiana-Jonas

    Joined:
    Jul 24, 2015
    Posts:
    12
    Did you figure out how to make that stick? And would you mind sharing that code?
     
  5. ginryu

    ginryu

    Joined:
    Nov 23, 2013
    Posts:
    3
    the draw back to this method is that objects closer to the light source end up receiving an extreme amount of light. the more intense the light is, the brighter it is going to be. I have been having this problem with LWRP I am making a galaxy exploration game and the light limits are a pain in the butt. The only reason I use LWRP is because I use a procedural planets generation system that needs a LWRP shader to work, no clue how to convert LWRP shader to a standard shader format
     
  6. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,123
    You need to move URP from package to local, for changes to stick.