Minor Changes
-
85f851f: Breaking Change:
<Emitter>
received a big overhaul and now supportsrate
andlimit
props, next to thesetup
callback prop that was already there. Together with the helper components from Timeline Composer, this should now allow for all typical particle emission workloads. -
ea13985: Breaking Change: Upgrade to the latest Shader Composer and Material Composer. Lots of new APIs! Aaaah! Please refer to the examples for guidance.
-
dc04f03:
VFXMaterial
and the animation modules have been extracted into a new package, Material Composer, that this library now uses as a dependency. -
c09304e: All the react-three-fiber specific bits that were formerly available at
vfx-composer/fiber
now live in a separatevfx-composer-r3f
package. -
a11c4b7: Added
useParticles
, a high-level hook that will set up the most important variables needed for typical particle systems.Added
useParticleAttribute
, a simple hook to quickly create a memoized particle attribute.A typical (minimal) particles effect now looks like this:
const Effect = () => { const particles = useParticles() const velocity = useParticleAttribute(() => new Vector3()) return ( <Particles maxParticles={1_000} safetyBuffer={1_000}> <planeGeometry args={[0.2, 0.2]} /> <composable.MeshStandardMaterial> <modules.Billboard /> <modules.Scale scale={OneMinus(particles.Progress)} /> <modules.Velocity velocity={velocity} time={particles.Age} /> <modules.Lifetime {...particles} /> </composable.MeshStandardMaterial> <Emitter rate={20} setup={() => { particles.setLifetime(between(1, 3)) velocity.value.set(plusMinus(1), between(1, 3), plusMinus(1)) }} /> </Particles> ) }