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.

Feature Request Ability to choose which ShadowCasters are affected by which lights (by layer?)

Discussion in '2D Experimental Preview' started by ThundThund, Dec 28, 2020.

  1. ThundThund

    ThundThund

    Joined:
    Feb 7, 2017
    Posts:
    281
    Hi everybody, it would be nice to be able to choose which 2D lights cast shadows using which shadow casters. Currently we can choose which Sorting Layers are affected by lights and which Sorting Layers receive the shadows of shadow casters, but imagine I have 2 layers in my game level, and there is one light in each layer (one layer is over the other in the Z axis, they have different Order in Layer); I want each light illuminate and cast shadows in their respective layers.

    Apart from that example, I have a real case: I need a light to cast shadows for every shadow caster but for the protagonist's, which casts shadows for the rest of lights. The protagonist carries a kind of torch, which is too close to his shadowcaster, which may produce ugly shadow effects.

    As a suggestion, lights and shadowcasters could be limited (optionally) to a range of Order in Layers.
     
unityunity