3 ms·
So I would like someone to correct my understanding if possible Reading the Wikipedia explanation (ok, I have been ill recently) I see a process that given say
by lifeisstillgood 10y ago
So I would like someone to correct my understanding if possible
Reading the Wikipedia explanation (ok, I have been ill recently) I see a process that given say a 2D grid, can assign for each cell in the grid a single number, that number is derived from a function applied to each of its corner nodes.
The function basically assigns a random number around the node (i.e. 360 degrees) and then merges that random with the distance to the point, and then merge that with all four points auchbthat one cell now has one number that is affected by distance, it's neighbours and randomness
I think that pretty clearly gives a smoothed map that will not have the junpiness of random map placements
Seems fairly good way to make a procedural map.
What else is it useful for?
- dahart 10y agoYour description is accurate, but the most important part to know is that the random values on the lattice are used as the derivatives of the noise function. The noise function itself is then an itegral of those derivates. By putting the derivatives at the lattice points, the grid structure underneath becomes far less visible. If you used the random values directly, and just interpolated those using a spline, you get a 0-value derivative at exactly every lattice point, and you end up seeing the grid structure in the result, it becomes glaringly apparent. Using Perlin noise, the minima and maxima are offset randomly from the grid, making the overall function feel much more natural. It's useful any time you need some natural looking randomness in a texture. Perlin noise is standard in pretty much all 3d rendering software for films, and it's becoming quite common for games. The turbulence part of this is when you take a whole stack of Perlin noises at different frequencies, i.e., different grid sizes, and sum them. It's more expensive of course, but this is how to get extremely realistic feeling noise, it gives you medium and high frequencies. And it further hides any grid artifacts. I used Perlin noise as a wind function to animate bushes & trees in the animated movie Madagascar. Perlin actually works really well for windy looking motion because of the way it's derviatives work. I tried a whole bunch of other noise functions, and Perlin was the only one that worked well.
- dahart 10y agoAnother fun application of Perlin noise is fake fluid dynamics. If you take the curl of a Perlin noise field, you get a nice turbulence function that has no divergence. Fluids are usually approximated as being incompressible, and that's part of what makes fluids look fluid. Curl of Perlin can give you a nice fluid-looking turbulence. Curl of any noise is divergence-free, of course, but Perlin works well and looks better than others. Perlin noise is actually more expensive to evaluate than a real fluid simulation. The fun/important part is that Perlin is static, so there's no simulation and you can render your frames out of order and in parallel. With a fluid simulation, each sim frame depends on the previous one. Fake curly noise is also easier to set up and tune than a fluid sim. I and others have used this technique on lots of films for quick turbulent smoke, fog, and particulate effects.
- lifeisstillgood 10y agoThank you for your replies - I will try writing my own perlin generator for something. I am taking a break from HN for a few weeks, and would not have replied but I just wanted to say the ability to ask a question and get back "yeah I used this technique on that movie you saw" is something no other forums provide. It's awesome. I will smile as I take my screen break. Cheers