Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles

Default super text isn't visible (1.8.8)

A topic by Natulyre created 78 days ago Views: 113 Replies: 11
Viewing posts 1 to 10

Hello there, I've recently acquired Super Text Mesh (Version 1.8.5), and it seems to be very promising but I've just updated to 1.8.8 and I have some issues.  My unity project is using 2018.1.0f2 (64 bit) in PC mode.

When I instantiate a 'UI/Super Text' through the 'right-click menu', it isn't visible.  I'm guessing this might have something to do with the default shader being set to (Super Text Mesh/UI/Default). This same shader is used in the 'ShaderText' scene, and it isn't visible there either.

While I'm here, I can't quite out how to apply the 'SDF' shader on a normal font, as referenced by the documentation. I see a checkbox for SDF but it cannot be checked.

If I instead set an SDF shader directly, well, it works in the scene view, but it'll be pitch black in the game view. Any ideas?


Developer

Hey!


The text isn't rendering because I accidentally set the mask mode to be "Inside" by default. Set it to "outside" and it should render fine! I'll change this in the next patch, sorry about that.


That's odd that the SDF mode box can't be checked... as long as it's visible there, I can't think of what wouldn't make it toggle-able. I'm able to toggle it in the exact same shader, maybe try it after solving the above issue? It should make some additional settings appear in the inspector immediately. Let me know if that leads to anything?


Finally,  the legacy SDF shader wasn't meant for Unity UI text, only normal text. Using any legacy normal text shaders on unity UI results in it rending all-black.


-Kai

I have the exact same problem where the SDF mode can't be checked! Unity 2017.4.15f1, v1.8.10, I can't check SDF mode, and I can't check "Pixel Snap" either (although I don't know what that does).

It just immediately toggles itself off.

I'm just using the built in prefab, right click create -> 3D Objects -> Super 3D Text, and no dice. I've got an SDF atlas generated, but it also doesn't work on a regular font (Arial) either.

Developer (1 edit)

Just replying here to let you know I'm tackling this in the main thread, not sure if you'll get notifications for that

Developer

Okay, was able to reproduce the SDF mode toggle thing in 2018.2! (I develop in 5.3.4) I'll see if I can solve this r/n

Developer

Alright, I've narrowed it down to being a bug with my inspector. If you go into your material's inspector (the material being used by your STM object), you can toggle SDF mode and pixel snap just fine from there! SO that's the quickfix, I'll see what I can do about getting the inspector to play nice.

Developer

Okay, I think this one has me completely stumped. At the moment, I have no idea why this editor code in "STMCustomInspectorTools.cs" isn't working in newer versions of Unity. The workaround of toggling SDF mode & pixel snap works fine in a material's own inspector, so that might have to be used for just a bit. I'll add this to the official bug list, and hopefully figure out a solution soon.

FYI, @KaiClavier, it looks like there is a bug that is ominously closed "ByDesign" here: https://issuetracker.unity3d.com/issues/cannot-enable-emission-when-using-materi...

However, I found a fix for this. I looked at your shader "Super Text Mesh/Unlit/Default", and see this:

[Toggle(SDF_MODE)] _SDFMode ("Toggle SDF Mode", Float) = 0

So I tried a:

mat.SetFloat("_SDFMode", [0/1]);

Instead of your EnableKeyword/DisableKeyword calls, and now the material properly toggles in the editor (and I see the SDF pass for example changing things, so it seems to function). I don't know why Enable/Disable keyword doesn't work.

PS I did see you reply to my subthread reply earlier in the main thread (I guess I'll keep to the main thread).

Developer

Oh my god, I never realized this method would work. I figured those toggles were just material inspector shorthands, I didn't think changing the value via code would actually change the keywords! Thank you so much, I'll get this implemented ASAP.

Developer (2 edits)

Okay yeah trying this out further, this works fine in newer version of Unity, but in 5.3.4 this method doesn't work. If I could pinpoint the exact version of Unity where this breaks, I could use platform-dependent compilation to fix this, but right now that's not really good.


From that bug report, I guess I can assume it's 2018.1? I'll try implementing this, and see if it ends up cropping up in different versions. This wouldn't be the first "by design" bug to hit STM

The bug lists 2017.1.4p2 as the oldest version it repros on, and I confirm the current way is broken on 2017.4 :/

Does the new way throw errors on 5.3.4? If not, you could just call both right away, an EnableKeyword + SetFloat(1). That'll work, until it doesn't :)

Developer

Got it, I changed the code to work for 2017.1.4.

And it doesn't throw errors in 5.3.4, it simply doesn't work like how the current code wouldn't work in 2018. Good idea leaving both options in, I'll give that a go, then I wouldn't have to worry about the unity version.