Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Trying to get an outline working on a custom font in Unity 6000.1.6f

A topic by GamerReality created 10 days ago Views: 120 Replies: 5
Viewing posts 1 to 6

I'm in Unity 6000.1.6f with the latest version of Super Text Mesh and working on a VR project for Windows and Android builds.

I'm trying to set up UI text using two fonts I've downloaded, Playpen and CherryBomb. The text should be white. The following issues happen with both ttf texts:

Whenever I use any of the STM outline shaders, the outline's color overpowers the text color. Lowering the width only moves my text down; I'm not even sure why. 

When I try to use the STM Ultra shader, the text gets all these weird artifacts and eventually disappears. That's been happening to me since I started the project in Unity 2023.2, but I've been putting off the UI in my game until now.

Thanks in advance

Developer

Hey!

Are you sure this is the Ultra shader? Normally the UI on the inspector there should change when it's been applied, and in your screenshot it's showing the configuration for the Universal shaders. (Additionally, the rendering going on here is what I would expect the Universal shader to do in this circumstance, where it's only rendering the final pass of the outline and ignoring the text pass) So please try clicking the "Ultra" button next to the shadier field on the inspector to apply that shader to your material. Please let me know if that makes a difference.


If nothing changes when pressing that button and you don't get any errors in the console, try saving your scene as that will force STM to rebuild the material settings.

Hey,

Thanks for the speedy reply as well as your incredible asset. I look forward to using it and making my game stand out. 

You’re right, the screenshot is showing the universal shader and it’s overpowering black outline. I didn’t take a screenshot of the Ultra shader being applied because it had made the text invisible by the time I was ready to screenshot. I’ve noticed that saving the scene seems to help in other situations, but unfortunately it wasn’t the fix this time.

Developer

Ah got it, so yes for the Universal shader there, that is just what it does and why I made the Ultra shader. (But apparently it works fine in builds?)

Do you have any screenshots of the weird artifacts in the Ultra shader? It sounds like... hm, the material/font is changing, but the UVs don't update to match immediately which they really should. Saving *should* usually correct that, but that's odd... if an error showed up that got cleared (an error I would like to fix btw), STM might have entered a stalled state. If you select the object in the hierarchy and press ctrl+d to duplicate it, does anything change on the new object created?

I've reopened the project today. No errors or relevant warnings, but this is how the ultra shader is looking. I can finally see an outline, but background objects are clipping through it somehow. I'm realizing now that the text is disappearing when I have the ground plane in the background, so it's the same problem there.

It's almost like my text is somehow so low in some kind of layers that it's not showing up over an outline (as seen in my first screenshot, where the text is all black), and it's not being drawn above game objects in the scene. This isn't exclusive to the cherrybomb font; this happens no matter what font I switch to.

I'm running mostly default inspector settings. I don't know what would have caused this:


That seems to be the problem, but as I just went to look into your samples to bring one to my scene, the text objects I've attached screenshots of are now rendering fine, except I can't get any outline on them even though they're using the ultra shader. I'm sure they'll revert to their old problem in a few minutes, though.

Developer

Ok those screenshots and description help a lot! Here's some things to try:


In the inspector try disabling ZWrite. This is basically there just to make it so Ultra shader outlines don't go over the previous letter, but if your outlines are thin enough you may as well disable it, it can *sometimes* cause something like this to happen if text is is a 3D space like this, rather than being on a UI. I feel like this shouldn't be happening with ZWrite on though, so if this solves it I'll look into how to prevent it from being a problem in the first place.


I'd also check out the rendering order of those objects in the background, is their render queue above 3000? You can try changing the render queue value on STM's material settings to something higher!


Do you get a result similar to what you want when using the Universal shader (plain version with out outline) then adding an outline through STMMaskableGraphic? That's also an option for rendering outline effects now, too!