# itemSize \< 1: itemSize of BufferAttribute for polygon-wise attribute

**URL:** <https://discourse.threejs.org/t/itemsize-1-itemsize-of-bufferattribute-for-polygon-wise-attribute/4892>\
**Category:** Questions\
**Tags:** geometry\
**Created:** [November 10, 2018, 11:44am UTC](https://discourse.threejs.org/t/itemsize-1-itemsize-of-bufferattribute-for-polygon-wise-attribute/4892 "2018-11-10T11:44:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fda](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fda/32/27023_2.png) [@fda](https://discourse.threejs.org/u/fda)\
**Post date:** [November 10, 2018, 11:44am UTC](https://discourse.threejs.org/t/itemsize-1-itemsize-of-bufferattribute-for-polygon-wise-attribute/4892/1 "2018-11-10T11:44:25Z")

</div>

Hi,

`THREE.BufferAttribute` takes `typed array` and `itemSize`. In my understanding, `itemSize` is the number of elements assigned for each vertex (e.g. `itemSize = 3` for position array because a vertex requires three values x, y and z)

Now I have a rectangle which is a collection of 4 vertices. I want to add attribute, say, `isClickable` to each rectangle.

A naive way is to set itemSize 1 and repeat same `isClickable` value 4 times.

```auto
isClickableArray = [0, 0, 0, 0, 1, 1, 1, 1 ...]

```

This is apparently inefficient because 4 vertices use same value. However, itemSize cannot be less than 1.

How can I assign same attribute to 4 vertices?

Thanks

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [November 10, 2018, 12:40pm UTC](https://discourse.threejs.org/t/itemsize-1-itemsize-of-bufferattribute-for-polygon-wise-attribute/4892/2 "2018-11-10T12:40:36Z")

</div>

> [@fda](#):
>
> How can I assign same attribute to 4 vertices?

AFAIK, something like this is not possible. If you render your rectangles as separate meshes, you might want to use instanced rendering. You would define the rectangle’s vertices just once and then use an `InstancedBufferAttribute` to define a single value (`clickable`) per instance. The following example demonstrates this approach:

[https://threejs.org/examples/#webgl\_buffergeometry\_instancing](https://threejs.org/examples/#webgl_buffergeometry_instancing)
