mirror of
https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git
synced 2025-09-19 11:56:01 +08:00
40 lines
1.5 KiB
Markdown
40 lines
1.5 KiB
Markdown
# Voronoi node
|
|
Generates a Voronoi or Worley noise based on input UV. Voronoi noise is generated by calculating distances between a pixel and a lattice of points. By offsetting these points by a pseudo-random number, controlled by <b><i>angle offset</i></b>, a cluster of cells can be generated.
|
|
<hr>
|
|
|
|
**Controls**
|
|
|Name|Options|Description|
|
|
|---|---|---|
|
|
|Distance|Euclidean, Manhattan, Chebyshev|Distance matrix used to calculate the noise|
|
|
|
|
**Inputs**
|
|
|Name|Type|Binding|Description|
|
|
|---|---|---|---|
|
|
|uv|vec2|UV|Input UV value|
|
|
|cell density|float|none|Density of generated cells|
|
|
|angle offset|float|none|Offset values for points|
|
|
|chebyshev power|float|none|Power values for Chebyshev distance matrix|
|
|
|
|
**Outputs**
|
|
|Name|Type|Binding|Description|
|
|
|---|---|---|---|
|
|
|output|float|None|Output noise value|
|
|
|cells|float|None|Raw cell data|
|
|
|
|
**ShaderInc location**
|
|
<br>`res://addons/ShaderLib/Procedural/Procedural.gdshaderinc`
|
|
|
|
**Method signature**
|
|
<br>`void voronoi_noise(vec2 uv, float cell_density, float angle_offset, int distance_index, float chebyshev_power, out float output, out float cells)`
|
|
|
|
**Parameters**
|
|
|Name|Type|Description|
|
|
|---|---|---|
|
|
|uv|vec2|Input UV value|
|
|
|cell_density|float|Density of generated cells|
|
|
|angle_offset|float|Offset values for points|
|
|
|distance_index|int|Distance matrix to use for Voronoi, 0 = Euclidean, 1 = Manhattan, 2 = Chebyshev|
|
|
|chebyshev_power|float|Power for Chebyshev distance|
|
|
|output|out float|Output noise value|
|
|
|cells|out float|Output raw cell data|
|
|
___ |