block by 1wheel 9b3bcc4ce8266913c0a0ddd4120a41de

regl-ladder-2

Full Screen

Passing arrays of attributes:

attributes: {
  p: () => data.map(({x, y1, dy, isB, speed}) => 
    [x, y1, dy + isB, speed]
  ),
},

is way faster than passing in seperate properties - 100,000 points at 60 fps instead of 14,000.

attributes: {
  speed: () => data.map(d => d.speed),
  x:  () => data.map(d => d.x),
  y0: () => data.map(d => d.y0),
  y1: () => data.map(d => d.y1),
  dy: () => data.map(d => d.dy),
  isB: data.map(d => d.isB)
},

_script.js

index.html