[Explained] Perlin Noise and Unity

preview_player
Показать описание
Over the past month or so, I have been working with Perlin Noise all because I watched this video by Sam Hogan:

Turns out creating randomly generated terrain is mostly based around Perlin Noise. Also, turns out that Perlin Noise is really easy to use if you don't make Youtube videos and have to explain why things work.

One month later and I finally complete understand almost every aspect of Perlin Noise and here we are. I still have made Minecraft in a day, though.

Here's a bunch of links that made this video a lot easier:

Sebastian Lague's 21 Part Series:

PBS Infinite Series - Pseudorandom Numbers:

George Washington Video - Kensuke Koike:

Sebastian Lague - 3 Simulations:

One of the best articles about Perlin Noise:

Unit Vectors - Math is Fun:

Unit Circles - Math is Fun:

Component Form of a Vector:

Calculate Magnitude:

Dot Product Calculation - Math is Fun:
Рекомендации по теме
Комментарии
Автор

> here is a screenshot of a code if you want to copy it
Ah, I see you're a man of culture as well

ichikunk
Автор

WHAT
i looked down at your subscription counmt and you desperately need about a thousand times more
PLEASE make more

crckrbrrs
Автор

Awesome video! really well explained and clear to understand and focus on. sad there hasnt been a part 2 released yet tho.

griffinvella
Автор

Great and professionally presented video!
May I ask you some mathematical questions regarding some parts of your video?
Thank you.

ian.ambrose
Автор

what a nerdy video. loved it. also, very well explained.

MSouzaGameDev
Автор

Nice work, really !! Still waiting for part 2

simondhoine
Автор

Good explanation in this video! Sebastian's videos are good but your explain it a lot better! Hope part two comes soon :)

tipler
Автор

I'm looking forward for the next part!

olaxe
Автор

Your videos are amazing you deserve more views!

dood
Автор

Your videos are awesome. Keep it up! :)

Auios
Автор

Why do you have so little followers? This is a top notch coding Youtube channel, you should have blown up by now!

kech-agmaio
Автор

I figured on my own how to make 4 Perlin Noise generators in PYS60 (Python for Nokia) many years ago.
The first one is from having a floating-point variable representing the bell curving offset by at least by 5 pixels to see it beautifully.
The 2nd and 3rd is quite the same as the 1st... but made into 2D and 3D.
The 4th... is from layering sine waves of various sizes which I can have absolute control of... and also can seamlessly wrap around, able to even make animated 3D blobs.

ThankYouESM
Автор

this tutorial was confusing or im stupid but why is it looking around for neighbouring points and they are all aligned so wont it make so it will be 0.5?

rediculaid
Автор

Thanks for your response! Here are my (rather lengthy) questions.
I’m not a programmer and all the questions below are purely for mathematical understanding purposes. I also skipped all the coding parts because I don’t understand them.

Q1.
3:21 People call this random vector (arrow) as “Gradient” Vector, do you have any idea on why it’s called that?

Is it because it’s involved in the Dot Product to create values that form a gradual transition (aka a “gradient”) inside a cell (aka grid tile)?

Q2.
3:28 You said that the Dot Product values inside a cell has the Range of [0, 1], but there’s always a chance for Dot Product to output negative values, isn’t it?

Q3.
(Please read the whole Q3 before answering)
3:30 About the “4 cells forming *ONE* gradient”, doesn’t *EACH* (sorry, I'm not screaming, I'm emphasizing) cell have its own “gradient”? Like it’s illustrated in this video's timestamp here: youtu.be/ZsEnnB2wrbI?t=577

As explained in many other videos, the visual “gradient” we see is formed by placing hundreds of pixels (that are evaluated by performing Dot Product between one Gradient Vector and hundred of distance vectors) together.
Each cell (aka grid tile) possesses 4 Gradient Vectors at its 4 corners, if we are using only 1 out of 4 to create a “gradient”, that means each cell has a completely separate “gradient” (4 Gradient Vectors means 4 different “gradient”) from the neighboring cells, that means there will be a sudden jump in value at the border in between 2 cells, leading to the visual that you see in the link I sent above.
To visually smooth out those “sudden jumps”, we use Linear / SmoothStep / SmootherStep Interpolators.

Does *your* Perlin Noise use the same algorithm that I addressed above? If it does, then there’s no way that the gradients of 4 adjacent cells would connect that smoothly as you illustrated. Also, if the transitions of values between cells were that smooth, then there would be no reason for any interpolator to be involved because there’s no sudden transitions at the borders.

OR, were you showing what it would look like if *ONE* Gradient Vector was used to perform Dot Product with *ALL* distance vectors across *ALL* cells instead of just the distance vectors inside of *ONE* cell?

Q4.
I’ve watched and read almost 20 videos / articles and you are the only person to say that Perlin Noise function interpolates the Dot Product values using Cosine Interpolator, whereas all other resources said the interpolators were either SmoothStep or SmootherStep Interpolator.
Or is your video here specifically made for Unity’s Perlin Noise implemented function? I’m not familiar with Unity though.

Thank you so much!

ian.ambrose
Автор

This video would have been great to see two years ago. I also home brewed a Perlin noise function for a game I’m making. For my random function, I had a very long array deterministic “random” values, and I pull values from the array using a sort of shifting cipher algorithm, so that the values don’t repeat themselves as I get farther away. Otherwise it just uses normal bilinear interpolation.

pirateskeleton
Автор

+1 sub
*Don't be discourage from nerding out ;)

sekvojs
Автор

Wow cool, could you make one for Simplex noise too? and other noises as well hahaha, this is easier to understand

daedalusrasmus
Автор

This was very good. Coming from a novice, I just want to understand how Text to image AI like MidJourney/Stable Diffusion works. Thanks.

FilmFactry
Автор

I’m tracking so far you know how to teach

ezwelds-gt
Автор

good video. too bad you never made the follow up video tho.

jozejerse