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
What's broken
When
densityDissipationis exactly1.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
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