1
0
mirror of https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git synced 2025-09-20 12:25:59 +08:00
Files
Godot-Shader-Lib/documentation/Nodes/Procedural/Fractals/KochFractal.md

35 lines
1.5 KiB
Markdown
Raw Normal View History

2024-03-11 12:18:29 +05:30
# Koch Fractal node
2024-03-11 12:11:57 +05:30
Generates an koch curve similar to ice fractal shape based on input UV at the size specified by inputs <b><i>width</i></b> and <b><i>height</i></b>. The generated shape can be offset or tiled by connecting a <b><i>[TilingAndOffset](/documentation/Nodes/UV/TilingAndOffset.md)</i></b> node. Note that in order to preserve the ability to offset the shape within the UV space the shape will not automatically repeat if tiled. To achieve a repeating effect first connect your <b><i>TilingAndOffset</i></b> output through a <b><i>Fract</i></b> node.
<hr>
**Inputs**
|Name|Type|Binding|Description|
|---|---|---|---|
|uv|vec2|UV|Input UV value|
|thickness|float|none|Shape outline thickness|
|iterations|int|none|Number of steps to repeat the fractal shape|
|width|float|none|Fractal width|
|height|float|none|Fractal height|
**Outputs**
|Name|Type|Binding|Description|
|---|---|---|---|
2024-03-11 12:13:22 +05:30
|out|float|None|Output fractal value|
2024-03-11 12:13:56 +05:30
|uv|vec2|None|Output UV value|
2024-04-15 22:50:04 +05:30
**ShaderInc location**
<br>`res://addons/ShaderLib/Procedural/Procedural.gdshaderinc`
2024-04-15 22:50:04 +05:30
**Method signature**
<br>`float koch_fractal(vec2 uv, float outline, int iteration, float shape_width, float shape_height, out vec2 koch_uv)`
**Parameters**
|Name|Type|Description|
|---|---|---|
|uv|vec2|Input UV value|
|outline|float|Shape outline thickness|
|iterations|int|Number of steps to repeat the fractal shape|
|shape_width|float|Fractal width|
|shape_height|float|Fractal height|
|koch_uv|out vec2|Returns Koch fractal UV|
2024-03-11 12:11:57 +05:30
___