# Custom bufferAttributes?

**URL:** <https://discourse.threejs.org/t/custom-bufferattributes/23772>\
**Category:** Questions\
**Tags:** buffergeometry, custom-data, bufferattributes\
**Created:** [February 23, 2021, 9:55pm UTC](https://discourse.threejs.org/t/custom-bufferattributes/23772 "2021-02-23T21:55:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prominent](https://avatars.discourse-cdn.com/v4/letter/p/f08c70/32.png) [@prominent](https://discourse.threejs.org/u/prominent)\
**Post date:** [February 23, 2021, 9:55pm UTC](https://discourse.threejs.org/t/custom-bufferattributes/23772/1 "2021-02-23T21:55:25Z")

</div>

> # BufferAttribute
> 
> This class stores data for an attribute (such as vertex positions, face indices, normals, colors, UVs, and any custom attributes )

So I assume I can do such as:

```
	geometry.setAttribute( 'giraffe', new THREE.Float32BufferAttribute( giraffeArray, 3 ) );

```

Right?

---

<div class="post-metadata">

**Author:** ![marquizzo](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/marquizzo/32/25192_2.png) [@marquizzo](https://discourse.threejs.org/u/marquizzo)\
**Post date:** [February 23, 2021, 10:05pm UTC](https://discourse.threejs.org/t/custom-bufferattributes/23772/2 "2021-02-23T22:05:58Z")

</div>

That’s exactly right. Then you have to declare this attribute in your vertex shader with  
`attribute vec3 giraffe;`  
so you can use it in the shader.

---

<div class="post-metadata">

**Author:** ![prominent](https://avatars.discourse-cdn.com/v4/letter/p/f08c70/32.png) [@prominent](https://discourse.threejs.org/u/prominent)\
**Post date:** [February 23, 2021, 10:08pm UTC](https://discourse.threejs.org/t/custom-bufferattributes/23772/3 "2021-02-23T22:08:26Z")

</div>

cool, thanks!
