Skip to content

bug: density accumulation glow when densityDissipation=1 #5

@jayf0x

Description

@jayf0x

What's broken

When densityDissipation is exactly 1.0, density accumulates unbounded across frames. FBO values exceed 1.0, causing specular and color calculations to saturate — producing a halo/glow that doesn't correspond to actual fluid.

Reproduce

```tsx

// paint heavy strokes — glow appears and persists
```

Expected vs actual

Expected Density stays in [0, 1] regardless of dissipation
Actual Values exceed 1.0; saturated glow/halo artifact

Fix scope

Clamp density FBO output or add a soft saturation curve (tanh/smoothstep) in the display shader before normal/specular calculation. Alternatively, clamp in the advection output.

Files likely touched: src/core/shaders.ts, src/core/wgsl-shaders.ts, src/core/simulation.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:renderShaders, FBOs, display passeffort:2Small — a few hourstype:bugSomething broken

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions