Function nodes are the building blocks for more complex behavior in your Rule Editor.
Function Nodes
Break: Break Sand to its properties
Break Sand to its properties
Inputs
Input
Kind
sand_in
sand
Outputs
Output
Kind
id_out
U32
color_out
Vec3
velocity_out
Vec2
is_moved_out
Bool
extra_bit_out
Bool
Break: Break Vec2 to X and Y
Break Vec2 to X and Y
Inputs
Input
Kind
vec2_in
vec2
Outputs
Output
Kind
x_out
F32
y_out
F32
Break: Break Vec3 to X and Y and Z
Break Vec3 to X and Y and Z
Inputs
Input
Kind
vec3_in
vec3
Outputs
Output
Kind
x_out
F32
y_out
F32
z_out
F32
Canvas: Read Average Color (3x3) At Pos
Read 3x3 Average Color at Pos from canvas image
Inputs
Input
Kind
pos_in
ivec2
Outputs
Output
Kind
color_out
Vec3
Canvas: Read Color At Pos
Read Color At Pos from canvas image
Inputs
Input
Kind
pos_in
ivec2
Outputs
Output
Kind
color_out
Vec3
Canvas: Read Gaussian Blur (3x3) At Pos
Read 3x3 Gaussian Blur at Pos from canvas image
Inputs
Input
Kind
pos_in
ivec2
Outputs
Output
Kind
color_out
Vec3
Comment: Comment Box
Comment boxes help you document your functions
Inputs
Input
Kind
Outputs
Output
Kind
Comparison: Eq bool
Check if bool equals another
Inputs
Input
Kind
a_in
bool
b_in
bool
Outputs
Output
Kind
out
Bool
Comparison: Eq characteristic
Check if characteristic equals another
Inputs
Input
Kind
a_in
characteristic
b_in
characteristic
Outputs
Output
Kind
out
Bool
Comparison: Eq direction
Check if direction equals another
Inputs
Input
Kind
a_in
direction
b_in
direction
Outputs
Output
Kind
out
Bool
Comparison: Eq f32
Check if f32 equals another
Inputs
Input
Kind
a_in
f32
b_in
f32
Outputs
Output
Kind
out
Bool
Comparison: Eq i32
Check if i32 equals another
Inputs
Input
Kind
a_in
i32
b_in
i32
Outputs
Output
Kind
out
Bool
Comparison: Eq ivec2
Check if ivec2 equals another
Inputs
Input
Kind
a_in
ivec2
b_in
ivec2
Outputs
Output
Kind
out
Bool
Comparison: Eq sand
Check if sand equals another
Inputs
Input
Kind
a_in
sand
b_in
sand
Outputs
Output
Kind
out
Bool
Comparison: Eq sand_id
Check if sand_id equals another
Inputs
Input
Kind
a_in
sand_id
b_in
sand_id
Outputs
Output
Kind
out
Bool
Comparison: Eq u32
Check if u32 equals another
Inputs
Input
Kind
a_in
u32
b_in
u32
Outputs
Output
Kind
out
Bool
Comparison: Eq vec2
Check if vec2 equals another
Inputs
Input
Kind
a_in
vec2
b_in
vec2
Outputs
Output
Kind
out
Bool
Comparison: Eq vec3
Check if vec3 equals another
Inputs
Input
Kind
a_in
vec3
b_in
vec3
Outputs
Output
Kind
out
Bool
Comparison: Greater than f32
Check if f32 is greater than another
Inputs
Input
Kind
a_in
f32
b_in
f32
Outputs
Output
Kind
out
Bool
Comparison: Greater than i32
Check if i32 is greater than another
Inputs
Input
Kind
a_in
i32
b_in
i32
Outputs
Output
Kind
out
Bool
Comparison: Greater than u32
Check if u32 is greater than another
Inputs
Input
Kind
a_in
u32
b_in
u32
Outputs
Output
Kind
out
Bool
Comparison: Less than f32
Check if f32 is less than another
Inputs
Input
Kind
a_in
f32
b_in
f32
Outputs
Output
Kind
out
Bool
Comparison: Less than i32
Check if i32 is less than another
Inputs
Input
Kind
a_in
i32
b_in
i32
Outputs
Output
Kind
out
Bool
Comparison: Less than u32
Check if u32 is less than another
Inputs
Input
Kind
a_in
u32
b_in
u32
Outputs
Output
Kind
out
Bool
Convert: f32 To i32
Convert floating point number to integer
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
i32_out
I32
Convert: i32 To f32
Convert integer to floating point number
Inputs
Input
Kind
i32_in
i32
Outputs
Output
Kind
f32_out
F32
Convert: i32 To u32
Convert integer to unsigned integer
Inputs
Input
Kind
i32_in
i32
Outputs
Output
Kind
u32_out
U32
Convert: ivec2 To vec2
Convert integer vec2 to float vec2
Inputs
Input
Kind
ivec2_in
ivec2
Outputs
Output
Kind
vec2_out
Vec2
Convert: vec2 To ivec2
Convert float vec2 to integer vec2
Inputs
Input
Kind
vec2_in
vec2
Outputs
Output
Kind
ivec2_out
IVec2
Get: Characteristic
Get characteristics of sand. Characteristics are used to define reactive behavior between types of sand. With characteristics, you can bundle functionality between multiple sand types.
Inputs
Input
Kind
sand_in
sand
Outputs
Output
Kind
char_out
U32
Get: Color
Get color of sand
Inputs
Input
Kind
sand_in
sand
Outputs
Output
Kind
color_out
Vec3
Get: Extra Bit
Get extra bit of sand, you can read the boolean value.
Inputs
Input
Kind
sand_in
sand
Outputs
Output
Kind
extra_bit_out
Bool
Get: Id
Get id of sand
Inputs
Input
Kind
sand_in
sand
Outputs
Output
Kind
id_out
U32
Get: IsMoved
Get is_moved flag of sand. This tells whether sand was moved this frame. Useful for custom behavior
Inputs
Input
Kind
sand_in
sand
Outputs
Output
Kind
is_moved_out
Bool
Get: Velocity
Get velocity of sand
Inputs
Input
Kind
sand_in
sand
Outputs
Output
Kind
velocity_out
Vec2
Input: Get Arrow Key State
Get arrow key state. Use this for arrow input related behavior
Inputs
Input
Kind
Outputs
Output
Kind
up_out
Bool
down_out
Bool
left_out
Bool
right_out
Bool
Input: Get Canvas Size
Get size of the canvas. You can use this to apply transformations to position etc.
Inputs
Input
Kind
Outputs
Output
Kind
size_out
IVec2
Input: Get Delta Time
Get last frame's delta time.
Inputs
Input
Kind
Outputs
Output
Kind
dt_out
F32
Input: Get Down
Get neighbor of input sand from down
Inputs
Input
Kind
Outputs
Output
Kind
sand_out
Sand
Input: Get Down Left
Get neighbor of input sand from down left
Inputs
Input
Kind
Outputs
Output
Kind
sand_out
Sand
Input: Get Down Right
Get neighbor of input sand from down right
Inputs
Input
Kind
Outputs
Output
Kind
sand_out
Sand
Input: Get Left
Get neighbor of input sand from left
Inputs
Input
Kind
Outputs
Output
Kind
sand_out
Sand
Input: Get Mouse Canvas Pos
Get mouse canvas position. You can use this for mouse position related behavior
Inputs
Input
Kind
Outputs
Output
Kind
mouse_out
Vec2
Input: Get Position
Get position of currently inspected input sand. Each pixel represents sand on the canvas. The sand gets swapped by the simulator. This position refers to the current position of an individual sand
Inputs
Input
Kind
Outputs
Output
Kind
ivec2_out
IVec2
Input: Get Right
Get neighbor of input sand from right
Inputs
Input
Kind
Outputs
Output
Kind
sand_out
Sand
Input: Get Sand
Get sand. This is the sand for which the current rule is applied.
Inputs
Input
Kind
Outputs
Output
Kind
sand_out
Sand
Input: Get Time
Get time since app start. You can use this for time based rules.
Inputs
Input
Kind
Outputs
Output
Kind
time_out
F32
Input: Get Up
Get neighbor of input sand from up
Inputs
Input
Kind
Outputs
Output
Kind
sand_out
Sand
Input: Get Up Left
Get neighbor of input sand from up left
Inputs
Input
Kind
Outputs
Output
Kind
sand_out
Sand
Input: Get Up Right
Get neighbor of input sand from up right
Inputs
Input
Kind
Outputs
Output
Kind
sand_out
Sand
Logic: And
Check both input values are true
Inputs
Input
Kind
test_a_in
bool
test_b_in
bool
Outputs
Output
Kind
out
Bool
Logic: Characteristic Contains
Check if sand characteristic contains another characteristic
Inputs
Input
Kind
char_a
characteristic
char_b
characteristic
Outputs
Output
Kind
out
Bool
Logic: If, else bool
If given test is true, use first bool, else use the other bool
Inputs
Input
Kind
bool_test_in
bool
value_true_in
bool
value_false_in
bool
Outputs
Output
Kind
out
Bool
Logic: If, else direction
If given test is true, use first direction, else use the other direction
Inputs
Input
Kind
bool_test_in
bool
value_true_in
direction
value_false_in
direction
Outputs
Output
Kind
out
U32
Logic: If, else f32
If given test is true, use first f32, else use the other f32
Inputs
Input
Kind
bool_test_in
bool
value_true_in
f32
value_false_in
f32
Outputs
Output
Kind
out
F32
Logic: If, else i32
If given test is true, use first i32, else use the other i32
Inputs
Input
Kind
bool_test_in
bool
value_true_in
i32
value_false_in
i32
Outputs
Output
Kind
out
I32
Logic: If, else ivec2
If given test is true, use first ivec2, else use the other ivec2
Inputs
Input
Kind
bool_test_in
bool
value_true_in
ivec2
value_false_in
ivec2
Outputs
Output
Kind
out
IVec2
Logic: If, else sand
If given test is true, use first sand, else use the other sand
Inputs
Input
Kind
bool_test_in
bool
value_true_in
sand
value_false_in
sand
Outputs
Output
Kind
out
Sand
Logic: If, else sand_id
If given test is true, use first sand_id, else use the other sand_id
Inputs
Input
Kind
bool_test_in
bool
value_true_in
sand_id
value_false_in
sand_id
Outputs
Output
Kind
out
U32
Logic: If, else u32
If given test is true, use first u32, else use the other u32
Inputs
Input
Kind
bool_test_in
bool
value_true_in
u32
value_false_in
u32
Outputs
Output
Kind
out
U32
Logic: If, else vec2
If given test is true, use first vec2, else use the other vec2
Inputs
Input
Kind
bool_test_in
bool
value_true_in
vec2
value_false_in
vec2
Outputs
Output
Kind
out
Vec2
Logic: If, else vec3
If given test is true, use first vec3, else use the other vec3
Inputs
Input
Kind
bool_test_in
bool
value_true_in
vec3
value_false_in
vec3
Outputs
Output
Kind
out
Vec3
Logic: Not
Negate the boolean value
Inputs
Input
Kind
test_in
bool
Outputs
Output
Kind
out
Bool
Logic: Or
Check at least one of input values is true
Inputs
Input
Kind
test_a_in
bool
test_b_in
bool
Outputs
Output
Kind
out
Bool
Math: Abs
Absolute value of the input f32
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Add: bool
Add: bool to another bool
Inputs
Input
Kind
a_in
bool
b_in
bool
Outputs
Output
Kind
out
Bool
Math: Add: f32
Add: f32 to another f32
Inputs
Input
Kind
a_in
f32
b_in
f32
Outputs
Output
Kind
out
F32
Math: Add: i32
Add: i32 to another i32
Inputs
Input
Kind
a_in
i32
b_in
i32
Outputs
Output
Kind
out
I32
Math: Add: ivec2
Add: ivec2 to another ivec2
Inputs
Input
Kind
a_in
ivec2
b_in
ivec2
Outputs
Output
Kind
out
IVec2
Math: Add: u32
Add: u32 to another u32
Inputs
Input
Kind
a_in
u32
b_in
u32
Outputs
Output
Kind
out
U32
Math: Add: vec2
Add: vec2 to another vec2
Inputs
Input
Kind
a_in
vec2
b_in
vec2
Outputs
Output
Kind
out
Vec2
Math: Add: vec3
Add: vec3 to another vec3
Inputs
Input
Kind
a_in
vec3
b_in
vec3
Outputs
Output
Kind
out
Vec3
Math: Atan2
Atan2 returns an angle, in radians, in the interval [-π, π] whose tangent is y / x
Inputs
Input
Kind
y_in
f32
x_in
f32
Outputs
Output
Kind
rad_out
F32
Math: Ceil
Ceil rounds up
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Clamp
Clamp a number between two other numbers
Inputs
Input
Kind
f32_in
f32
min_in
f32
max_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Clamp Vec2 Length
Clamp vec2 by length
Inputs
Input
Kind
vec2_in
vec2
len_in
f32
Outputs
Output
Kind
vec2_out
Vec2
Math: Cos
Cosine of the input
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Cosh
Hyperbolic cosine
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Cross Vec2
Cross product of two vec2
Inputs
Input
Kind
a_in
vec2
b_in
vec2
Outputs
Output
Kind
vec2_out
Vec2
Math: Cross Vec3
Cross product of two vec3
Inputs
Input
Kind
a_in
vec3
b_in
vec3
Outputs
Output
Kind
vec3_out
Vec3
Math: Distance
Distance between two vec2
Inputs
Input
Kind
a_in
vec2
b_in
vec2
Outputs
Output
Kind
f32_out
F32
Math: Divide: bool
Divide: bool with another bool
Inputs
Input
Kind
a_in
bool
b_in
bool
Outputs
Output
Kind
out
Bool
Math: Divide: f32
Divide: f32 with another f32
Inputs
Input
Kind
a_in
f32
b_in
f32
Outputs
Output
Kind
out
F32
Math: Divide: i32
Divide: i32 with another i32
Inputs
Input
Kind
a_in
i32
b_in
i32
Outputs
Output
Kind
out
I32
Math: Divide: ivec2
Divide: ivec2 with another ivec2
Inputs
Input
Kind
a_in
ivec2
b_in
ivec2
Outputs
Output
Kind
out
IVec2
Math: Divide: u32
Divide: u32 with another u32
Inputs
Input
Kind
a_in
u32
b_in
u32
Outputs
Output
Kind
out
U32
Math: Divide: vec2
Divide: vec2 with another vec2
Inputs
Input
Kind
a_in
vec2
b_in
vec2
Outputs
Output
Kind
out
Vec2
Math: Divide: vec3
Divide: vec3 with another vec3
Inputs
Input
Kind
a_in
vec3
b_in
vec3
Outputs
Output
Kind
out
Vec3
Math: Dot
Dot Product of two vec2
Inputs
Input
Kind
a_in
vec2
b_in
vec2
Outputs
Output
Kind
f32_out
F32
Math: Exp
Exp returne e to the power of input value
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Floor
Floor rounds down
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Fract
Fractional part of a number
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Inverse Sqrt
Inverse Square Root
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Length
Length of a vec2
Inputs
Input
Kind
vec2_in
vec2
Outputs
Output
Kind
f32_out
F32
Math: Log
Natural logarithm of x. value y which satisfies x=e^y
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Log2
Base 2 logarithm of x. value y which satisfies x=2^y
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Max
Max of two numbers
Inputs
Input
Kind
f32_a_in
f32
f32_b_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Min
Min of two numbers
Inputs
Input
Kind
f32_a_in
f32
f32_b_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Mix Vec2
Mix of two vec2. Returns a * (1.0 - blend) + b * blend
Inputs
Input
Kind
a_in
vec2
b_in
vec2
blend_in
f32
Outputs
Output
Kind
vec2_out
Vec2
Math: Mix Vec3
Mix of two vec3. Returns a * (1.0 - blend) + b * blend
Inputs
Input
Kind
a_in
vec3
b_in
vec3
blend_in
f32
Outputs
Output
Kind
vec3_out
Vec3
Math: Multiply: bool
Multiply: bool with another bool
Inputs
Input
Kind
a_in
bool
b_in
bool
Outputs
Output
Kind
out
Bool
Math: Multiply: f32
Multiply: f32 with another f32
Inputs
Input
Kind
a_in
f32
b_in
f32
Outputs
Output
Kind
out
F32
Math: Multiply: i32
Multiply: i32 with another i32
Inputs
Input
Kind
a_in
i32
b_in
i32
Outputs
Output
Kind
out
I32
Math: Multiply: ivec2
Multiply: ivec2 with another ivec2
Inputs
Input
Kind
a_in
ivec2
b_in
ivec2
Outputs
Output
Kind
out
IVec2
Math: Multiply: u32
Multiply: u32 with another u32
Inputs
Input
Kind
a_in
u32
b_in
u32
Outputs
Output
Kind
out
U32
Math: Multiply: vec2
Multiply: vec2 with another vec2
Inputs
Input
Kind
a_in
vec2
b_in
vec2
Outputs
Output
Kind
out
Vec2
Math: Multiply: vec3
Multiply: vec3 with another vec3
Inputs
Input
Kind
a_in
vec3
b_in
vec3
Outputs
Output
Kind
out
Vec3
Math: Normalize Vec2
Normalize vec2
Inputs
Input
Kind
vec2_in
vec2
Outputs
Output
Kind
vec2_out
Vec2
Math: Normalize Vec3
Normalize vec3
Inputs
Input
Kind
vec3_in
vec3
Outputs
Output
Kind
vec3_out
Vec3
Math: Pow
A number raised to given power
Inputs
Input
Kind
f32_in
f32
exp_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Random
A random number 0.0-1.0 seeded with current position and running time. Calling this multiple times will result with the same value within one frame. Use Random with seed (float) to use multiple random numbers for various purposes.
Inputs
Input
Kind
Outputs
Output
Kind
random_out
F32
Math: Random Color
Random color (R, G, B, ranging 0.0-1.0)
Inputs
Input
Kind
Outputs
Output
Kind
random_out
Vec3
Math: Random Direction Step
Random direction step. (Offset for: UpLeft, Up, UpRight, Right, DownRight, Down, DownLeft, Left)
Inputs
Input
Kind
Outputs
Output
Kind
ivec_out
IVec2
Math: Random Norm Dir Step Vec2
Random direction step that is normalized
Inputs
Input
Kind
Outputs
Output
Kind
vec_out
Vec2
Math: Random Range
Random between given min and max
Inputs
Input
Kind
range_min_in
f32
range_max_in
f32
Outputs
Output
Kind
random_out
F32
Math: Random Unit Vec2
Random unit vector.
Inputs
Input
Kind
Outputs
Output
Kind
vec_out
Vec2
Math: Random with seed
Random number 0.0-1.0 seeded with position, running time, and a floating point seed offset. Change the seed offset if you want the probabilities to vary between random numbers in your graph (compared to just Random)
Inputs
Input
Kind
seed_in
f32
Outputs
Output
Kind
random_out
F32
Math: Randomize Color By Range
Vary input color by given range. This can be used to vary color slightly. Do consider that colors are between 0.0 and 1.0
Inputs
Input
Kind
color_in
vec3
range_in
f32
Outputs
Output
Kind
color_out
Vec3
Math: Reflect
Reflection vector of a vector and given normal input
Inputs
Input
Kind
vec2_in
vec2
normal_in
vec2
Outputs
Output
Kind
reflect
Vec2
Math: Rotate Vec2 Radians
Rotate vec2 by input radian angle
Inputs
Input
Kind
vec2_in
vec2
rads_in
f32
Outputs
Output
Kind
vec2_out
Vec2
Math: Round
Round number to closest integer
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Sign
Sign of a number
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Sin
Sine of the input
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Sinh
Hyperbolic sine
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Smoothstep
Smoothstep performs smooth Hermite interpolation between 0 and 1 when a < value < b. This is useful in cases where a threshold function with a smooth transition is desired.
Inputs
Input
Kind
f32_a_in
f32
f32_b_in
f32
f32_value_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Sqrt
Square root of the input
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Step
Step: Outputs 0.0 if a < b, and 1.0 otherwise.
Inputs
Input
Kind
f32_a_in
f32
f32_b_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Sub: bool
Subtract: bool from another bool
Inputs
Input
Kind
a_in
bool
b_in
bool
Outputs
Output
Kind
out
Bool
Math: Sub: f32
Subtract: f32 from another f32
Inputs
Input
Kind
a_in
f32
b_in
f32
Outputs
Output
Kind
out
F32
Math: Sub: i32
Subtract: i32 from another i32
Inputs
Input
Kind
a_in
i32
b_in
i32
Outputs
Output
Kind
out
I32
Math: Sub: ivec2
Subtract: ivec2 from another ivec2
Inputs
Input
Kind
a_in
ivec2
b_in
ivec2
Outputs
Output
Kind
out
IVec2
Math: Sub: u32
Subtract: u32 from another u32
Inputs
Input
Kind
a_in
u32
b_in
u32
Outputs
Output
Kind
out
U32
Math: Sub: vec2
Subtract: vec2 from another vec2
Inputs
Input
Kind
a_in
vec2
b_in
vec2
Outputs
Output
Kind
out
Vec2
Math: Sub: vec3
Subtract: vec3 from another vec3
Inputs
Input
Kind
a_in
vec3
b_in
vec3
Outputs
Output
Kind
out
Vec3
Math: Tan
Tangent of the input
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
Math: Tanh
Hyperbolic tangent
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
New: IVec2
Create new two dimensional integer vector (x, y), used for positions on canvas
Inputs
Input
Kind
i32_x_in
i32
i32_y_in
i32
Outputs
Output
Kind
ivec2_out
IVec2
New: Vec2
Create new two dimensional vector (x, y)
Inputs
Input
Kind
f32_x_in
f32
f32_y_in
f32
Outputs
Output
Kind
vec2_out
Vec2
New: Vec3
Create new vector for colors (r, g, b)
Inputs
Input
Kind
f32_x_in
f32
f32_y_in
f32
f32_z_in
f32
Outputs
Output
Kind
vec3_out
Vec3
New: bool
Create new bool (true, false)
Inputs
Input
Kind
bool_in
bool
Outputs
Output
Kind
bool_out
Bool
New: f32
Create new float
Inputs
Input
Kind
f32_in
f32
Outputs
Output
Kind
f32_out
F32
New: i32
Create new signed integer
Inputs
Input
Kind
i32_in
i32
Outputs
Output
Kind
i32_out
I32
New: sand
Create new sand
Inputs
Input
Kind
sand_in
sand
Outputs
Output
Kind
sand_out
Sand
New: sand id
Create new sand id
Inputs
Input
Kind
sand_id_in
sand_id
Outputs
Output
Kind
u32_out
U32
New: u32
Create new unsigned integer
Inputs
Input
Kind
u32_in
u32
Outputs
Output
Kind
u32_out
U32
Physics: Add Force
Write add force value at given position
Inputs
Input
Kind
connection
sand
is_on
bool
pos_in
ivec2
force_in
vec2
Outputs
Output
Kind
connection_out
Sand
Physics: Add Force In Radius
Write add force value within radius (clamped to 0..5.0) at given position
Inputs
Input
Kind
connection
sand
is_on
bool
pos_in
ivec2
force_in
vec2
radius_in
f32
Outputs
Output
Kind
connection_out
Sand
Physics: Read Add Force
Read added force value at given position
Inputs
Input
Kind
pos_in
ivec2
Outputs
Output
Kind
force_out
Vec2
Physics: Read Density Pressure
Read density and pressure (output as vec2(x, y)) at given position
Inputs
Input
Kind
pos_in
ivec2
Outputs
Output
Kind
density_pressure_out
Vec2
Physics: Read Force
Read force value at given position
Inputs
Input
Kind
pos_in
ivec2
Outputs
Output
Kind
force_out
Vec2
Sand Utils: Check if pos neighbors another sand
Check if sand neighbors another sand with given id
Inputs
Input
Kind
pos_in
ivec2
other_id_in
sand_id
Outputs
Output
Kind
bool_out
Bool
Sand Utils: Check if sand touches another (radius considered)
Considering sand's and its neighbor's radius, check if sand touches another with given id
Inputs
Input
Kind
pos_in
ivec2
sand_in
sand
other_id_in
sand_id
Outputs
Output
Kind
bool_out
Bool
Sand Utils: Check if sand touches another characteristic
Considering sand's and its neighbor's radius, check if sand touches another sand with given characteristic
Inputs
Input
Kind
pos_in
ivec2
sand_in
sand
other_char_in
characteristic
Outputs
Output
Kind
bool_out
Bool
Sand Utils: Count 3x3 grid of sand by id
Count 3x3 grid of sand by sand id at given position
Inputs
Input
Kind
pos_in
ivec2
id_in
sand_id
Outputs
Output
Kind
i32_out
I32
Sand Utils: Count Neighbors By Id
Count neighboring sands by sand id, e.g. useful in Game of Life type of rules
Inputs
Input
Kind
sand_id_in
sand_id
Outputs
Output
Kind
i32_out
I32
Sand Utils: Count sand circle of size by id
Count circle of given size by sand id at given position (max radius of 6)
Inputs
Input
Kind
pos_in
ivec2
radius_in
i32
id_in
sand_id
Outputs
Output
Kind
i32_out
I32
Sand Utils: Count sand grid of size by id
Count grid of given size by sand id at given position (max 12). Useful for more complex Game of Life type rules
Inputs
Input
Kind
pos_in
ivec2
size_in
i32
id_in
sand_id
Outputs
Output
Kind
i32_out
I32
Sand Utils: Get Sand By Pos
Get another sand using a canvas position
Inputs
Input
Kind
pos_in
ivec2
Outputs
Output
Kind
sand_out
Sand
Sand Utils: Get Step Four from Velocity
Given sand's current velocity, get its next direction step (offset) rounded to (Up, Down, Left, Right)
Inputs
Input
Kind
sand_in
sand
Outputs
Output
Kind
step_out
IVec2
Sand Utils: Get Step from Velocity
Given sand's velocity, get its next direction step (Offset for: UpLeft, Up, UpRight, Right, DownRight, Down, DownLeft, Left)
Inputs
Input
Kind
sand_in
sand
Outputs
Output
Kind
step_out
IVec2
Sand Utils: Transform on touch another characteristic
Considering sand's and its neighbor's radius, determine how sand transforms based on nearby sand characteristics (touch). This function is not particularly fast, thus it is not recommended to use multiple of these.
Inputs
Input
Kind
pos_in
ivec2
sand_in
sand
char_1_in
characteristic
prob_1_in
f32
becomes_1_in
sand
char_2_in
characteristic
prob_2_in
f32
becomes_2_in
sand
char_3_in
characteristic
prob_3_in
f32
becomes_3_in
sand
char_4_in
characteristic
prob_4_in
f32
becomes_4_in
sand
Outputs
Output
Kind
sand_out
Sand
Sand Utils: Transform on touch another id
Considering sand's and its neighbor's radius, determine how sand transforms based on nearby sand ids (touch). This function is not particularly fast, thus it is not recommended to use multiple of these.
Inputs
Input
Kind
pos_in
ivec2
sand_in
sand
id_1_in
sand_id
prob_1_in
f32
becomes_1_in
sand
id_2_in
sand_id
prob_2_in
f32
becomes_2_in
sand
id_3_in
sand_id
prob_3_in
f32
becomes_3_in
sand
id_4_in
sand_id
prob_4_in
f32
becomes_4_in
sand
Outputs
Output
Kind
sand_out
Sand
Set: Color
Set color of sand
Inputs
Input
Kind
sand_in
sand
vec3_in
vec3
Outputs
Output
Kind
sand_out
Sand
Set: Extra Bit
Set extra bit of sand, you can use this for anything. For example, initialization of sand.
Inputs
Input
Kind
sand_in
sand
bool_in
bool
Outputs
Output
Kind
sand_out
Sand
Set: Id
Set id of sand
Inputs
Input
Kind
sand_in
sand
sand_id_in
sand_id
Outputs
Output
Kind
sand_out
Sand
Set: Velocity
Set velocity of sand
Inputs
Input
Kind
sand_in
sand
vec2_in
vec2
Outputs
Output
Kind
sand_out
Sand
Util: Dir by Offset (Step)
Given input offset ivec, return direction
Inputs
Input
Kind
offset_in
ivec2
Outputs
Output
Kind
dir_out
U32
Util: Edge Normal
Get edge normal. Edge refers to a sand bordering other than that sand. Sand is edge if it has at least one non-that-sand neighbor. The normal is the normalized negation of (3x3 mass average - center). If the mass average == center or the position is not considered edge, zero vec2 is returned