Skip to content

Spread a rounded edge's glint instead of drawing it as a broken line - #380

Merged
drehtuer merged 1 commit into
rendering/glass-reflectionsfrom
rendering/edge-seams
Oct 5, 2026
Merged

drehtuer merged 1 commit into
rendering/glass-reflectionsfrom
rendering/edge-seams

Conversation

@drehtuer

@drehtuer drehtuer commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Fix for a bug the stacked gallery showed on the Pixel 10a: thin, light dashed lines along some rounded edges of the resin dice.

Cause: the clear coat's glint on the rounded bend, not ink.

  • The bend is 2–4 px wide on screen, and the lacquer at roughness 0.12 reflects a light from only a few degrees of its sweep, so the glint is thinner than a pixel. Each pixel either catches it or misses it, which draws a dashed line.
  • It shows most on the dark, transmitting resin.

Ruled out:

  • Ink: a JVM probe of the glyph field over every bend triangle stays below the ink threshold, except the d4's documented spill. Bone dice with black numbers show a light line on the same edge.
  • Mesh cracks: none; the vertices are shared bit-identically.

Fix: Filament's geometric specular anti-aliasing on the dice materials, with Filament's defaults (variance 0.15, threshold 0.2). It raises roughness where the normal changes fast between pixels, so flat faces, numbers, the felt and the walls are unchanged. The material cache key now includes these settings, so an old packet isn't read back.

On the Pixel 10a (whole stack):

  • The d12's dashed line beside "9." is gone; the d10 7/6 edge is a soft, continuous highlight.
  • :render:filament device suite: 51/52. The one failure was StudioLightDeviceTest's first-launch studio budget at 1001 ms against 1000 in the middle of the full suite, with the phone warm. Run on its own twice it passes: 797 and 793 ms on first launch, 333 and 338 ms from the cache. That first-launch number is drifting up (582 → 797 ms) and sits close to its budget: worth watching.

Tests:

  • RoundedEdgesTest: a bend samples no ink.
  • DiceMaterialTest: the fingerprint and cache key.
  • FilamentStageTest: both materials report the anti-aliasing settings.

Based on #379.

🤖 Generated with Claude Code

The resin dice in the gallery showed thin, dashed white lines along some
rounded edges. They looked like white ink picked up by the bends, which
take their face's cell at the point under them. They are not: sampled
bilinearly, as the GPU does, the printed field on every bend of every
shape stays below the half that is a numeral's edge (worst 0.09 on a
d10, 0.30 on a d18, nought on a d12 and d20), and a bone die with black
numbers showed a light line on the same edge.

They are the lacquer's glint. A bend turns the normal through up to 90
degrees in under 0.8 mm, two to four pixels of a gallery frame, and a
coat of roughness 0.12 reflects a light from only a few of those
degrees, so the highlight is thinner than a pixel and each pixel lands
on it or misses it. Against a dark resin body that reads as a dashed
white line.

Both dice materials are now compiled with Filament's geometric specular
anti-aliasing at its default variance and threshold, which raises the
body's and the coat's roughness by how fast the normal changes between
pixels. Flat faces have a constant normal, so faces, numbers and the
tray are unchanged. The settings join the material cache key, so a
packet compiled without them is not read back.

A JVM test pins that no bend but the d4's (whose spill is by design)
samples ink; a device test checks both compiled materials carry the
anti-aliasing settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 4, 2026

Copy link
Copy Markdown

@drehtuer
drehtuer added this pull request to stack #386 October 5, 2026 06:37
@drehtuer
drehtuer merged commit 12ff4a7 into feature/realistic-rendering Oct 5, 2026
9 checks passed
@drehtuer
drehtuer deleted the rendering/edge-seams branch October 5, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant