regl-project / regl

👑 Functional WebGL
https://regl-project.github.io/
MIT License
5.22k stars 322 forks source link

Add missing `type` parameter to attribute opts #636

Closed rreusser closed 2 years ago

rreusser commented 2 years ago

Resolves #634

Attributes get their type from the buffer. However, if you interleave multiple data types into a single buffer, you may wish to specify different types for different attr uses of the same buffer. Regl attributes support type in order to accomplish this, though the docs don't mention it.

For a working example, see: https://observablehq.com/d/3c5584380a5a42a4

rreusser commented 2 years ago

cc @schroffl. I'm going to go ahead and merge since it does indeed appear supported.