procedural generation
124 subscribers
5.18K photos
1.65K videos
4 files
11K links
Created by @r_channels
Download Telegram
Understanding the math of Perlin Noise

Please help me understand the math of Perlin Noise.

I'm using this [video](https://youtu.be/NGziLrKvgGU) as reference. It's only 59 seconds long, so please check it out before proceeding with this post.

I have a few questions that I need your help with, the author unfortunately didn't care enough to answer:

*****

***Q1.***

[0:06](https://www.youtube.com/watch?v=NGziLrKvgGU&t=6s) Perform Dot Product of what with the corner vectors (we need two vectors to perform Dot Product with each other)? Of each cell with each corner vector?

*****

***Q2.***

[0:12](https://www.youtube.com/watch?v=NGziLrKvgGU&t=12s) Positive and negative of what value? Of the calculated Dot Products?

*****

***Q3.***

[0:23](https://www.youtube.com/watch?v=NGziLrKvgGU&t=23s) Based on what he said that if ***"a corner vector points into bottom right cell of it, making that cell green and when that corner vector points in the opposite direction making it red"***, then:
\- at [0:38](https://www.youtube.com/watch?v=NGziLrKvgGU&t=38s) looks more like bottom left (which he said *top right* instead)
\- at [0:40](https://www.youtube.com/watch?v=NGziLrKvgGU&t=40s) looks more like top left (which you said *bottom right* instead))
\- at [0:42](https://www.youtube.com/watch?v=NGziLrKvgGU&t=42s) looks more like top right (which you said *bottom left* instead)), if it really was *"bottom left"* then why doesn't the bottom left cell of each corner vector show green color when the corner vector pointed into it and show red color when it pointed in the opposite cell? Same question for the *"top right"* and *"bottom right"*.

*****

***Q4.***

[0:45](https://www.youtube.com/watch?v=NGziLrKvgGU&t=45s) How do we "add ***corners***"? Did he mean "add ***corner vectors***" instead?

Also, if you add corner vectors then why do the results show on the cells?

And how did he add the corner vectors? By simply summing them all up? Would doing that exceed the range \[0,1\] of Noise texture?

*****

https://redd.it/15e8eaw
@proceduralgeneration
Looking for guidance on creating basically infinite non-directed graph with repeatability

I'm trying to create a graph procedurally that can be recreated if the same original seed is provided, regardless of how the graph is navigated. The graph is not directed, there can be loops, and the number of edges a node can have is variable. The only rules are that no two nodes can have two edges between themselves, and no node can connect back to itself. All edges can be traversed in either direction.

The idea is for the graph to not have a fixed number of nodes, for it to grow as the graph is navigated but to always have the same graph generated assuming the same starting node and same world seed, regardless of traversal.

An example:

Assume there is global seed that creates a graph node. That node is given a unique identifier, ND1, and a random number of connections to other nodes, minimum of 1 maximum of 4.

First node is ND1, it has connections ND1:1, ND1:2, ND1:3, ND1:4.

Travelling down N1:2 we arrive at a new node will call AX7. AX7 has 3 connections, AX7:1, AX7:2 and AX7:3. AX7:1 is connected to ND1:2.

Travelling down AX7:2 we come to a 3rd node we'll call ST3. ST3 has 3 connections ST3:1, ST3:2 and ST3:3 where ST3:2 connects to AX7:2.

Going back to ND1, if we travelled down ND1:1 we come to a new node QL5. QL5 has 3 connections, QL5:1, QL5:2 and QL5:3 where QL5:1 connects to ND1:1 but we want QL5:2 to connect to ST3:3. And we want ST3:1 to connect back to ND1 at connection ND1:3 something like this:



+--------------------------------+
| |
+---3---+ +-------+ +---1---+
| | | | | |
4 ND1 2--------1 AX7 2-------2 ST3 |
| | | | | |
+---1---+ +---3---+ +---3---+
| |
| |
| |
+---1---+ |
| | |
| QL5 2----------------------------+
| |
+---3---+

We don't know yet what ND1:4 and AX7:3 connect with as they've not been visited. Any connection could be to a new node or to an existing node.

With the rules listed above, the above example ND1:4 cannot connect to AX7:3 and ND1:4 cannot connect to QL5:3 but AX7:3 could connect to QL5:3 or a completely new node.

The idea is the nodes don't get created until they are visited, but once created they persist as part of the graph. Any connections not followed can be followed at any time and generate new nodes or connect to existing ones but no matter when traversed the edge will always be to the same next node.

The question I'm trying to resolve is, how can I ensure that when using the same world seed that I'll get the same graph no matter the navigation flow? In the example the graph might have been created by
this pattern of navigation:

ND1:2 -> AX7:1
AX7:2 -> ST3:2
ST3:3 -> QL5:2
QL5:1 -> ND1:1
ND1:3 -> ST3:1

But if I change the visit order I still want the same graph to result

ND1:1 -> QL5:1
QL5:2 -> ST3:3
ST3:2 -> AX7:2
AX7:1 -> ND1:2
ND1:3 -> ST3:1

What I'm trying to do is, assuming the same starting node, no matter what direction the graph is traversed, the same graph will always be created with the same connections to other nodes.

I have searched for articles or posts about something like this, the closest I can find is