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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How to get text object to receive shadows?

Discussion in 'General Graphics' started by gw707, Aug 9, 2023.

  1. gw707

    gw707

    Joined:
    May 3, 2021
    Posts:
    12
    I'm making a football-based game and I’m having an issue trying to get the number on the player kits to receive shadows. Everything else apart from the number receives shadows.

    I've searched for answer on this and while there have been discussions on transparent objects receiving shadows, I've not been able to find a solution to this.

    I'm currently using a TextMeshPro text object to display the number. There is an option on the text object mesh renderer to receive shadows, which is unchecked by default. When i go to check it, nothing happens and it reverts back to unchecked.

    I've also tried using sprites to display numbers by creating a transparent shader material and attaching it to a Plane object but had no luck in receiving shadows - apart from using the cutout rendering. The problem with cutout rendering is the jagged edges as a result of the alpha cutoff, which I'm not a fan of.





    So, my question is:

    - Is there a way to get TextMeshPro text or transparent sprite object to receive shadows?

    - If not, is there a way fix the jagged edges on the cutout rendering? Or is there an alternative to the cutout rendering that doesn't have this issue but still receives shadows?

    One thing to note is that I’m developing the game for mobile, so I'd like to avoid any shaders that are too resource intensive if possible.

    Appreciate any help on the matter.