Skip to content

Commit bd0671c

Browse files
TMHSDigitalclaude
andauthored
fix(examples): redesign shader-node-group as five dipped-glaze stoneware mugs (#276)
* fix(examples): redesign shader-node-group as five dipped-glaze stoneware mugs The gallery review judged the hero programmer art: two plain glossy spheres, teal and magenta, with nothing to show that a shared group was doing any work. The group is now a designed DippedGlaze stoneware shader. It has bare buff clay at the foot, a noise-wobbled dip line, iron speckle, and a glaze that breaks back toward clay over the rim. It is instanced in five mug materials (oxblood, amber, celadon, teal, cobalt). The mugs are lathed with a foot ring, bellied wall and rolled lip, with a swept oval handle. They stand as a staggered shop-display lineup on a walnut riser. Every mug carries the same foot band, dip line and speckle field. Only the instance Tint differs, which is the grouping contract made visible. The check is at least as strict as before. users must equal the number of materials (5, was 2), and all instance Tints must be pairwise distinct (was a single a != b). --same-tint still lands on exit 6. The stage now has the house wedge, and the key spread is narrowed off the back wall. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> * chore(gallery): regenerate pages for the shader-node-group mug lineup Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> --------- Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 1b096de commit bd0671c

9 files changed

Lines changed: 503 additions & 152 deletions

File tree

‎README.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,16 @@ mapping (`BLENDER_EEVEE` on 5.x, `BLENDER_EEVEE_NEXT` on 4.2-4.5).
246246
</tr>
247247
<tr>
248248
<td width="46%" valign="middle">
249-
<a href="examples/shader-node-group/"><img src="examples/shader-node-group/preview.webp" alt="Shader node group: a teal sphere and a magenta sphere sharing one TintedGloss node group with different Tint parameters" /></a>
249+
<a href="examples/shader-node-group/"><img src="examples/shader-node-group/preview.webp" alt="Shader node group: five speckled stoneware mugs in oxblood, amber, celadon, teal and cobalt sharing one DippedGlaze node group with different Tint parameters" /></a>
250250
</td>
251251
<td valign="middle">
252252

253253
### [shader-node-group](examples/shader-node-group/)
254254

255-
One reusable `TintedGloss` group declared via `tree.interface.new_socket`, instanced in two
255+
One reusable `DippedGlaze` group declared via `tree.interface.new_socket`, instanced in five
256256
materials with different Tint values. Witnesses the grouping contract: shared datablock
257-
(`users == 2`), parameters on the group **node** — two spheres, one group, two colors.
257+
(`users == 5`), parameters on the group **node** — five mugs share one foot band, dip line
258+
and speckle, and differ only in colour.
258259

259260
</td>
260261
</tr>
9.91 KB
Loading
-9.1 KB
Loading

‎docs/gallery/index.html‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,12 @@ <h2><a href="bmesh-gear/">bmesh-gear</a></h2>
420420
</article>
421421
<article class="card" data-tags="materials node-groups">
422422
<a class="card-media" href="shader-node-group/" tabindex="-1" aria-hidden="true">
423-
<img src="assets/shader-node-group-hero.webp" alt="Two glossy spheres, one teal and one magenta, sharing one shader group." loading="lazy" decoding="async" />
423+
<img src="assets/shader-node-group-hero.webp" alt="Five speckled stoneware mugs in oxblood, amber, celadon, teal and cobalt on a walnut riser, each with the same bare clay foot and wavy dip line from one shared glaze group." loading="lazy" decoding="async" />
424424
</a>
425425
<div class="card-body">
426426
<h2><a href="shader-node-group/">shader-node-group</a></h2>
427-
<p class="teaches">One reusable shader group declared via tree.interface.new_socket, instanced in two materials with different Tint values — two spheres, one group, two colors.</p>
428-
<p class="witnesses"><span class="tag">witnesses</span> Grouping contract: interface sockets appear on every instance, both materials share one group datablock (users == 2), and per-material parameters live on the group node, not inside the tree.</p>
427+
<p class="teaches">One reusable shader group declared via tree.interface.new_socket, instanced in five materials with different Tint values — one dipped-glaze group, five stoneware mugs, five colors.</p>
428+
<p class="witnesses"><span class="tag">witnesses</span> Grouping contract: interface sockets appear on every instance, all five materials share one group datablock (users == 5), and per-material parameters live on the group node, not inside the tree.</p>
429429
<a class="card-link" href="shader-node-group/">View example<span class="sr-only"> shader-node-group</span> <span aria-hidden="true">&rarr;</span></a>
430430
</div>
431431
</article>

‎docs/gallery/shader-node-group/index.html‎

Lines changed: 243 additions & 72 deletions
Large diffs are not rendered by default.

‎examples/gallery.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@
9999
{
100100
"name": "shader-node-group",
101101
"dir": "examples/shader-node-group",
102-
"teaches": "One reusable shader group declared via tree.interface.new_socket, instanced in two materials with different Tint values — two spheres, one group, two colors.",
103-
"alt": "Two glossy spheres, one teal and one magenta, sharing one shader group.",
104-
"witnessesFix": "Grouping contract: interface sockets appear on every instance, both materials share one group datablock (users == 2), and per-material parameters live on the group node, not inside the tree.",
102+
"teaches": "One reusable shader group declared via tree.interface.new_socket, instanced in five materials with different Tint values — one dipped-glaze group, five stoneware mugs, five colors.",
103+
"alt": "Five speckled stoneware mugs in oxblood, amber, celadon, teal and cobalt on a walnut riser, each with the same bare clay foot and wavy dip line from one shared glaze group.",
104+
"witnessesFix": "Grouping contract: interface sockets appear on every instance, all five materials share one group datablock (users == 5), and per-material parameters live on the group node, not inside the tree.",
105105
"hero": "docs/gallery/assets/shader-node-group-hero.webp",
106106
"preview": "examples/shader-node-group/preview.webp",
107107
"tags": [

‎examples/shader-node-group/README.md‎

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
# Shader Node Group
22

3-
A runnable example that declares a reusable `TintedGloss` shader group through
3+
A runnable example that declares a reusable `DippedGlaze` shader group through
44
`tree.interface.new_socket` — the 4.x/5.x API that replaced `tree.inputs`/`tree.outputs` —
5-
and instances it in two materials with different parameters, following
5+
and instances it in five mug materials with different parameters, following
66
[`procedural-materials-and-shaders`](../../skills/procedural-materials-and-shaders/SKILL.md)
77
and the [`shader-node-group`](../../snippets/shader-node-group.py) snippet.
88

99
**What it witnesses:** the grouping contract. Sockets declared on the interface appear on
10-
every group-node instance; both materials share ONE group datablock (`users == 2`); and the
11-
per-material Tint lives on the group **node**, not inside the group — set it inside the tree
12-
and every material changes at once. The render is the proof: two spheres, one group, two
13-
colors.
10+
every group-node instance; all five materials share ONE group datablock (`users == 5`); and
11+
the per-material Tint lives on the group **node**, not inside the group — set it inside the
12+
tree and every mug changes at once.
13+
14+
**The render is the proof.** The group is a dipped stoneware glaze: bare buff clay at the
15+
foot, a wavy dip line, iron speckle through clay and glaze alike, and a glaze that breaks
16+
back toward clay over the rim. All of that lives inside the group, so the five mugs — a
17+
warm-to-cool lineup of oxblood, amber, celadon, teal and cobalt — carry the same foot band,
18+
the same dip line, the same speckle field and the same rim break. Only the instance-level
19+
Tint differs. If Tint were baked into the group, the lineup would be one colour; if each
20+
material built its own tree, the shared character would be a copy rather than one
21+
datablock (the check's `users` gate).
1422

1523
## Staging
1624

17-
The still renders under the Standard view transform on the dark house
18-
stage; it had no view transform set, so AgX washed both tints toward
19-
pastel over a lighter floor. The key is larger and softer (the glossy
20-
spheres had mirrored it as a hard white square), and the camera aims
21-
at the sphere centres. Render path only.
25+
A staggered shop-display lineup on the dark house stage: the odd mugs stand on a low
26+
walnut riser behind the even ones, so five mugs fill the frame without shrinking to a
27+
thin strip. Handles all turn the same way so the only thing that changes along the row is
28+
colour. The still renders under the Standard view transform (AgX would wash the five
29+
tints toward pastel); the key's spread is narrowed so it lights the mugs, not the back
30+
wall, and a warm wedge sits between the riser and the wall. Render path only.
2231

2332
## Run
2433

@@ -30,8 +39,8 @@ blender --background --python shader_node_group.py --
3039
blender --background --python shader_node_group.py -- --same-tint
3140

3241
# Also render a still (EEVEE on a GPU host; use --engine cycles on GPU-less hosts):
33-
blender --background --python shader_node_group.py -- --output spheres.png
34-
blender --background --python shader_node_group.py -- --output spheres.png --engine cycles
42+
blender --background --python shader_node_group.py -- --output mugs.png
43+
blender --background --python shader_node_group.py -- --output mugs.png --engine cycles
3544
```
3645

3746
## Exit codes
@@ -45,9 +54,9 @@ against it. `10` is the shared framing helper.
4554
| 1 | Uncaught exception (FATAL wrapper) |
4655
| 2 | argparse / usage |
4756
| 3 | Interface sockets missing Tint / Roughness / Shader |
48-
| 4 | Group datablock `users` ≠ 2 |
57+
| 4 | Group datablock `users` ≠ number of mug materials (5) |
4958
| 5 | Instance points at a different node tree |
50-
| 6 | Instance Tint values identical (`--same-tint` lands here) |
59+
| 6 | Instance Tint values not pairwise distinct (`--same-tint` lands here) |
5160
| 7 | `--output` produced no file |
5261
| 10 | Gallery framing violation |
5362

8.25 KB
Loading

0 commit comments

Comments
 (0)