Skip to content

improve: warm-start pressure solver from previous frame #10

@jayf0x

Description

@jayf0x

Problem

Each frame, the pressure Jacobi solver starts from stale/garbage pressure. With pressureIterations=1 (default), it barely converges. The divergence changes slowly between frames, so the previous converged pressure is a good initial guess.

Proposed change

Remove the explicit pressure-FBO clear before the Jacobi solve loop. Keep the previous frame's pressure as the starting point — warm-starting means even 1 iteration produces a much better result.

Acceptance criteria

  • Pressure FBO is NOT cleared before the solve loop
  • Jacobi iterations run from previous frame's pressure
  • Fluid looks smoother/more divergence-free at pressureIterations=1
  • No new FBOs added

Files likely touched: src/core/simulation.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:physicsFluid solver, pressure, advectioneffort:2Small — a few hourstype:improvementEnhances existing behaviour

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions