pmndrs / drei

🥉 useful helpers for react-three-fiber
https://docs.pmnd.rs/drei
MIT License
8.27k stars 682 forks source link

`<Instances>` seems to have a hard-coded limit of 1000 instances #1750

Open gewesp opened 9 months ago

gewesp commented 9 months ago

Problem description:

<Instances> hard-codes max number of instances to 1000. We ran into a problem with more child objects silently being dropped.

Relevant code:

https://github.com/pmndrs/drei/blob/master/src/core/Instances.tsx#L108

Suggested solution:

Use children.length as the default?

isaac-mason commented 9 months ago

You can change the default with the limit prop.

e.g.

<Instances limit={10000} {/* ... other props ... */} >
  {/* ... */}
</Instances>

See: https://github.com/pmndrs/drei/blob/master/src/core/Instances.tsx#L24

gewesp commented 8 months ago

You can change the default with the limit prop.

Thanks, we had figured that already. Still, I see no good reason why it should specifically be limited to 1000 and it definitely should not silently drop more instances.