# Noise function?

**URL:** <https://forum.electromage.com/t/noise-function/420>\
**Category:** Feature Ideas + Requests\
**Created:** [June 18, 2020, 4:42am UTC](https://forum.electromage.com/t/noise-function/420 "2020-06-18T04:42:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![KanyonKris](https://forum.electromage.com/user_avatar/forum.electromage.com/kanyonkris/32/265_2.png) [@KanyonKris](https://forum.electromage.com/u/KanyonKris)\
**Post date:** [June 18, 2020, 4:42am UTC](https://forum.electromage.com/t/noise-function/420/1 "2020-06-18T04:42:45Z")

</div>

I want to create an organic pattern like plasma or lava. Many examples use a noise function (like Perlin noise). Is a noise function required or are there other ways to do this?

Here’s an example project that used a noise function - [https://www.instructables.com/id/LED-Flame-Controlled-by-Noise/](https://www.instructables.com/id/LED-Flame-Controlled-by-Noise/)

---

<div class="post-metadata">

**Author:** ![jeff](https://forum.electromage.com/user_avatar/forum.electromage.com/jeff/32/3473_2.png) [@jeff](https://forum.electromage.com/u/jeff)\
**Post date:** [June 18, 2020, 5:24am UTC](https://forum.electromage.com/t/noise-function/420/2 "2020-06-18T05:24:02Z")

</div>

That’s funny, I was just in a wikipedia hole last night on OpenSimplex, Worley noise, and diamond-square.

I don’t think these are based on Perlin noise, but check out the “plasma 3D” and “cube fire 3D” patterns in the pattern library. Both render down to 2D.

I think they’re based on the Plasma concept in the [bidouille.org](http://bidouille.org) link in [this post](https://forum.electromage.com/t/help-with-creating-a-noise-pattern/139/2).

---

<div class="post-metadata">

**Author:** ![KanyonKris](https://forum.electromage.com/user_avatar/forum.electromage.com/kanyonkris/32/265_2.png) [@KanyonKris](https://forum.electromage.com/u/KanyonKris)\
**Post date:** [June 18, 2020, 7:18am UTC](https://forum.electromage.com/t/noise-function/420/3 "2020-06-18T07:18:42Z")

</div>

@jeff thanks for the reply.

From the previews both Plasma 3D and Fire Cube 3D look interesting, but they both render poorly on a LED strip.

I’m hoping for something that looks like a 1 pixel horizontal or vertical slice from something like this;

> **[File:-PLASMA-ColorCycling.Gif](https://commons.wikimedia.org/wiki/File:-PLASMA-ColorCycling.Gif)**

---

<div class="post-metadata">

**Author:** ![jeff](https://forum.electromage.com/user_avatar/forum.electromage.com/jeff/32/3473_2.png) [@jeff](https://forum.electromage.com/u/jeff)\
**Post date:** [June 18, 2020, 7:45am UTC](https://forum.electromage.com/t/noise-function/420/4 "2020-06-18T07:45:09Z")

</div>

Here’s a Perlin noise generator I just ported.

[Perlin Noise 2D.epe](https://forum.electromage.com/uploads/short-url/qNuK7hsfb05n8eTKFKQ7brPaiie.epe) (10.8 KB)

It’s not up to my normal standards for posting to the patterns library, but it seems to be working!

I threw in a 1D render() for you to try out as well.

Note that I think most plasma effects, including the one you posted, will be cycling a thinner stripe through the Perlin’s height map output. I’m only cycling hues through it, then panning the viewport through the noise in a circle.

---

<div class="post-metadata">

**Author:** ![KanyonKris](https://forum.electromage.com/user_avatar/forum.electromage.com/kanyonkris/32/265_2.png) [@KanyonKris](https://forum.electromage.com/u/KanyonKris)\
**Post date:** [June 20, 2020, 1:56am UTC](https://forum.electromage.com/t/noise-function/420/5 "2020-06-20T01:56:35Z")

</div>

@jeff that’s good coding there.

It looks good on your 2D LED matrix but not so good on a strip. Might look better with a denser 144/m strip but with the gaps in my 60/m strip it doesn’t look smooth. The pattern on the strip just kind of sloshes back and forth, which makes sense looking at the 2D matrix. I had some fun messing with your code but never came up with anything good. It may not be possible to get a good plasma on a 60/m strip. I did enjoy digging into your code, I learned a lot. Thanks for giving me so much code to tinker with.

---

<div class="post-metadata">

**Author:** ![jeff](https://forum.electromage.com/user_avatar/forum.electromage.com/jeff/32/3473_2.png) [@jeff](https://forum.electromage.com/u/jeff)\
**Post date:** [June 28, 2020, 7:04am UTC](https://forum.electromage.com/t/noise-function/420/6 "2020-06-28T07:04:08Z")

</div>

Hey @KanyonKris -

I tidied things up, added a lot of parameters for tuning, and also put up a specialized 1D version that looks decent on strips.

Here’s [the post](https://forum.electromage.com/t/perlin-simplex-noise-plasma-effect/434).
