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.

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:
    580
    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.