Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question Age of Empires like light effect in Unity with light masking via render texture

Discussion in 'General Graphics' started by sajid00001, Aug 2, 2023.

  1. sajid00001

    sajid00001

    Joined:
    Aug 10, 2017
    Posts:
    6
    Hi,

    I want to achieve the lighting effect like these reference games on a phone project pref. via render textures,but I can't find a way to mask the light area for directional light into unity, nor there seems a suitable way.

    https://play.google.com/store/apps/details?id=com.ristretto.lifebubble
    https://play.google.com/store/apps/details?id=superstar.games.Color.Invaders.Idle
    https://diamondlobby.com/wp-content/uploads/2021/04/age-of-empires-2-fundamentals.webp

    Thanks for taking a minute out to read this.
     
  2. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    716
    There are a few ways to do this. The easiest one is probably light cookies:
    https://docs.unity3d.com/Manual/Cookies.html
    (disclaimer: don't know if this works for directional lights but they do have a position, so it could).
     
  3. sajid00001

    sajid00001

    Joined:
    Aug 10, 2017
    Posts:
    6
    @c0d3_m0nk3y Thanks for your reply.

    I tried this in built in pipeline even before your suggestion but it didn't work, but when I tried in URP it worked. So kinda confused as what might be the cause ? But anyways it worked for me.
     
    c0d3_m0nk3y likes this.