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.
  2. Dismiss Notice

Shadows in tilemaps

Discussion in '2D' started by kedger94, Jan 2, 2019.

  1. kedger94

    kedger94

    Joined:
    Jul 22, 2018
    Posts:
    2
    Hello, I am having real difficulties with lights and shadows in my game.

    I have set up a directional light, put shader material on GameObjects which I want to light. The sprites react according to intensity of the light, as you can see in the picture - https://prnt.sc/m2axs9.


    The problem is, that I don't know, how to set up shadows for these blocks. I want for the few blocks on top to be visable, and the rest of them to slowly slip in to darkness. Fairly similarly to Terraria. I just can't find any tutorial on the internet.

    Any advice would help me a ton.
     
  2. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    352
    This is huge mystery to me as well, seems all other old forum guides are no longer working
     
  3. dasgandlaf

    dasgandlaf

    Joined:
    Aug 13, 2020
    Posts:
    23
    I hope this is not too old of a thread to bump. Has anyone fixed this?
     
  4. Xiangting_Su

    Xiangting_Su

    Unity Technologies

    Joined:
    Sep 22, 2020
    Posts:
    246
    Hey @kedger94 and all, thanks for sharing! Was this what you guys had in mind? Something like in the dotted part of this image below?

    Terraria.png
     
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That looks like an excellent candidate for vertex colour.