Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2D Sprite/Diffuse - Controlling Shader Light Intensity ?

Discussion in 'Shaders' started by Robin-F, Feb 10, 2016.

  1. Robin-F

    Robin-F

    Joined:
    Feb 10, 2016
    Posts:
    3
    Hi,

    I am currently doing a 2D Multiplayer RPG style game, and I am trying to figure out if there is a way to control how much light a Shader can get.

    To clarify some more (Maybe there is a better solution to my problem): I have a big world, and every spriterenderer has a 2D Sprite/Diffuse material on it so that I can use light sources.

    Now I want every "Character" to have their own light source and light up the world.
    This I can easily achieve.

    The problem comes when 2 light sources comes close to eachother and their combined light intensity becomes to great. Then the tiles and characters gets over exposed.

    upload_2016-2-10_16-38-0.png

    Could I even use Lights to achieve what I want to here or is there maybe a better solution for my lightning?

    What I would like to do is to somehow set a "maximum light color" or something on the shader, so that everything cant be exposed more then a set value.

    Thanks in advance,
    Robin

     
  2. IgorUnity3D

    IgorUnity3D

    Joined:
    Aug 28, 2014
    Posts:
    66
    Hi,

    I know this topic looks old, but have you ever tried to change the Layer mask of each light in your game? You could ignore the layer of the other players, maybe you can have a better result.