# VTK.js: Is there actor limit for HardwareSelector?

**URL:** https://discourse.vtk.org/t/vtk-js-is-there-actor-limit-for-hardwareselector/1572
**Category:** Web
**Created:** [August 13, 2019, 9:51am UTC](https://discourse.vtk.org/t/vtk-js-is-there-actor-limit-for-hardwareselector/1572 "2019-08-13T09:51:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rvilums](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rvilums/32/688_2.png) [@rvilums](https://discourse.vtk.org/u/rvilums)
#### Post date: [August 13, 2019, 9:51am UTC](https://discourse.vtk.org/t/vtk-js-is-there-actor-limit-for-hardwareselector/1572/1 "2019-08-13T09:51:14Z")

</div>

Hi,

I have a lot of actors in the renderer. When a number reaches around 150, `HardwareSelector` still returns selection object, but `selection.getProperties().prop` returns `null`, not the picked actor.  
What could be the reason for this?

I created a codepen example: [https://codepen.io/raimonds-vilums/pen/oKOMap](https://codepen.io/raimonds-vilums/pen/oKOMap)  
See the console log for the results.

---

<div class="post-metadata">

### Author: ![rvilums](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rvilums/32/688_2.png) [@rvilums](https://discourse.vtk.org/u/rvilums)
#### Post date: [August 20, 2019, 4:15pm UTC](https://discourse.vtk.org/t/vtk-js-is-there-actor-limit-for-hardwareselector/1572/2 "2019-08-20T16:15:39Z")

</div>

I suspect this is because of rounding errors when color values are converted from `int` to `float` and back.  
In `HardwareSelector/index.js`:  
`setPropColorValueFromInt() => getPixelData() => convert()`

Based on experiment, I’ll use the following hack in `getPixelInformation()`:

```
if (actorid % 256 > 143) {
  actorid -= 256;
}
```

---

<div class="post-metadata">

### Author: ![ken-martin](https://discourse.vtk.org/user_avatar/discourse.vtk.org/ken-martin/32/884_2.png) [@ken-martin](https://discourse.vtk.org/u/ken-martin)
#### Post date: [August 20, 2019, 4:55pm UTC](https://discourse.vtk.org/t/vtk-js-is-there-actor-limit-for-hardwareselector/1572/3 "2019-08-20T16:55:06Z")

</div>

Thanks! I have a fix, should be merged soon. See [https://github.com/Kitware/vtk-js/pull/1185](https://github.com/Kitware/vtk-js/pull/1185)

---

<div class="post-metadata">

### Author: ![rvilums](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rvilums/32/688_2.png) [@rvilums](https://discourse.vtk.org/u/rvilums)
#### Post date: [August 21, 2019, 7:11am UTC](https://discourse.vtk.org/t/vtk-js-is-there-actor-limit-for-hardwareselector/1572/4 "2019-08-21T07:11:24Z")

</div>

Thanks, it works now! 👍
