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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

URP light confusion - everything is directional only?

Discussion in 'Universal Render Pipeline' started by Turiko, Nov 11, 2020.

  1. Turiko

    Turiko

    Joined:
    Jun 27, 2015
    Posts:
    3
    i've been tinkering around with a basic prototype for a game - a 4x-like game in space, with my prototype being a single solar system. I decided to upgrade from the default rendering to URP, as i wanted to try experimenting with shaders and unity's built-in editor for that is exclusive to the "modern" rendering pipelines.

    Instructions were pretty straightforward, but as soon as things updated, the lighting, basic as it is... just stopped working? Obviously, i had a single point light in the middle (the star). Every object is just 100% dark now, the point light does not emit any light anymore.

    I tinkered around some, found the spot kind of light not doing anything either (or so i thought) then, found directional to work, but that wasn't helpful. Eventually i tried moving my existing light and... now things work. As a directional light only. point light at 0,0,0 -> complete darkness, point light at 1,0,0, suddenly the entire scene is lit by a directional light originating in the X axis. Same for when i set it to spotlight; it's just a directional. Then when i set it to directional, the light changes to be directional based on the facing of the light, rather than the position compared to the origin point.

    I've taken some screenshots to show the exact results of moving the light a single unit in either direction: https://imgur.com/a/Xuwteso .Obviously I'm not super worried about graphical fidelity (everything's just cubes, spheres etc. for now :p) but not being able to have a light act as anything but global directional illumination seems like a bit of an issue.
     
  2. Sky77

    Sky77

    Joined:
    Jan 30, 2014
    Posts:
    171
    No, lights behaves properly in URP, so you can use directional, point and spot lights.
    The fall off and intensity works a little different, so you may have to tweaks the settings a bit.
     
    laurentlavigne likes this.
  3. Turiko

    Turiko

    Joined:
    Jun 27, 2015
    Posts:
    3
    This isn't what i'm experiencing, as you can see in the screenshots.I just upgraded and the (point- light stopped emitting light, even if i move an object right up against it, it remains pitch black. Then when i move the point light away from origin, the entire scene is lit as if a directional - light appears from somewhere (not the point light) and illuminates the entire scene from one side. The screenshots i posted show this very clearly.
     
  4. Sky77

    Sky77

    Joined:
    Jan 30, 2014
    Posts:
    171
    I don't know what to say, we don't have this kind of problem.

    I would suggest to move the Light component in a separate GameObject with the light component only though. I don't think it's a good idea to have the light component with a mesh renderer, collider and so on. It's something that we've never done actually and I don't know if it can cause problems.
     
  5. Turiko

    Turiko

    Joined:
    Jun 27, 2015
    Posts:
    3
    I hadn't considered the lighting being an issue if combined with other game objects, so i tried that now. Unfortunately, it hasn't made the behaviour of the lights change.

    I tried making a new project (with the URP preset, rather than 3D and later changing over) and the light appears to behave normally there. I'm not sure what happened, but i guess the upgrade from the standard pipeline failed somewhere. I deleted everything in the new project folder, copied over my existing project in its entirety and... now the lighting works as you'd expect.... except when i checked on the project settings, the renderer was now set to "none". Once i slot in the actual URP renderer asset, after changing materials again (as everything turns pink), back to square one, with the behaviour exactly as shown in my screenshot and no light but directionals existing anymore.

    So it seems my unity install is, for whatever reason, generating buggy render pipeline assets.
     
  6. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    5,994
    How are your settings in the urp asset?
     
  7. ChillinTech

    ChillinTech

    Joined:
    Aug 12, 2018
    Posts:
    5
    I am having the issue as well. I wanted to make an indoor level to my game (using URP) when i realized that only directional lights work: https://imgur.com/a/CKkJIl5
    EDIT: i solved the problem by changing my URP asset setting under lighting > Additional lights from per vertex to per pixel
     
    Last edited: Feb 2, 2022
  8. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    125
    What type of material is applied to your other objects in the scene (Unlit, Lit, BakedLit, custom)?
    Also, You might want to increase the intensity value of your light.

    EDIT: As Stated above, since the main scene light is a directional, this would be a secondary light. If set to per vertex, that would be your problem.
     
    Last edited: Feb 4, 2022