Skip to content

improve: density-aware specular kernel spread #8

@jayf0x

Description

@jayf0x

Problem

Normals are computed at a fixed Sobel spread. Large spread = smooth but loses detail; small spread = detailed but aliased. Ideal spread depends on local density.

Proposed change

Weight the Sobel spread by a function of local density. Simplest form:

```glsl
float spread = 1.0 + (1.0 - density) * k;
```

Kernel expands as density fades — less specular detail where fluid is thin.

Acceptance criteria

  • Spread scales with inverse local density
  • No specular detail in regions where fluid is near-zero
  • No regression in core specular behaviour at high density

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:renderShaders, FBOs, display passeffort:3Medium — half to full daytype:improvementEnhances existing behaviour

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions