Custom attributes for ShaderMaterial

Is there a playground example somewhere of using ShaderMaterial, injecting additional custom attributes into the vertex shader?

I saw a recipe described by DeltaKosh, that says to create a vertex buffer and use mesh.setVerticesBuffer(). Makes sense.

Still, a working playground would save me fumbling around to get the syntax right. Been searching for an example of the recipe in action for a while. No joy so far.

All guidance appreciated.

Yes let me look for some of my old scenes

Something like this?



Thank you, Pryme8.

BTW, Pryme8, your example was pretty rad!

My goal was to test out the linkages of using shaders for text. This uses a text atlas but might possibly have applications for sprites.

Again, this is just to check out the mechanism. I have done work on “pretty font rendering” elsewhere. The two could eventually be grafted together.

1 Like