1
0
mirror of https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git synced 2025-09-19 20:05:57 +08:00
Files
Godot-Shader-Lib/documentation/Nodes/UV/Swirl.md
2024-04-15 23:04:10 +05:30

31 lines
1.1 KiB
Markdown

# Swirl node
Applies a swirl warping effect similar to a black hole to the value of input UV. Very similar to <b><i>[Twirl node](/documentation/Nodes/UV/Twirl.md)</b></i>, key difference is it uses the inverse of vector length (One minus).<br><br><i>Default value for uv input will be vec2(0, 0) for shader modes <i>PARTICLES</i>, <i>SKY</i> and <i>FOG</i> to avoid errors becouse UV variable is not available for these modes.</i>
<hr>
**Inputs**
|Name|Type|Binding|Description|
|---|---|---|---|
|uv|vec2|UV|Input UV value|
|center|vec2|none|Center reference point|
|strength|float|none|Strength of the effect|
|offset|vec2|none|Individual channel offsets|
**Outputs**
|Name|Type|Binding|Description|
|---|---|---|---|
|uv|vec2|None|Output UV value|
**ShaderInc location**
<br>`res://addons/ShaderLib/UV/SwirlUV.gdshaderinc`
**Method signature**
<br>`vec2 swirl_uv(vec2 uv, vec2 center, float strength, vec2 offset)`
**Parameters**
|Name|Type|Description|
|---|---|---|
|uv|vec2|Input uv|
|center|vec2|Center reference point|
|strength|float|Strength of the effect|
|offset|vec2|Individual channel offsets|
___