Search Unity

Pixel Light Count has no effect anymore

Discussion in 'Windows Mixed Reality' started by derdimi, Jan 4, 2018.

  1. derdimi

    derdimi

    Joined:
    Mar 6, 2017
    Posts:
    33
    When I started my current HoloLens project, I've set the quality settings to "Fastest". This unfortunately didn't let me render pixel lights until I found out about the "Pixel Light Count" property in the quality settings. Adjusting it worked as expected. Because of another problem (https://forum.unity.com/threads/hololens-spotlight-horizontal-clipping-issue.507593/) I've moved to work on other issues first.

    Coming back to it now surprised me with the Pixel Light Count having no effect anymore. I can place a lot of spot lights in the scene and all of them are rendered on my simple quad object. My pixel light count is set to zero and I am using Forward Rendering. My Unity version is 2017.1.2p1.
     
  2. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    330
    Hi derdimi, sorry for the late response.

    Pixel Light Count will only work if the pixel light count is >0. When it is not, then it will fall back to vertex lighting which sounds like what you are seeing. This is expected behavior. Try a value of 1 or more and let us know if it's still not working for you.
     
  3. derdimi

    derdimi

    Joined:
    Mar 6, 2017
    Posts:
    33
    Thanks for the response. You are correct about the vertex lightning fallback although that wasn't my problem. I actually just figured it out.

    I did not see any vertex lightning. I saw all pixel lights individually. The reason is that I switched the Render Mode from Auto to Important on each spotlight. Apparently, the Pixel Light Count option in the Quality Settings is then ignored for that spotlight. That obviously makes sense. I would like to see that dependency information added to the Pixel Light Count tooltip, though.
     
  4. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    330
  5. Lobolopez

    Lobolopez

    Joined:
    Feb 26, 2018
    Posts:
    15
    Maybe you can help me here, I don't quite get that (setting to zero = vertex lights) working as you'd think.
    In my tests that's only true for non directional lights. Even setting the value to zero calculates the first light (the base pass) per pixel (looking at the enabled #defines in the shader). Feels like that setting is more like "number of per pixel lights added not counting with the base if it is directional". Could that be true?
     
  6. derdimi

    derdimi

    Joined:
    Mar 6, 2017
    Posts:
    33
    Try to change the render mode of your directional light to "Not Important" and you will see it switch to vertex lightning. Deactivate the environment/ambient lighting in the global lighting settings to see it more clearly.
     
  7. Lobolopez

    Lobolopez

    Joined:
    Feb 26, 2018
    Posts:
    15
    No, sure, setting to non-important makes them part of the vertex ligthing.
    Still, for an auto light you'd think setting the pixel light limit to 1 would mean "from all the lights, take the most significant one for this object and run it analitically, the rest make part of the SH" or somesuch