Search Unity

Maximum number of lights in scene

Discussion in 'Global Illumination' started by LabMatti, Apr 24, 2019.

  1. LabMatti

    LabMatti

    Joined:
    Jan 19, 2018
    Posts:
    58
    Hi all,
    I need a lot (let's say 100) spheres in scene. Every sphere has to emit light in the background plane.
    This spheres have to interact with an object controlled by user. So when the object is near a sphere, that sphere has to go to the opposite direction...

    The problem is that agter 3-4 sphere the light start to disappear.

    In the image you can see my situation: lights.jpg

    The object is a sphere with a light attached...is there a limit somewhere in the number of lights? Can I use 100 realtime lights? I'm not good with lightning options, can you help me?


    Thank you
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    You can bump up Pixel Light Count in quality settings (Project Settings -> Quality)
     
    gooby429, mattxreality and LabMatti like this.
  3. LabMatti

    LabMatti

    Joined:
    Jan 19, 2018
    Posts:
    58
    Thank you! It worked.
     
  4. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    You might want to use Deferred Rendering instead.

    https://unity3d.com/learn/tutorials/topics/graphics/choosing-rendering-path

     
    LabOSM likes this.
  5. firestorm185

    firestorm185

    Joined:
    Sep 23, 2014
    Posts:
    24
    That option isn't available with a URP project. Any idea how to get more lights in URP?
     
  6. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Deferred Rendering is still in development for URP: See this thread: https://forum.unity.com/threads/urp-deferred.931872/
    So if you care about many light sources, you should considering using HDRP.
     
  7. andywatts

    andywatts

    Joined:
    Sep 19, 2015
    Posts:
    112
    worth noting that hdrp uses "cluster and tile", so you'll still get artefacts if you have too many dynamic lights.