Sonolus Wiki

Particle Effect Transform

Particle effect transform provides simple yet powerful way for particle effect to manipulate its own transform while rendering.

Transform Expression

Each property output is computed based on its transform expression, which is the sum of all property inputs multiplied by corresponding coefficient.

Take the following example:

{
    "x1": {
        "x1": 0.1,
        "y2": 0.2,
        "x3": 0.3,
        "y4": 0.4
    }
}

It will be transformed with the following logic:

output.x1 = input.x1 * 0.1 + input.y2 * 0.2 + input.x3 * 0.3 + input.y4 * 0.4

Inputs

NameDescription
cEquals to 1
x1x1 received from engine
y1y1 received from engine
x2x2 received from engine
y2y2 received from engine
x3x3 received from engine
y3y3 received from engine
x4x4 received from engine
y4y4 received from engine
r1Randomized value in range 0 to 1
r2Randomized value in range 0 to 1
r3Randomized value in range 0 to 1
r4Randomized value in range 0 to 1
r5Randomized value in range 0 to 1
r6Randomized value in range 0 to 1
r7Randomized value in range 0 to 1
r8Randomized value in range 0 to 1
sinr1Equals to sin(2 * PI * r1)
sinr2Equals to sin(2 * PI * r2)
sinr3Equals to sin(2 * PI * r3)
sinr4Equals to sin(2 * PI * r4)
sinr5Equals to sin(2 * PI * r5)
sinr6Equals to sin(2 * PI * r6)
sinr7Equals to sin(2 * PI * r7)
sinr8Equals to sin(2 * PI * r8)
cosr1Equals to cos(2 * PI * r1)
cosr2Equals to cos(2 * PI * r2)
cosr3Equals to cos(2 * PI * r3)
cosr4Equals to cos(2 * PI * r4)
cosr5Equals to cos(2 * PI * r5)
cosr6Equals to cos(2 * PI * r6)
cosr7Equals to cos(2 * PI * r7)
cosr8Equals to cos(2 * PI * r8)

Identity Transform

The identity transform produces an output equals to the input, and can be used when transforming is not needed:

{
    "x1": { "x1": 1 },
    "y1": { "y1": 1 },
    "x2": { "x2": 1 },
    "y2": { "y2": 1 },
    "x3": { "x3": 1 },
    "y3": { "y3": 1 },
    "x4": { "x4": 1 },
    "y4": { "y4": 1 }
}