benilla-re systems structs docs

ParticleGradientSample

function · models · primitive

Address
0x7b9b10 · 338 bytes, up to 0x7b9c61
Signature
void __thiscall (void *this, float age, float alpha, uint32_t *colour, uint32_t *head, uint32_t *tail, float *scale)
Meaning
Samples a gradient at an age: colour with scaled alpha, head and tail cells, and size
Confidence
verified, proof one
Finding
models/particles#gradients
Test
models::cell_ramp_flipbook_oracle_difftest, models::gradient_repeat_leg_scope_difftest, models::particle_gradient_sample_difftest, models::particle_quad_expand_difftest, models::particle_quad_expand_rotated_difftest, models::particle_quad_expand_stretched_difftest, models::particle_quad_expand_tiled_difftest, models::particle_quad_expand_tiled_rotated_difftest

Finding: Gradients in models: particles

Two gradients colour a particle, over ages 0 to mid·L and mid·L to L (L the lifespan, at least 0.001; mid record +0x14c). Within a span t0 to t1, f = (age − t0)/(t1 − t0)·0.99 + 0.005, unclamped. A channel is c0 + (c1 − c0)·f, alpha times the instance alpha; the size s0 + (s1 − s0)·f; a cell a + n·f, or a + n·g with g = fmod(f·repeat, 1) when the repeat is not 1, and a range p to q gives a = p, n = q − p + 1 for q ≥ p, else a = p + 1, n = q − p − 1; bytes take (x + 512) >> 14.

gradientcolourssizeshead cellstail cellsrepeat
0+0x150 to +0x154+0x15c to +0x160+0x168, +0x16a+0x174, +0x176+0x16c
1+0x154 to +0x158+0x160 to +0x164+0x16e, +0x170+0x178, +0x17a+0x172

The derivation is in the doc.

Callers 4

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.