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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Display faded shadow of a text label in Unity

Discussion in 'UGUI & TextMesh Pro' started by thefirstplaybae, Nov 23, 2018.

  1. thefirstplaybae

    thefirstplaybae

    Joined:
    Feb 15, 2013
    Posts:
    16
    Hi ,

    I want to achieve something like this with my text -

    upload_2018-11-23_13-58-52.png

    this is the video where you can find out more on how it looks -


    I am planning to have my headers as shadows on the wall and I want them to have a creepy dark look like the text displayed in the image above. I have tried a few tricks like fading and animating a basic Text label but I think I am missing out on something. Can this be achieved using text mesh pro ? I can also see that there a lot of camera effects in the image/video above. What do you guys think would be the most efficient and optimized way to achieve this.

    Thanks.
     
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,078
    I guess you can achieve it with TMP, but not with the UI part.
    Basically you need a material which is invisible but casts shadows in 3D space.
     
  3. thefirstplaybae

    thefirstplaybae

    Joined:
    Feb 15, 2013
    Posts:
    16
    Yeah I have achieved the simple shadow effect with tmp using the text mesh pro object and setting the shadows only for the renderer. But now, I can't use any text UI effects like fade on it. I guess Ill have to use some shader magic to achieve it , right ?
     
  4. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,078
    if you only cast shadows you cannot apply any effects because the actual mesh of tmp is invisible.
    if you want a blurry edge you have to play with the light/shadow settings and the distance of the light source and of the background (the shadow receiver).
     
    thefirstplaybae likes this.
  5. thefirstplaybae

    thefirstplaybae

    Joined:
    Feb 15, 2013
    Posts:
    16
    Well, I cant really change the casting lights distance or shadow resolution since that will also affect shadows of other items on my wall.
    After a lot of hit and trial, I have realised that this is surely an achievement via image effects ( that arent very mobile-friendly ) so I guess I will have to buy a mobile optimised solution for it.