• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by gregroberts · Jul 17, 2015 at 05:58 AM · shadowstextmesh3dtext

How do you create genuine shadows from a Text Mesh?

We have a need to create genuine shadows from TextMeshes in game, using either a GUItext on a Canvas or a 3Dtext. All the current solutions we've seen, such as offsetting a duplicate behind the text, produce simple photoshop-like drop shadows. We want to cast shadows just like those from a complex object; ones that will cast correctly on complex backgrounds, as in the illustration. It appears that the existing "Font Material" shader does not cast shadows.

The closest we've been able to get so far is to duplicate the text GameObject, give it a slight -Z offset,, then apply a standard shader material to the duplicate... with the unacceptable result that each letter receives a solid color box around it.

It appears that the Text Mesh Pro ($65) and TestFX ($30) plug-ins accomplish this, tho documentation to achieve this particular effect looks scant. If there is a simple way to do it in native Unity, we'd prefer it.

Extra points for fast responses, as we are on a very tight deadline.

alt text

alt text

shad-demo.png (138.3 kB)
shad-inspect.png (53.0 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by gregroberts · Jul 17, 2015 at 02:43 PM

UPDATE : I just found Typogenic, an open source text rendering library that appears to accomplish this. Am implementing and will report back.

http://maximumverbosity.net/1GAM/2014/07/

alt text


typogenicdemo.png (230.9 kB)
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image gregroberts · Jul 21, 2015 at 01:53 PM 0
Share

This worked perfectly in Unity 5.1.1. Here is the initial test result, textmesh shadows rendered onto cube and sphere solids

Caveat: It does require pre-processing of fonts to create the shadowcasters:

alt text

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to draw 3D text from code 4 Answers

int to string problem 4 Answers

Insert 3d text to the front face of a cube GameObject 0 Answers

3D Text font issue 2 Answers

Cannot get 3D Text/Text Mesh to wrap or a attached collider used as a button to scale based on word count. 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges