1
0
mirror of https://github.com/DigvijaysinhGohil/Godot-Shader-Lib.git synced 2025-01-08 10:23:24 +08:00

1.4 KiB

Flipbook node

Creates a flipbook, or texture sheet animation, of the UVs supplied to input UV. The amount of tiles on the sheet are defined by the values of the inputs rows and columns. This node can be used to create a texture animation functionality, commonly used for particle effects and sprites. Animation frames will go from top left to bottom right.

This node is only available in shader modes SPATIAL and CANVAS ITEM.

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
rows int none Amount of horizontal tiles in texture sheet
columns int none Amount of vertical tiles in texture sheet
anim speed float none Animation speed

Outputs

Name Type Binding Description
uv vec2 None Output UV value

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

Method signature
vec2 flipbook_uv(vec2 uv, int rows, int columns, float anim_speed)

Parameters

Name Type Description
uv vec2 Input UV value
rows int Amount of horizontal tiles in texture sheet
columns int Amount of vertical tiles in texture sheet
anim speed float Animation speed