Soft Shadow Effect on UI elements?

Is there currently any way to create a soft shadow on elements of the UI? I’ve tried attaching the Shadow script which was mentioned in the documentation but it creates a very hard effect, as opposed to a soft shadow. Thanks.

I am also trying to get this effect!

If you absolutely need such functionality, you can take a look at TextMesh Pro which allows you to dynamically control these types of visual FX on text. Here is an example comparing the basic outline and shadow using UI.Text vs. TextMesh Pro.

Besides the visual improvements made possible by TextMesh Pro, it is 5X faster in terms of handling text with outline and shadows. See the following post with data on this http://digitalnativestudios.com/forum/index.php?topic=498.msg3828#msg3828

The example above was a simple comparison of Outline and Shadow since that is all that Ui.Text offers. TextMesh Pro gives you control over a lot more as seen in the image below. All those changes are dynamic and can be preserved by creating Material Presets.

See the following video to learn more about TextMesh Pro’s Advanced Text Rendering capabilities.

Besides improved text rendering and visual styling, TextMesh Pro also offers improved control over text layout like character, line and paragraph spacing and better text formatting options with close to 30 rich text tags. Here is an example of some of the basic rich text tags available.

There is more but this should cover the basics. Let me know if you have any questions?

thanks! I’m trying to convince my work to get this for us

If you need any additional information, please feel free to ask.

Here’s a teaser… TextMesh Pro already provide the ability to mix sprites inline with the text as per the image below.

However, I am currently working on providing the ability to mix different fonts and materials as well per text object.

If is necessary you can add three Outline effect component to the inspector with differents pixels ratios and opacity. It feels natural. Here is the result;


2381117--161981--SS2.png

Be mindful that each Outline FX stamps and copies the geometry 4 times which can have a significant performance impact. Adding 3 of these to any text object would make that performance hit even worst.

Here is a table showing the performance and geometry requirements of those components.

I have TMPro on my work account, but I’m really trying to find a good way to get a nice glow on buttons and other UI elements without having to make custom sprites for each one. @Stephan-B Is there any way you guys can make an effect that would work on buttons? Or is the custom effects TMPro has only usable for fonts?

The Dynamic Styling (ie. ability to add dilation, outline, shadow, glow, etc) is made possible by the use of Signed Distance Field and the custom shaders. This can be done on the text because the Font Assets are generated using Signed Distance Field thus leveraging these capabilities. There is more to it but close enough :slight_smile:

The same thing could be done by creating another product which would essentially do the same thing to UI Elements like buttons. So instead of using normal sprites, you would be generating new assets using signed distance field that represent the shape of the buttons. It would have to support slicing and the likes but essentially, the same benefits would be possible including resolution independent scaling and the ability to dynamically style those UI elements.

Unfortunately, “us guys” is basically just me and (I guess) the downside of TextMesh Pro doing really well is that it is keeping me busy where I have no real bandwidth available to create another product.

I certainly would love to explore this but there are still tons of features that I want to add to TextMesh Pro and I am basically at the stage (which is a good thing) where I need to find someone to help out. Lots of opportunities but so little time.

It shouldn’t be difficult to write a blurring shader? Blur the shadow? shrug