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

Unity Directional lights vs Drawcalls

Discussion in 'Scripting' started by mogambo, Apr 13, 2014.

  1. mogambo

    mogambo

    Joined:
    Oct 14, 2013
    Posts:
    42
    Hi all,

    I'm using 2 directional cameras in my scene as the game demands this.
    I found that because I'm using 2 directional lights, my drawcalls are being doubled.

    I checked this by turning off one of the directional lights.

    Is there any setting that I can do to reduce over all drawcalls ?
    Please help!

    Thanks,
     
  2. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    Well, its most likely the shadows that are doubling the draw calls, so you could disable shadows
     
  3. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,716
    In forward rendering, Unity uses one draw call per pixel-light source.

    You can flag one of your light as being "Not Important", making it vertex lit instead of pixel lit. It should remove your extra draw call.
     
  4. mogambo

    mogambo

    Joined:
    Oct 14, 2013
    Posts:
    42
    Hi,

    I need 2 light sources looking at a different direction as per my design.
    This means, I cannot flag one of them as 'not-important'! :(

    Can somebody provide me a direction.

    with one of those lights, it is 6 drawcalls. When added next one, it raises to 70.
    It is the same case if I switch them vice versa.