1
0
mirror of https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git synced 2025-01-09 18:58:45 +08:00
2024-04-15 23:04:10 +05:30

1.1 KiB

Rotate node

Rotates value of input UV around a reference point defined by input center by the amount of input rotation.

Default value for uv input will be vec2(0, 0) for shader modes PARTICLES, SKY and FOG to avoid errors becouse UV variable is not available for these modes.


Inputs

Name Type Binding Description
uv vec2 UV Input UV value
center vec2 none Center reference point
rotation float none Rotation amount

Controls

Name Options Description
Units Degrees, Radians Specifies the unit for rotation input

Outputs

Name Type Binding Description
uv vec2 None Output UV value

ShaderInc location
res://addons/ShaderLib/UV/RotateUV.gdshaderinc

Method signature
vec2 rotate_uv(vec2 uv, vec2 center, float rotation, bool use_degrees)

Parameters

Name Type Description
uv vec2 Input uv
center vec2 Center reference point
rotation float Rotation amount
use_degrees bool Specifies the unit for rotation, true = Degrees, false = Radians