I had previously talked in detail about Perlin Noise and its properties, here. Now in this blog post I will write about the implementation. My implementation is based on an excellent writeup which I found in this link (http://webstaff.itn.liu.se/~stegu/TNM022-2005/perlinnoiselinks/perlin-noise-math-faq.html).
Perlin noise is a function for generating coherent(smooth) noise over a space. I've have come across multiple implementations of Perlin Noise function and most of them are based on smoothing of multiple noise functions to generate a coherent noise. The one I am discussing in this blog post is alittle different and more or less conforms with the original implementation that Ken Perlin came up with.
In the figure, (x0,y0), (x1,y1), (x0,y1), (x1,y0) represents grid points and (x,y) lies inside a grid.
g(xgrid, ygrid) = (gx, gy)
These gradients can be visualized as:
vec00 = (x-x0,y-y0);
vec01 = (x-x0,y-y1);
vec10 = (x-x1,y-y0);
vec11 = (x-x1,y-y1);
The influence can be calculated by performing dot operation on the gradient and the vector as:
s = g(x0, y0) · vec00;
t = g(x1, y0) · vec10;
u = g(x0, y1) · vec01;
v = g(x1, y1) · vec11;
Sx = smoothParam(x-x0);
and also at (y-y0) as:
Sy = smoothParam(y-y0);
where smoothParam(p) = 3p2 - 2p3 , then parameter representing weighted average of s and t is obtained by constructing a linear function mapping 0 to s and 1 to t, and evaluating it at our x dimension weight Sx. We call this ax.
ax = s + Sx*(t - s);
We also calculate bx using u and v as:
bx = u + Sx*(v - u);
Then the final result z can be obtained as:
z = ax + Sy*(bx - ax);
Short Description
Fig: Perlin Noise(left), Noise(right)
Requirement
Perlin Noise (2D) function is a function that takes two points (x and y) and returns a noise value (say z). x, y and z are all floating point numbers.The Grid
The concept of accepting floating point numbers can be explained from the concept of Grid. The space, which the noise function operates on, is assumed to be composed of grids. Grid, in terms of x and y, are the whole numbers. So, any decimal (fractions) are points lying inside a grid cell.In the figure, (x0,y0), (x1,y1), (x0,y1), (x1,y0) represents grid points and (x,y) lies inside a grid.
Pseudorandom Gradient
Pseudorandom Gradient function takes the grid coordinates and generates pseudorandom gradient of length 1 as:g(xgrid, ygrid) = (gx, gy)
These gradients can be visualized as:
Calculating grid influences
Next, We need to calculate a vector directing from grip points to the point (x,y).vec00 = (x-x0,y-y0);
vec01 = (x-x0,y-y1);
vec10 = (x-x1,y-y0);
vec11 = (x-x1,y-y1);
The influence can be calculated by performing dot operation on the gradient and the vector as:
s = g(x0, y0) · vec00;
t = g(x1, y0) · vec10;
u = g(x0, y1) · vec01;
v = g(x1, y1) · vec11;
Interpolation
A smoothing function, characterized by the curver 3p2 - 2p3, is used to get a weight Sx at (x-x0) in the curve as:Sx = smoothParam(x-x0);
and also at (y-y0) as:
Sy = smoothParam(y-y0);
where smoothParam(p) = 3p2 - 2p3 , then parameter representing weighted average of s and t is obtained by constructing a linear function mapping 0 to s and 1 to t, and evaluating it at our x dimension weight Sx. We call this ax.
ax = s + Sx*(t - s);
We also calculate bx using u and v as:
bx = u + Sx*(v - u);
Then the final result z can be obtained as:
z = ax + Sy*(bx - ax);






Very Useful article
ReplyDeleteVery Useful ARTICLE VISIT www.apponix.com for Java Tutorials
ReplyDeleteinformative blog
ReplyDeletedata science certification
This post is very simple to read and appreciate without leaving any details out. Great work!
ReplyDeleteartificial intelligence course in noida
Stunning! Such an astonishing and supportive post this is. I incredibly love it. It's so acceptable thus wonderful. I am simply astounded.
ReplyDeletehrdf contribution
wonderful bLog! its intriguing. thankful to you for sharing.
ReplyDeletehrdf claimable training
If you don't mind proceed with this extraordinary work and I anticipate a greater amount of your magnificent blog entries
ReplyDeletebusiness analytics course
Your content is very unique and understandable useful for the readers keep update more article like this.
ReplyDeletedigital marketing classes in aurangabad
This blog is very informative and excellent post gained a lot of information. good job..
ReplyDeleteData Science Training in Hyderabad
Data Science Course in Hyderabad
I am sure that this is going to help a lot of individuals. Keep up the good work. It is highly convincing and I enjoyed going through the entire blog.
ReplyDeletedata science course
Really enjoyed this Perlin noise implementation tutorial your explanation in Java makes a challenging concept feel much more approachable. Articles like this are super helpful for developers and learners diving into procedural generation. For readers also looking to expand their digital and creative skills beyond programming, you might check out a Digital Marketing Training Institute in Coimbatore or a UI UX Design Course in Coimbatore. Thanks for sharing such great technical content!
ReplyDeleteGreat explanation on implementing Perlin noise in Java! If you’re also interested in learning about digital marketing basics, you might find this helpful guide: What is Digital Marketing. Thanks for sharing!
ReplyDeleteInformative and well-written article.
ReplyDeleteI found Best Digital Marketing Training Institute useful too
I really enjoyed going through this post. The way you’ve explained everything makes it easy to connect with the topic.
ReplyDeleteIt’s always nice to find blogs that share useful insights like this.
Also came across something related that might help others too:
Data Science or Data Analytics
For those who want to build similar blogs or develop strong technical skills to create modern, scalable web applications, this guide on 👉 Best Full Stack Developer Course is a great resource to gain hands-on experience in both frontend and backend development.
ReplyDeleteGreat explanation, very beginner-friendly. I enjoyed reading this. Also sharing this helpful resource: Best Full Stack Developer Course.
ReplyDeleteI also like how blogs like this cover a mix of subjects such as education, technology, and current updates, which makes it a valuable resource for continuous learning and skill development.
ReplyDeleteFor those who also want to present educational content in a more visually appealing and user-friendly way, this
Figma UI UX Course
is a great resource to build strong UI/UX design skills and enhance digital learning experiences.