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. Dismiss Notice

Directional light disables other light source? [Lightweight Render Pipeline]

Discussion in 'Shaders' started by nicmarxp, May 30, 2018.

  1. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    404
    I'm using the Lightweight Render Pipeline 1.1.8-preview, since I'm trying to make a VR-project and I used the template that was included in 2018.1.0f2.

    I'm new to lighting and shaders, and I'm not sure if this is related to the LWRP or not, but I'm making a simple scene with a light on a wall, and a directional light.

    When the directional light is off, it acts as expected. But as soon as I turn it up, even set the intensity to 0.01, the other light seems to shut off, and does not add any light to the scene. See the image below.

    Why is this happening? Should I not use the LWRP? Thanks!

     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,236
    The LWRP has a max local light count that defaults to 1. You need to select the pipeline asset and increase the number. I believe it defaults to per vertex lights for lights beyond that count, but for that box your light may not reach the corner vertices, thus the center receives no light.
     
  3. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    404
    Ah great, that makes sense!
    With this template, there are three LWRP profiles, Low, medium and High. They have a setting called "Pixel Lights" which is 1, is that the one you refer to?

    There seems to be some kind of UI glitch, which makes it hard to change this value, I can't type in the field, but I can drag and it seems to change a bit, very weird..

    Well! Your other idea that it didn't reach the corners, so making a small panel behind the light worked to get light.

    I noticed that the floor which was a Plane got the light, so I changed the wall to a plane and it worked, instead of a cube. So is this the kind of techniques we have to use to take advantage of the LWRP? As long as you understand this, it should be ok.. :)

    Thanks again for your help, it was great!
     
  4. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    404
    Hmm, now I realize that the light doesn't look very good, see pic below. My guess is that the plane is split up into a bunch of vertices and it lights up each vertex of the plane individually, since when I stretch the plane, the light also stretches.

    How would I solve this to make the light more round/realistic? It might due to too much intensity, cause the floor looks OK, and if i move it from the wall or lower intensity, it looks better.

    Am I'm fighting against it too much and should use another pipeline instead? :p

     
  5. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,845
    Hi!
    Pixel lights should be set to more than 1 in the pipeline asset if you want more than one light to affect an object at the same time.

    The default plane indeed has more vertices than a side of a default cube, and you're seeing proper per-vertex lighting on it :) Basically, it calculates how the light affects the object in each vertex and then interpolates this value across the triangles.
     
    Achie1 likes this.
  6. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    404
    Aha, I'm very new to lighting, so is this normal for any rendering, or is it just the LWRP?

    Should I use the HD pipeline instead to get more realistic lighting? I'm working on a VR experience, where I will control the GPU (980ti) and I think I could have a little more intense graphics, than a VR project that should work on most phones etc.

    It didn't seem to be a HD VR template, so I might have to mix and match if that's a good idea.

    Thanks :)
     
  7. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,845
    If you do per-vertex lighting, you'll get those artefacts everywhere, it's not LWRP specific.

    If you want _realistic_ lighting, you might look into HDRP. For VR, however, it's unlikely your GPU will have enough power to run it at acceptable frame rate. Standard (Physically based) shader in LWRP is probably the best choise for you.
     
    hippocoder likes this.
  8. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    404
    Ok thanks a lot, I'll look into what per-vertex lighting is, and see what results I get with the other shaders!
     
  9. AruRen

    AruRen

    Joined:
    May 21, 2016
    Posts:
    20
    It is super bugged, I put the pixel count at 8 and it still doesn't show light.

    Even though I delete ALL other lights it is still disappearing.

    ps.: All other lights are baked!

    Also it has no shadow.


    upload_2018-7-22_11-41-58.png
     
  10. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,236
    Are you setting the light count in the quality settings or on the Lightweight Pipeline asset? When running the Lightweight Pipeline I believe the quality settings are ignored.
     
  11. AruRen

    AruRen

    Joined:
    May 21, 2016
    Posts:
    20
    The asset. It doesn't show in the quality settings once you have it set up.

    I realized that on 2018.2 it turns the screen on mobile black with post processing. :/ It was all working nicely on 2018.1

    I will keep debugging. If anyone know more about it let me know plz, thanks :)
     
  12. AruRen

    AruRen

    Joined:
    May 21, 2016
    Posts:
    20
    Render Scale is not working on android. I am not sure if it is only here. App doesn't open if it is not = 1
     
  13. Throbberwocky

    Throbberwocky

    Joined:
    Jan 4, 2018
    Posts:
    2
    Hi there,

    I am also experiencing only one light being active at a time. Even though I use the High Quality LWRP preset, where Pixel Light Count is set to 4 by default.

    I am using 2018.2.5.

    Do I miss anything else? Did somebody find a solution for that issue?

    Thanks!
    tom 8)
     
  14. UrbanKestrel

    UrbanKestrel

    Joined:
    Sep 21, 2018
    Posts:
    1
    Hello, I also have a similar issue.

    Only one point light works and another point light not working.
    It only has occurred LWRP with Android build settings.
    iOS and Windows build settings doesn't have lighting trouble.

    Thanks.
     
    AlejUb likes this.
  15. Captain_Flaush

    Captain_Flaush

    Joined:
    Apr 20, 2017
    Posts:
    63
    Hello,
    I had the same issue, I could only see one light.
    The reason was the graphic emulation (OpenGL 2.0 or 3.0)
    However on the device all the lights showed up.

    Mihai
     
  16. Kareeem

    Kareeem

    Joined:
    Mar 1, 2013
    Posts:
    37
    Any news on this? Seems that its only possible to have one directional light active...
     
  17. GrichDesign

    GrichDesign

    Joined:
    Mar 29, 2013
    Posts:
    25
    Just checking back around to see if anyone found a solution to this
     
  18. Shaggy21

    Shaggy21

    Joined:
    Oct 2, 2014
    Posts:
    20
    Hey, is there still no solution? It's been quite a while
     
  19. Mccbbi

    Mccbbi

    Joined:
    Feb 8, 2015
    Posts:
    12
    Same problem here. Two directional lights do not work together.
     
  20. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I suggest those having difficulty download 2019.1 and then create a new LWRP template scene from the drop down list. Try out the demo scene that comes with it to check out the lights, test everything and see what settings are used. You can then apply to your own project.
     
  21. RickshawDerpyDerp

    RickshawDerpyDerp

    Joined:
    Nov 6, 2018
    Posts:
    23
    Tried to upgrade my game to LWRP and there are some problems I don't understand how to fix. Most baffling is that I have a directional light outside a room that is supposed to shine through 12 open "windows" but now it only passes through a couple of them. What the heck would cause this change? Also, the maximum number lights I can have in the scene is 4. My scene has 17: 1 directional light and 16 spotlights. I also get notices that either the sky box material is not working or sky boxes are unsupported. I used one to simulate HD light reflections but they are all gone now. SceNE looks very flat.
     
  22. Reedex

    Reedex

    Joined:
    Sep 20, 2016
    Posts:
    387
    i have max 4 lights too , how to overcome this one? : - )
    also my spotlights are weak even if set to high range...?
     
  23. Ehredt

    Ehredt

    Joined:
    Jun 20, 2018
    Posts:
    79
    I'm having a problem in which having more than one skinned mesh onscreen at a time causes all the point lights to project from a single point even if their positions are different (i.e. setting a new skinned mesh active gets rid of lights 2 and 3, while light 1 suddenly becomes three times as bright). I fixed it by just using a spotlight instead, but I'm posting this here in case anyone runs into the same issue.
     
  24. CD-ECEU

    CD-ECEU

    Joined:
    May 21, 2019
    Posts:
    7
    They still haven't fixed this. On URP, only one directional light can cast shadows at a time, even if you specify otherwise in the Render Pipeline asset.
     
  25. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,894
    Is this still an issue ? I try to grab the spot pixel lights in shader using GetAdditionalLightsCount(); and seems returns only one of them and dont get shadows too.
     
  26. wm-VR

    wm-VR

    Joined:
    Aug 17, 2014
    Posts:
    123
    I have the same problem

    Shadows are just shown up for the main directional light in Unity 2019.4.6f1, URP

    Even though I have set the "per object limit" to 8 and "additional lights" to "per pixel" I can't get this to work. I just set up a new scene with a cube and a floor.

    The meshRenderers, materials and lights components are set to accept shadows by standard.

    I have no clue what this could cause
     
    Last edited: Aug 8, 2020
  27. wm-VR

    wm-VR

    Joined:
    Aug 17, 2014
    Posts:
    123
    After doing some research I figured out that point-lights do not cast shadows in URP yet. After working with Unity for several years I thought it was a bug because this limitation seems very unusual to me. A short information inside the editor or disabled shadow options would have been very helpful! But with the options available and no further information my first thought was about a bug.