Perlin / Simplex Noise (plasma effect)

In a few other threads, people have asked about a plasma effect or Perlin noise generation. I dug in to learn about procedural gradient noise.

I think this really shows the power of the (relatively) new UI controls we can put in our patterns. They were really useful for debugging. I also added a sound-reactive pulser.

Separate 1D and 2D code is up on the pattern library.

Demo

Understanding Perlin noise generation

This video was helpful in understanding what Perlin noise really is.

Appreciation

Thank you to Stefan Gustavson, the original author of the JavaScript Perlin library I ported for this.

1 Like

FYI @dllnoah since you asked about this 6 months ago; I think you can achieve your screenshot with a few modifications of this code. If you have a big matrix, I can volunteer a few hours to help adapt it.

Plus, you can mess with the parameters from your phone using the sliders on mobile.

1 Like

Wow, this is really cool! I can’t wait to play around with this! And the controls are :ok_hand: what a great way to explore these noise functions!

1 Like

@jeff excellent work! The 1D version looks great on my 60 LED/m strip, very plasma-like. Thanks for digging into this topic and producing such a good pattern.

For those who are curious (I was)

And a js implementation

I have not compared this to @jeff’s version but it does do 3d and even 4d noise.

(I went down a rabbit hole on tixy.land code and found 3d version of it, hi res version of it, and more… and this was part of the rabbit hole.)

1 Like

VERY cool. I’ve been wanting to play with this some more since you started this rabbit hole adventure.

I was checking his code… fascinating…

var F2 = 0.5 * (Math.sqrt(3.0) - 1.0);
var G2 = (3.0 - Math.sqrt(3.0)) / 6.0;
var F3 = 1.0 / 3.0;
var G3 = 1.0 / 6.0;
var F4 = (Math.sqrt(5.0) - 1.0) / 4.0;
var G4 = (5.0 - Math.sqrt(5.0)) / 20.0;

which might make sense for readability of what he is doing… but those can all be simplified and should offer a little speedup… though they only seem to be executed once.

You know, if memory serves, I saw this one but didn’t use it because I read that simplex noise has IP legal issues for use in 3 dimensions and higher. I’m wondering if I’ve got that wrong or these folks are just playing fast and loose? The Wiki for it seems to say it’s a patented algo for 3+D, which means copyright aside you can’t implement it (I think…)

Anybody more of an expert?

Yay, software IP! A world of fun! Chances are nobody will mess with you for just writing the program, but associating it with a for-profit commercial product is asking for a cease-and-desist at least. It looks like the patent expires in January 2022, but for the moment, it’s owned by a patent troll firm. That’s um, not good. (google “wsou investments troll”)

---- STOP HERE TO DODGE SOFTWARE IP LAW TL;DR –
(Speaking as someone who patented a pile of things for a major corporation: (1) software patent law is deeply annoying and silly, and desperately needs reform, (2) the big guys take protecting their IP really, really seriously, and (3) patent trolling is a huge problem for everybody.

The big companies may seem like malevolent jerks, but what they’re actually doing is protecting themselves from each other – if Apple lets a little infringement slide by just once, Samsung can and will nuke them with that fact in court, and then Apple may lose incredibly profitable rights to something they invented. Shareholders pretty much insist that companies protect those rights.

It’s a very, very expensive game to play – terrible for smaller players. And patent troll companies, who buy up patents and use them to sue everybody in sight, big or small, make it even worse. Best to avoid poking lawyers when possible.)

1 Like

Hey Jeff thanks for the support. I am working on a display box and I want it to have a living breathing sort of feel to the patterns.

Here is a little vid of what I’m doing.

Video LINK

4 Likes

Gorgeous. How granular are your LEDs? (What size is the matrix behind them?)

This is so satisfying to watch!!! What a cool box.

According to

FastLED uses simplex noise, so… Patents be damned, let the LEDs shine freely.

That said, I suspect a non-commercial implementation is unlikely to have any issues. But I’m not saying Ben should add a noise function to the firmware/PB functions. Ok, actually he should, but something he doesn’t worry about the patent on.

It’s 32x16. The cells are tubes of rolled mirror film and the led array is set in a slight V shape with the top of the V close to the edges and the bottom set back about 5cm. This helps to diffuse and mix the colors as well as give a slight sense of depth.

2 Likes

Yeah, I thought so, it felt/looked like it wasn’t flat. Great job.