Unable to use custom shaders with text elements?

I tried to write a blur shader for my text element following the custom shader tutorial on the playcanvas user manual. However, it looks like the custom shaders only apply to image elements, not text. Please tell me how to apply a shader material to a text element, if possible?

The text rendering uses custom MSDF rendering chunk: https://github.com/playcanvas/engine/blob/main/src/scene/shader-lib/chunks/common/frag/msdf.js

so it would not be easy to replace - I have not looked at an option of doing it so that’s all I can say here.

1 Like

Will released a while ago a 3D (volume) text generator that produces a regular mesh (that will work with custom shaders).

All I need to do is a kind of a glow effect for 2D text, but could not figure out how to implement it within Playcanvas without doing some tricks with shaders and layering, but those do not work either.
Something like this. Not sure the 3D text mesh is a good idea here, it’s a
part of a 2D screen.

The blur effect is expensive and would be taxing on mobile devices. In our games we simply put a backdrop halo sprite behind the number. Looks almost the same, but is times cheaper.

1 Like