Perlin Noise Implementation in grasshopper

Hello Guys.

I’m trying to implement Perlin Noise inside of grasshopper in order to generate smoothly randomized terrains and flow fields. I understand the theory behind it but I cant seem to know how to implement it correctly in grasshopper. like I feel there is something wrong as I cant apply the interpolation correctly, if someone can guide me or help me with the process it would be much appreciated.



Hello
it is not too complex to integrate in c# or Python using many of the available library on Github. I ended integrating this one

in

It is very simple to to use as it is very well coded. The only difficulty is the number of parameters.

Is there a reason you want to implement Perlin Noise using just components ?

Some of noise plugin

Hello Laurent, thank you for replying, I saw the other implementations in C# and python and even in processing and p5.js but it is a habit of mine that if i want to use something or implement something i must understand each step of it to grasp the full knowledge of it. I get how the final map is reached but some steps are a bit ambiguous for me like the smoothening and the interpolation, is there a way to implement it using only components without the use of noise libraries only using the logic of it ?

2 Likes

It must be doable, post your script it seems to be a good start.

1 Like

I know its doable, so what I started with is a grid of points as in the theory implementation that’s created from trimming a surface into squared panels and populated a random point in each panel, from there I created two vector groups one group from each corner point of the panel to the random point in it and the other group is random vector directions on each corner point of the panel, then I calculated the dot product between each corner vector and its corresponding vector that going to the point in the panel, then I transformed the values of the dot product into a gradient for each corner of the panels resulting in the first picture here, finally I interpolated the values reaching the second picture attached, and from there I don’t know how to keep going with the implementation



Q-Perlin Noise.gh (11.8 KB)

Same here :slight_smile:

Does it make any sense to think of a ‘fade function’ (using only native components) via the graph mapper following your dot product and prior to interpolation?

1 Like

I actually tried implementing it in may ways one of them was using C# and searching on C# and found some but still couldn’t know how to use it with native components

If you want an entry lievel C# that does Perlin Noise, notify. Shown an implementation on Mesh Vertices Z (that said Simplex is a far more elabotated way to cut the mustard).



1 Like

Thank you peter for your reply, the problem resigns in how could one apply the noise using native component’s, programmatically it could be understood easily but the native implementation is a bit hard to grasp, btw is it possible for you to share the script in the images you provided ?

Hard to understand/justify the reason for this (GH is a general purpose graphical editor and should NOT interfere with maths/algorithms as exposed in some classic code based solution - or at least things should be that way for anyone capable to code). That said any GH native component is just a compiled piece of code. Same for add-ons.

I’m not in the practice right now. When back I’ll post the simple one (the Perlin - the Simplex is internal). I’ll add an oprion as well: either apply the Perlin value to the vertex Z or just use the inerpolated (from/to) Colors to a flat Mesh.

Or you want to try to add that option as a simple C# challenge?

Concerning the justification for this, its just I love to challenge myself and find many workarounds for the same problem, I’m actually pretty close to it a bit further than the images shown before in the topic, but some tweaking needs to be done

yeah sure, consider it added to the challenge list

Avoid wasting your time for no reason (at all).

Get the simple Perlin thing. The flat Mesh option is … er … hmm … in the wrong place (so the challenge is on).

PerlinNoise_EntryLevel_V1.gh (125.9 KB)