# Custom attributes for ShaderMaterial

**URL:** <https://forum.babylonjs.com/t/custom-attributes-for-shadermaterial/6303>\
**Category:** Questions\
**Created:** [October 12, 2019, 2:01am UTC](https://forum.babylonjs.com/t/custom-attributes-for-shadermaterial/6303 "2019-10-12T02:01:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheLeftover](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@TheLeftover](https://forum.babylonjs.com/u/TheLeftover)\
**Post date:** [October 12, 2019, 2:01am UTC](https://forum.babylonjs.com/t/custom-attributes-for-shadermaterial/6303/1 "2019-10-12T02:01:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [October 12, 2019, 2:10pm UTC](https://forum.babylonjs.com/t/custom-attributes-for-shadermaterial/6303/2 "2019-10-12T14:10:34Z")

</div>

Yes let me look for some of my old scenes

[https://www.babylonjs-playground.com/#3D3RPL#43](https://www.babylonjs-playground.com/#3D3RPL#43)

Something like this?

---

<div class="post-metadata">

**Author:** ![TheLeftover](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@TheLeftover](https://forum.babylonjs.com/u/TheLeftover)\
**Post date:** [October 12, 2019, 3:05pm UTC](https://forum.babylonjs.com/t/custom-attributes-for-shadermaterial/6303/3 "2019-10-12T15:05:53Z")

</div>

Bingo!

Thank you, Pryme8.

---

<div class="post-metadata">

**Author:** ![TheLeftover](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@TheLeftover](https://forum.babylonjs.com/u/TheLeftover)\
**Post date:** [October 15, 2019, 5:43pm UTC](https://forum.babylonjs.com/t/custom-attributes-for-shadermaterial/6303/4 "2019-10-15T17:43:44Z")

</div>

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.

[https://www.babylonjs-playground.com/#QCLQFN#39](https://www.babylonjs-playground.com/#QCLQFN#39)

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.
