Skip to content

Commit 7c5c01e

Browse files
TMHSDigitalclaude
andauthored
fix(examples): restage swatch-grid as a tiered material library with a glowing emissive (#259)
The gallery's first card rendered its emissive swatch as a flat, clipped orange disk: a bare Emission at strength 1.4 clips the red channel across the whole face under the Standard view transform, which Layer 1 forbids. The rest of the card was six bare spheres against a wall, which read as generic at thumbnail size. The same asserted ShaderNodeEmission now owns the camera-facing face at strength 0.95 (below clipping) and hands over to a dark dielectric shell at the silhouette through a Layer Weight facing ramp, so the globe has a limb; a shadowless point at its center throws its glow onto its own collar, plinth and the floor. The spheres sit in gunmetal collars on bevelled graphite plinths in two tiers on the default stage with a 50 mm tracked camera. verify_png now samples each swatch at its camera-projected center instead of the center of an image third, so the six-region check follows the layout. Every asserted material, the --same-base falsifier and the engine-id witness are unchanged. Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent ced457f commit 7c5c01e

9 files changed

Lines changed: 397 additions & 168 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ or expand a category below.
232232
<table>
233233
<tr>
234234
<td width="46%" valign="middle">
235-
<a href="examples/swatch-grid/"><img src="examples/swatch-grid/preview.webp" alt="Swatch grid: a three-by-two grid of shaded spheres - polished gold and brushed copper metals, red and blue plastics, an emissive orange, and a matte white - against a dark studio backdrop, rendered with EEVEE" /></a>
235+
<a href="examples/swatch-grid/"><img src="examples/swatch-grid/preview.webp" alt="Swatch grid: a tiered material library in a dark studio - six spheres seated in chrome collars on graphite plinths, mirror gold, brushed copper and red plastic on tall plinths behind blue plastic, a glowing orange emissive globe and matte white in front, rendered with EEVEE" /></a>
236236
</td>
237237
<td valign="middle">
238238

-2.55 KB
Loading
1 KB
Loading

‎docs/gallery/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ <h1>Examples and Showcase</h1>
343343
<div class="grid" id="grid">
344344
<article class="card" data-tags="materials rendering">
345345
<a class="card-media" href="swatch-grid/" tabindex="-1" aria-hidden="true">
346-
<img src="assets/swatch-grid-hero.webp" alt="Six material spheres in two rows against a dark backdrop: mirror gold, brushed copper, red, blue, flat orange emission and white." loading="lazy" decoding="async" />
346+
<img src="assets/swatch-grid-hero.webp" alt="Six material spheres on graphite plinths in two tiers: mirror gold, brushed copper and red behind; blue, a glowing orange emissive globe and matte white in front." loading="lazy" decoding="async" />
347347
</a>
348348
<div class="card-body">
349349
<h2><a href="swatch-grid/">swatch-grid</a></h2>

‎docs/gallery/swatch-grid/index.html‎

Lines changed: 188 additions & 81 deletions
Large diffs are not rendered by default.

‎examples/gallery.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"name": "swatch-grid",
1010
"dir": "examples/swatch-grid",
1111
"teaches": "Procedural Principled materials — metal and dielectric, the emission pattern, and the cross-version set_specular shim.",
12-
"alt": "Six material spheres in two rows against a dark backdrop: mirror gold, brushed copper, red, blue, flat orange emission and white.",
12+
"alt": "Six material spheres on graphite plinths in two tiers: mirror gold, brushed copper and red behind; blue, a glowing orange emissive globe and matte white in front.",
1313
"witnessesFix": "EEVEE engine-id mapping: BLENDER_EEVEE on 5.x, BLENDER_EEVEE_NEXT on 4.2–4.5.",
1414
"hero": "docs/gallery/assets/swatch-grid-hero.webp",
1515
"preview": "examples/swatch-grid/preview.webp",

‎examples/swatch-grid/README.md‎

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Swatch Grid
22

3-
A runnable example that renders a 3×2 grid of spheres — one material per cell — to a single
4-
PNG. It demonstrates the [`procedural-materials-and-shaders`](../../skills/procedural-materials-and-shaders/SKILL.md)
3+
A runnable example that renders a tiered 3×2 material library — one sphere per material, each
4+
seated in a chrome collar on a graphite plinth — to a single PNG. It demonstrates the [`procedural-materials-and-shaders`](../../skills/procedural-materials-and-shaders/SKILL.md)
55
patterns end to end:
66

77
- **Principled BSDF** metals (gold, copper: high metallic, low roughness) and dielectrics
88
(red/blue plastic, white rough), configured with **string socket lookups** and **4-tuple
99
colors**.
10-
- The **emission** pattern (an emissive orange swatch).
10+
- The **emission** pattern (an emissive orange swatch, its `ShaderNodeEmission` core mixed
11+
toward a dark dielectric shell at the silhouette so it reads as a glowing globe).
1112
- The cross-version **`set_specular` shim** (`Specular` → `Specular IOR Level`, renamed in
1213
Blender 4.0).
1314

@@ -36,14 +37,31 @@ blender --background --python swatch_grid.py -- --output swatch.png --engine cyc
3637

3738
## Staging
3839

39-
The backdrop stands 0.16 behind the spheres, so each casts a soft contact
40-
shadow. It used to stand 1.58 behind them, and the grid floated. The world is
41-
a reflection-only sky: glossy rays see a warm overhead gradient above a dark
42-
horizon, and camera and diffuse rays see the dark stage. The mirror-finish
43-
gold otherwise reflected the near-black world and rendered as a black ball
44-
with two light-card glints. Sphere positions, materials, the camera and the
45-
six-region pixel check are unchanged; `verify_png` still reads six distinct
46-
regions on 4.5.11, 5.1.2 and 5.2.1.
40+
The swatches stand as a tiered material library on the default stage (floor,
41+
wall at y = 9, warm key, cool fill and rim, warm wedge pooling on the floor
42+
behind the display). Each sphere sits in a gunmetal collar on a bevelled
43+
graphite plinth; the back row stands on tall plinths so every sphere clears
44+
the one in front of it. A 50 mm camera looks down on the display with a
45+
`TRACK_TO` aim, which keeps the floor/wall seam above the back row.
46+
47+
The emissive swatch used to be a bare `Emission` at strength 1.4: under the
48+
Standard view transform its red channel clipped across the whole face and it
49+
rendered as a flat orange disk. Now the same `ShaderNodeEmission` (color and
50+
strength asserted) owns the face toward the camera at strength 0.95, below
51+
clipping, and a `Layer Weight` facing ramp hands it over to a dark dielectric
52+
shell at the silhouette, so the globe has a limb. A shadowless warm point
53+
light at its center stands in for the glow it throws on its own collar,
54+
plinth and the floor; the shell is lit from inside only on back faces, so the
55+
ball itself still shows only the asserted emission.
56+
57+
The world is a reflection-only sky: glossy rays see a warm overhead gradient
58+
above a dark horizon, and camera and diffuse rays see the dark stage. The
59+
mirror-finish gold otherwise reflects the near-black world as a black ball.
60+
61+
`verify_png` samples each swatch where the camera sees it: the sphere center
62+
is projected through the render camera (`world_to_camera_view`) rather than
63+
assumed to sit at the center of a third of the frame, so the six-region check
64+
follows the layout.
4765

4866
## Exit codes
4967

‎examples/swatch-grid/preview.webp‎

-992 Bytes
Loading

0 commit comments

Comments
 (0)