Skip to content

Particles update on WebGL2 and keep their precision anywhere in the world #759

Description

@pasquelin

Why

Split from #420 (a came out at ~645 lines): the particle pool and its WebGPU step land with #420; WebGL2 needs its own update backend. Half-float targets lose steps under ~1.5 cm past ~32 m from the origin.

To do

  • WebGL2 particle update: the half-float ping-pong backend behind Fluids S2 (spike): one GPU particle system on WebGPU and WebGL2 #420's shared backend interface, and the composer hook that runs it.
  • Precision held anywhere in the world: particle positions are stored relative to their emitter, so a step of 1 mm holds at any distance from the origin (one mechanism on both backends; no 32-bit special case).

Code context

#420's backend interface and pool, the WebGL2 composer, the parked branch of #420's coder.

Proof

Tests by behaviour: the WebGL2 backend matches the WebGPU step on a reference emission within half-float tolerance; a 1 mm step holds at 10 km from the origin. The measurer's branch proof on WebGL2.

Links

Parent #417. Blocked by #420. Split from #420.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmeasure okTiming passed (numbers in a comment)physicsPhysics: colliders, bodies, character, fluids🟠 highHigh priority: memory recovery, constrained machines

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions