Direct access to Pixel Buffer?

There’s no buffer so that each pixel can be sent out on the wire immediately after the call to render().

However you can easily make your own framebuffer, as in, just for example:

I looked through my patterns and … yeah I do it several different ways depending on the shape of the LED strip and how the beforeRender process accesses the pixels.

For example for a sword that has a total of 288 pixels up one side and down the other, I have a ‘framebuffer’ of 144 pixels which are all calculated in beforeRender (for motion blur and stuff like that), and then the render function is just … (hPc is half pixelcount)

export function render(index) {
  // The PB is at one end of the strip, and the strip is folded in half
  // Use "^hPc - [...]" instead of "[...] - 1$" if PB is at the other end
  pindex = ( (index < hPc) ? (hPc - index) : (index - hPc + 1) ) - 1

  rgb(fb_Red[pindex], fb_Green[pindex], fb_Blue[pindex])
}
1 Like