#Adding text on shaders in Shader Graph

1 messages · Page 1 of 1 (latest)

normal topaz
#

I'm a C# developer, but new to unity, I tried using the shader graph and found it is pretty similar to shader nodes in blender.

So I created a simple shader for a pool ball, that as I understand I can control programmatically, but I was wondering if there is a way to add text to the ball

pastel elm
normal topaz
pastel elm
normal topaz
#

Seemed like an interesting thing to try

pastel elm
#

Nothing wrong with that. Just for a learning opportunity, you could make a texture that has all the numbers/text required for all the balls in one black and white atlas

normal topaz
#

Like one side of each ball

pastel elm
#

that could work too

normal topaz
#

Welp, thanks for the help

obsidian thicket
#

I'm sure there's more than a few ways to make text purely from shaders, but you probably have to get clever
And it'd be totally hellish to do with nodes

normal topaz
obsidian thicket
#

A lot

normal topaz
#

I was thinking of somehow involving the vectors of a font in a shader

#

But that's just... Why would I do that lol

#

I'm just gonna make a B&W texture with the numbers from 1 to 13 and overlay them on top of the existing graph

pastel elm
#

That's more trouble than it is worth. Pure textures and SDF textures are the two ways I would consider

pastel elm
#

bad wording, like just image of the font

normal topaz
#

Oh, fair enough

obsidian thicket
#

Preferably whole word I'd say, unless you really want to have arbitrary letter combinations

normal topaz
#

For simplicity

#

Don't wanna deal with alighning the numbers

obsidian thicket
#

Sidenote, on shadertoy searching "letters" turns up some totally procedural text
I wouldn't dream of doing that with nodes
But SG supports custom nodes too

pastel elm
#

I mean it's not too difficult, just matter of combining basic shapes into a SDF function. Just a lot of work to get all the numbers