Search Unity

Make Unity render only one (two) light source, not blend lights.

Discussion in 'Global Illumination' started by AunShiLord, Oct 2, 2018.

  1. AunShiLord

    AunShiLord

    Joined:
    Jan 19, 2018
    Posts:
    2
    Hey there, kittens!

    In my 2D game, I want to achieve effect where some objects (blue crystals on attached screenshot) have some glowing effect (via spotlight light source). Every objects creates lighted area (pointed as A). But the problem is, when objects standing close to each other, they creating this "cross area" (pointed as B), which is obvious. Objects become very bright, especially in 3 x 3 positions. And I believe draw calls number increased dramatically.
    light_problem2.jpg
    Is there any way to "switch off" that light blending and render only one light source?

    As I understand I can achieve this effect with help of shaders. I'm not so strong in this area so any help or guide will be appreciated.

    I've also tried to reduce number of pixel light count in quality setting. But that haven't gave me desired result (especially if Light's render mode set to Important).

    I've tried culling masks, but this also works not as intended.

    But maybe there are other methods to achieve similar effect?

    With great respect,
    A'Shi
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Hey there! A more flexible solution would be to additively blend a quad with a gradient texture. Another solution would be to use culling masks and put different objects on different layers. That should work, but might end up cluttering your layer list.