Making text that looks like it was painted on the wall

I’m working on a solution to having some text written on the walls, as though someone stenciled it on the wall. I was investigating whether TMP would produce results like this, and so far I’m not finding the right combination of settings.

Ideally I was hoping to find that TMP could rendering using a material I’d already made. (For example, a PBR Paint material, with a normal map, roughness, etc). But that doesn’t seem like an option. (Please correct me if I’m wrong about that.) Instead, it seems I can merely assign textures to the Face, and a Bump Map texture as well. This doesn’t look like a real material on the wall. I’m hoping for the edges to be somewhat fuzzy, not quite as crisp and sharp as it looks here, and for the paint to reflect differently, with its own normal map.

Is that sort of thing possible with TMP?

I would suggest using the distance field surface shaders (either mobile or the full distance field). Surface shaders are affected by scene lighting and as such should enable you to achieve something closer to the desired visuals.

In terms of the edges, you can add some softness to the outline.

Ah, it looks like the “surface” shaders don’t work yet in HDRP (in 2018.2). Any idea if someone’s working on that maybe for 2018.3 or later?

Sorry. Didn’t realize you were using SRP.

Revising the surface shaders to provide the equivalent functionality with SRP is on my todo list. Unfortunately, I don’t have an ETA on that yet. Perhaps some adventurous TMP user can tackle this one :wink:

Just an idea (I’m not sure how to realize): writing on the walls in HDRP probably the easiest with decals?

1 Like

Yes, that’s the other approach I’m testing, creating textures in Substance Designer to display text in a decal shader. Those look great, but it gets a bit complex to generate lots of distinct text efficiently from a single substance.

Did you finally found an efficient solution? I need to render text on an sphere in HDRP, and I’m looking for some solution. My intuition tells me to “mix” decals and Text/TextMeshPro, but I’d rather not develop the technology myself. If I don’t find any other solution, I think I’ll just use a texture with the text written in Photoshop, but of course I’d rather be able to enter the text in the editor.

I mainly just use Decals for this, with textures that I create in Substance Designer. My decals, however, are pretty much always displayed on a flat surface:

6230559--685674--upload_2020-8-21_15-3-31.png

These generally look good, though it depends on pre-generated textures. I had originally hoped to use something like this to put room numbers all over the place, with each room number being different, but since the text isn’t dynamic, that would mean lots of textures. Not worth it.

The decals can also wrap around curved surfaces without too much distortion:

6230559--685677--upload_2020-8-21_15-5-38.png

However, you’ll have to be pretty careful with your decal placement to avoid it “spilling out” onto other nearby objects:

6230559--685683--upload_2020-8-21_15-7-8.png

1 Like

Sorry for the late answering, Yes, decals are great, and I very much know about the spilling problem. Fortunatelly, decal layers are now available, which makes it possible to carefully select where decals should act, and where they shouldn’t.

Anyway, my question was more about the specific possibility of using decals with TMPro.

For the sphere I mentioned, I ended up using a decal made in Photoshop with a given font, but this way I won’t be able to change the text, which would be very useful for localization or even for gameplay purposes.

Also, right now we want to create a 3D keyboard where the player will be able to move and step on with a tiny avatar that is 5mm tall. We don’t want the letters on the keys to be pixelated, but we would also like to not have a 512x512 texture for each letter. Thus it would be great to have TMPro to work seamlessly with decals.

I’ll be doing more research on this, I hope to find an interesting solution. If I do, I’ll post it here.

Thanks!

as a workaround, maybe we can generate the text runtime(or bake) and store in a render texture and pass it to a decal material?