Placeholder Image

Subtitles section Play video

  • - Hello! Now, this video has been a long time coming,

  • because let me tell you something:

  • I've been living in the past.

  • I've been living in 1983 my whole life,

  • I mean, I didn't live in 1983 for ten years of my life,

  • then I actually lived in 1983, and then the years

  • went on, but since then, or at least

  • for the recent times in those--

  • making those coding training videos about Perlin Noise,

  • I was living in 1983, '83 all on,

  • and I sort of knew that but I never really bothered

  • to look into it, I didn't want to know,

  • I didn't want to know about what's happening since 1983.

  • (laughs)

  • I, am going to update my life, right now,

  • and your life too, 'til the year 2001,

  • and actually more like the year 2014

  • and all they way to the present, because today,

  • I'm going to unpack what it means,

  • to the best of my ability, what is--

  • what is the difference between

  • the original Perlin Noise implementation of 1983,

  • something that came out in 2001, which is an updated version

  • of Perlin Noise called Simplex Noise by Ken Perlin himself,

  • and some open-source implementations

  • that have been made more recently,

  • notably by Kurt Spencer called Open Simplex Noise.

  • So, (chuckles) a lot of stuff to cover here, this video

  • will be approximately 71 hours and 32 minutes long,

  • I hope you enjoy it.

  • 1983, the original Perlin noise,

  • a type of what's known as gradient noise,

  • was developed by Ken Perlin in 1983,

  • um, Ken Perlin won an Academy award for this work.

  • It is the-- the algorithm that Ken Perlin invented in 1983

  • forms the basis for the source code,

  • the implementation that's in processing itself

  • and all these videos I've made about Perlin noise.

  • Where I first learned about, uh,

  • how the Perlin noise algorithm actually worked was from

  • an article written by Hugo Alias.

  • This page is no longer on the internet,

  • but you can find it through web.archive.org.

  • This is a wonderful introduction, noise functions,

  • talks about, uh, random sampling, interpolation,

  • amplitude and frequency, octaves,

  • and looks at this kind of gradient-smoothing process

  • that happens to create Perlin noise and explains

  • why you get these sort-of patterns.

  • How all this stuff works--

  • there's actually even imputation.

  • So. But I am not going to go through this today.

  • Um, I will point you to the idea of gradient noise.

  • This is a key idea, because the idea of Perlin noise

  • is to smooth gradients, in perhaps what-

  • well let's say we'll consider here two-dimensional space,

  • to smooth gradients within a two-dimensional space.

  • Squares on a grid,

  • this is how we usually think of a 2D space.

  • The reason why I'm highlighting this is because

  • this idea of how this space is oriented,

  • the geometry of this space is the key distinction

  • between classic, (chuckles) what I like to call,

  • classic Perlin noise and Simplex noise.

  • Alright, so we'll come back to that.

  • Next stop on my, uh, Wikipedia Tour, (laughs)

  • is the page for Simplex noise.

  • So Simplex noise is an algorithm for constructing

  • n-dimensional noise. It's comparable to Perlin noise

  • created by Ken Perlin himself.

  • But the key element here is fewer directional artifacts.

  • So what do I mean by directional artifacts?

  • Maybe you've noticed this in some of the videos that

  • I've done before. Let me pull up this processing sketch.

  • Look at this. Does it feel like it has this--

  • this is--

  • um, two--

  • I'm visualizing two-dimensional noise using a

  • third-dimension of noise as slices of animation.

  • Do you feel this, like, kind of bouncing,

  • like it's kind of like, herky-jerky?

  • Classic Perlin noise is kind of herky-jerky,

  • it kind of gets to a point where it stops, it bounces.

  • That, the sort of visual quality of a

  • directional artifact. It doesn't feel

  • smoothly continuous over long periods of time.

  • And so this is really the innovation of Simplex noise.

  • Now the innovation has to do with, um,

  • Symplectic geometry, which is really,

  • and this is actually in an article that I'll refer to, but

  • a Simplex grid looks like this.

  • So the core innovation is the idea that

  • instead of smoothing the noise,

  • calculating these gradients over a

  • square grid, a rectangular grid,

  • a tiled system of equilateral triangles,

  • and there's lots of variations of this.

  • And this also generalizes to multiple dimensions,

  • and Symplectic-- Symb-- (laughs)

  • I can't say that word, but Symplectic geometry,

  • which maybe even will be at topic for another day.

  • I do want to highlight the work of Stefan Gustavson,

  • um, who is, uh, a computer graphics researcher.

  • In particular, uh, the page of documents on Simplex noise,

  • and this PDF, which I'll scroll all the way back to the top

  • called Simplex Noise Demystified.

  • So, I've read this (stifled laugh) on the subway home

  • last night, and on the subway to work this morning,

  • (chuckles) um, and, so I have some picture in my mind

  • of how this works, I probably need to read it about

  • 73 times more, but um, this will give you

  • much more background into the difference between

  • classic noise, which there's a nice, uh,

  • and you can see here, this idea of these gradients,

  • and Simp-- Simplex noise, and how the tiling system works in

  • multiple dimensions. So I encourage you to check that out.

  • Now one of the oddities about Simplex noise

  • is that there's a patent for it.

  • This, if I'm correct, is the patent. Patent US6867776B2.

  • Inventor: Kenneth Perlin. You can download the PDF.

  • Uh, this was filed in 2001,

  • at the time of the invention of Simplex noise.

  • Um, and there's, uh--

  • (stutters)

  • This is an apparatus for generation an image.

  • The apparatus includes a computer.

  • The apparatus includes a display connected to the computer,

  • upon which images from the computer appear--

  • I will stop doing a dramatic reading of this patent.

  • And so, to me, I'm not a lawyer, I'm not an expert in this,

  • but it's unclear to me what it would mean to use

  • these sort of like, literal version of

  • the Simplex noise algorithm, which is described

  • in great detail here, in the patent,

  • in, say, a processing library or processing sketch

  • in an open-source environment.

  • So there is, fortunately, a post that was on Reddit that

  • I found from four years ago, from 'KdotJPG',

  • which is a post about this new version

  • of what's called Open Simplex noise.

  • So this algorithm is very similar, it's highly correlated

  • and relates to the Ken Perlin Simplex noise,

  • but there are some key differences. And this--

  • the code for this algorithm is published here,

  • on 'KdotJPG's GitHubGist "OpenSimplexNoise.java"

  • (bell rings) Java! And which means I can use this

  • in process 'cause it's Java, and if you scroll down--

  • (laughs) first you can look and be like, "Whoa!"

  • You got to love anything that has a variable named

  • 'SQUISH_CONSTANT_3D'-- muah!

  • That is a beautiful variable name.

  • Um, but what I want to do is highlight down here.

  • I looked, I looked, I looked, uh,

  • (chuckles) keep going, there's a lot of code,

  • Whoa! There's a lot of code! Oh my God!

  • Scroll, scroll, scroll!

  • Ah! Test, and then here.

  • "This is free, unencumbered software

  • released into the public domain."

  • So, I believe this is something that I can use, and

  • I'm going to use it in the context of this video.

  • Boy, that was a lot of explanation.

  • So, what does this mean?

  • I want to do another video after this one,

  • which is I just find every single piece of code I ever wrote

  • using the classic Perlin noise function,

  • and try-- do it again with Open Simplex noise.

  • But I'll just do that for one thing right now.

  • Alright, let me go here: 'Raw'.

  • Let me do a nice, big 'copy/paste'.

  • I'm going to go to processing because processing--

  • this is the sketch, I want to-- whoops!

  • I want to change this particular sketch from Perlin--