reckfellENGINE

GPU particle attractors

Region, strength, falloff, direction, masks and vector fields.

On this page

An attractor contributes force to GPU particles inside its influence region. It does not teleport them to a path, set every particle's velocity directly or alter gameplay-body gravity. Existing velocity and other material forces still matter.

Enable the interaction

  1. Enable Attractor Interaction on the emitter's ParticleProcessMaterial (AttractorInteractionEnabled).
  2. Add an appropriate particle attractor to the same effective World3D.
  3. Match its CullMask with the emitter's render Layers, not physics CollisionLayer/CollisionMask.
  4. Set its influence region and strength; initially disable unrelated movement contributors so the result is readable.
  5. Check a particle born inside the region with a suitable camera and VisibilityAabb. A correctly configured force is not proof that an offscreen effect is being drawn.

The ParticleForces.CreatePull() helper in particle collision setup creates a sphere at (1, 0, 0), Radius 3, Strength 8, Attenuation 1 and Directionality 0. Add the returned Entity to the world and enable interaction on the process material. It is an example coefficient, not a calibrated gravity preset.

The GPU test confirms central attraction, negative-strength repulsion, exclusion outside the radius and mask filtering. Turning off the material flag leaves the zero-velocity reference particles at their origin.

Interpret the controls

ControlMeaning
StrengthPositive pulls toward the chosen force direction; negative reverses it. In an ordinary nondirectional sphere/box, this means toward/away from the center.
AttenuationExponent shaping influence falloff inside the region; use a sensible nonnegative value. It is not a distance in meters or a particle speed.
Directionality0 uses the center-oriented force for sphere/box; 1 uses the attractor's local -Z direction at positive Strength. Intermediate values blend directions.
CullMaskSelect emitters by render Layers. It does not hide the attractor's effect by camera visibility layers.
Radius / SizeInfluence region of the corresponding shape. Box Size is full local dimensions, not half extents.

Rotating a fully directional attractor changes the force axis. The native test rotates it so local -Z points sideways and confirms sideways acceleration. Negative Strength reverses that direction. Position still matters for whether the particles are inside the region and its falloff.

Particles can cross the center or overshoot because a force accelerates them instead of pinning them. Use lifetime, damping, initial velocity and simulation fidelity deliberately rather than increasing Strength until the motion appears correct in one frame.

Choose a shape

Sphere and box define simple influence regions. Prefer their explicit Radius/Size for a controlled test; do not assume every nonuniform transform or moving-volume case has the same validated behavior.

A vector-field attractor reads a Texture3D over its box region. The shader linearly samples the field, decodes signed direction/strength around neutral (0.5, 0.5, 0.5), and adds a force with the configured strength, falloff and directionality. It is not a nearest-vector snap or a direct assignment to particle velocity.

For the default nondirectional field interpretation, RGB components above/below 0.5 represent positive/negative components after decoding. Test a known constant field before complex noise, including the imported texture's axis/encoding conventions. Do not infer a universal Y-flip from how a 2D image viewer displays slices. The current pass reviews field sampling in source; it does not claim an executed vector-texture example.

Keep the force and render bound consistent

A particle's path can leave its original spawn region. VisibilityAabb must cover the intended trajectory and mesh size; an attractor does not enlarge it automatically. A disappearing effect may be a culling problem rather than a missing force.

Shared ParticleProcessMaterial resources share AttractorInteractionEnabled and other settings. Create separate resources when emitters must react differently, or use render layers/masks intentionally. An ordinary Area3D or physics gravity override is not automatically a GPU particle attractor.

Diagnose a force that looks wrong

SymptomCheck
No visible responseMaterial interaction flag, same World3D, region, masks and whether the effect is visible.
Everything accelerates the wrong wayStrength sign, Directionality, rotation and the texture encoding for a field.
Force stops abruptlyRegion boundary, lifetime and render culling.
Particles oscillate through the centerExisting velocity and acceleration; attraction is not position locking.
Changing one emitter changes anotherShared process material.
Vector field gives unexpected slice directionsTexture3D layout, signed encoding and transform; start with a simple known vector.

The native checks use a sphere on Windows Forward+/Vulkan. Vector textures, nonuniform scaling, moving attractors, combined fields, all hardware/export paths and performance are separate validation. These forces are visual particle simulation, not a substitute for authoritative gameplay physics.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.