Text effects, sprite effects

Hello!

A few simple requests :slight_smile: It would be cool to have additional effects for text elements, such as gradients and bevel. Otherwise, a tutorial on rolling your own shader (for element text/sprite) would be cool. Ie, i assume you would want to extend the exisiting shaders and add features to them.

It would also be great with the same kind of effects on sprites/textures.

Thanks!

2 Likes

That’s a good suggestion @Mr_T!

Indeed some documentation on how to use and extend the shader chunks system would be nice to have. For start, you could check out the following two sample projects that do something like that:

https://developer.playcanvas.com/en/tutorials/tutorial-plasma-shader-chunk/

https://developer.playcanvas.com/en/tutorials/warp-a-sprite-with-glsl/

And here is the repo folder where all shader chunks that can be extended reside:

1 Like

God, you’re fast! :smiley:

Thanks for the tip, I’ll check it out!

Something like TextMesh Pro for Unity would be great, though. Idea for your next plugin? :wink:

1 Like

That would be cool indeed, I am all in for fancy text effects. More reasons to go for the Playcanvas UI instead of HTML/CSS.

1 Like

I made it work, sort of: https://playcanvas.com/editor/scene/843741

Just copied the msdf.frag, changed the color and overwrote the chunk. The uv wasnt exactly what I was expecting, but I’m sure I’ll figure it out. Not entirely sure that using element._text._material is the way to go, but was the only way I could find :slight_smile:

1 Like

Bravo! That’s the beauty of the shader chunk system. It lets you focus directly in writing the effects without having to worry about boilerplate code, lighting support etc.

I haven’t played with the msdf.frag to help you out with that, but good work to getting started :wink:

2 Likes