V3.30 Release - palettes, Perlin noise, and much more!

A big update, many features! This release adds gradient palettes, noise, and some transition utility functions.

Gradient palettes.

Define an array with RGB color stops at specified locations and apply it with setPalette(), and use paint() to set the current pixel. For example:

var test = [
  0,    0, 0, 0,   //position start, rgb(0,0,0)
  0.75, 1, 0, 0.5, //position 75%, rgb(1,0,0.5)
  1,    0, 1, 1    // position end, rgb(0,1,1)
]
setPalette(test)
export function render2D(index, x, y) {
  paint(x)
}

Looks like this:
Screen Shot 2022-10-11 at 1.40.51 PM
This is very similar to what @JasonCoon had created and posted about here.
The palette array is live, so some interesting animations can be done by modifying the array.
You can also specify an optional brightness e.g. paint(color, brightness).

Perlin Noise

Perlin and fractal noise functions generate smoothly transitioning random noise between integer values.

Some examples:
perlin(x, y, z, 0):


(red showing negative)

perlinFbm(x, y, 0, 2, .5, 3):

perlinRidge(x, y, 0, 2, .5, 1.1, 3):


perlinTurbulence(x, y, 0, 2, .5, 3):

This can be used for all sorts of textures, like this fire pattern:
Oct-08-2022 10-41-06

Or @zranger1’s Coronal Mass Ejection:
Oct-08-2022 10-40-25

Use setPerlinWrap to control the repeating / wrapping behavior of the Perlin noise functions.

Additional APIs

  • Added mix, smoothstep, bezierQuadratic, bezierCubic functions for all your transition needs.
  • Added a pseudo random number generator prng() which can be seeded with prngSeed().
  • Now render is given an x. For now it’s just index/pixelCount, but will tie into pixel maps and coordinate transforms at some point.
  • Added mapPixels, pixelMapDimensions, has2DMap, has3DMap APIs for waits to get more information about the pixel map.

Fixes and Other Things

  • Increase pattern globals limit to 1024.
  • Improved performance across many areas. You might see a few extra FPS!
  • Fix for networks that give out 192.168.4* addresses.
  • Disabled the OS task watchdog. The watchdog is designed poorly for some workloads, and could trip when things were working smoothly but just a little busy. It’s theoretically possible a bug somewhere could cause things to lock up, but this seems less likely / common than the reboots happening just during a busy workload.
  • Custom MAC address support.

Files for offline install:

12 Likes

Amazing work @wizard! Many thanks to everyone involved in discussing, developing & testing!

1 Like

BTW, I’ve uploaded Perlin Fire (seen above) and Eye of Sauron to the pattern site.

Oct-11-2022 15-24-03

8 Likes

Man this looks amazing, can’t wait to try it out! Superb work by everyone involved!

1 Like

this all looks amazing @wizard - i’m still little fried after the run up to the burn, but looking forward to pulling out the LEDs and applying the updates. really appreciate all the efforts you put in to keep this fresh and updated.

i think the perlin stuff would really enchance my xmas tree decoration this year!

2 Likes

Oh my god. This is gonna look incredible

1 Like

And just in time to get some new patterns written before the Christmas lights go up!
My neighbours will thank you. :slight_smile:

2 Likes

Successfully updated two V3 Pixelblaze from 3.20 to 3.30, also two V2 from 2.28 to 2.29.

Thanks @wizard for making this such a simple process.

Now to start playing with the new V3 features.

1 Like

Dude, I’m getting 8-10 more fps on rainbow fonts in my closet! It’s like he’s a wizard or something…

3 Likes

So i added 3D render and z axis to get it working on the cube and this was the result! Pretty sweet! Now i need to figure out how to rotate it 90 degrees so its projecting from the front and not the top.

Edit FIgured it out! I’m learning! Slowly but getting there!

2 Likes