Skip to content

Commit 3b63a5b

Browse files
TMHSDigitalclaude
andcommitted
fix(examples): redesign custom-normals-shade edge overlay as amber drafting lines
The by-angle can's sharp_edge overlay was cyan at emission 1.0 and read as a glow halo, not a drawing of the data. It is now a thinner tube (radius 0.0026 -> 0.0019) in warm amber ink at emission 0.25, legible on the shadow side without blooming. The edges it traces are still read back from the mesh's sharp_edge attribute. Render path only; checks unchanged. Evidence (live runs, local): - E:/Blender-Developer-Tools/.scratch/blender-5.2.1-windows-x64/blender.exe (Blender 5.2.1 LTS): check-only exit 0; render framing fill x=0.797 y=0.750, margins l=0.116 r=0.088 b=0.122 t=0.128; aq_ok (materials n=3, edge90 0.086). - E:/Blender-Developer-Tools/.scratch/blender-4.5.11-windows-x64/blender.exe (Blender 4.5.11 LTS): check-only exit 0. - Contact sheet: candidate luma 0.275 / stage 0.227 / warmth +0.084 / sat 0.192 against armature-bend 0.243/0.192/-0.144/0.237, damped-track-aim 0.237/0.218/+0.105/0.178, and bmesh-gear 0.236/0.177/+0.303/0.250. - Asset sheet (docs/gallery/asset-sheets/custom-normals-shade.webp): model unchanged; the can holds its place in the reference lineup. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 0216ae8 commit 3b63a5b

8 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ concave grooves are free.
10001000
</tr>
10011001
<tr>
10021002
<td width="46%" valign="middle">
1003-
<a href="examples/custom-normals-shade/"><img src="examples/custom-normals-shade/preview.webp" alt="Custom normals and shade by angle: three olive-drab jerry cans with X-pressed panels, triple handles and red-sealed spouts on a dark studio floor - one faceted flat, one smeared glossy by smooth-everything, one crisp by-angle with its sharp edges traced in thin cyan lines - proving the post-4.1 shading contract" /></a>
1003+
<a href="examples/custom-normals-shade/"><img src="examples/custom-normals-shade/preview.webp" alt="Custom normals and shade by angle: three olive-drab jerry cans with X-pressed panels, triple handles and red-sealed spouts on a dark studio floor - one faceted flat, one smeared glossy by smooth-everything, one crisp by-angle with its sharp edges traced in thin amber lines - proving the post-4.1 shading contract" /></a>
10041004
</td>
10051005
<td valign="middle">
10061006

1.52 KB
Loading
-6.72 KB
Loading
7.17 KB
Loading

‎examples/custom-normals-shade/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ treatment. Left, flat: the side-band corners, cap and handle break into
8080
facets. Middle, smooth-everywhere (the shade-smooth-and-forget AI habit):
8181
the flat fields smear into gradients and the pressed panels go pillowy.
8282
Right, by-angle (the contract): crisp creases and smooth rounds, with the
83-
`sharp_edge` attribute read back from the mesh and traced as thin cyan
84-
lines, so the viewer sees exactly which edges the data marked hard. A
83+
`sharp_edge` attribute read back from the mesh and traced as thin amber
84+
drafting lines (low emission, no bloom halo), so the viewer sees exactly which edges the data marked hard. A
8585
low strip light makes the highlight shapes diverge between the three.
8686

8787
## Run

‎examples/custom-normals-shade/custom_normals_shade.py‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ def shade(parts, mode):
757757
me.set_sharp_from_angle(angle=ANGLE)
758758

759759

760-
def sharp_edge_overlay(parts, name, radius=0.0026):
760+
def sharp_edge_overlay(parts, name, radius=0.0019):
761761
"""Thin tubes along every edge the `sharp_edge` attribute marks — the
762762
contract's own output drawn onto the by-angle can, read back from the
763763
mesh rather than recomputed."""
@@ -815,12 +815,15 @@ def render_still(can, path, engine):
815815
variants[mode] = built
816816
hero = [o for objs in variants.values() for o in objs]
817817
edges = sharp_edge_overlay(variants["byangle"], "SharpEdgeOverlay")
818-
glow = bpy.data.materials.new("SharpEdgeGlow")
818+
# a drafting line, not a glow: warm amber ink with just enough emission
819+
# to stay legible on the shadow side of the can, no bloom halo
820+
glow = bpy.data.materials.new("SharpEdgeInk")
819821
glow.use_nodes = True
820822
gb = glow.node_tree.nodes["Principled BSDF"]
821-
gb.inputs["Base Color"].default_value = (0.35, 0.85, 1.0, 1.0)
822-
gb.inputs["Emission Color"].default_value = (0.35, 0.85, 1.0, 1.0)
823-
gb.inputs["Emission Strength"].default_value = 1.0
823+
gb.inputs["Base Color"].default_value = (0.85, 0.40, 0.06, 1.0)
824+
gb.inputs["Roughness"].default_value = 0.6
825+
gb.inputs["Emission Color"].default_value = (1.0, 0.50, 0.08, 1.0)
826+
gb.inputs["Emission Strength"].default_value = 0.25
824827
edges.data.materials.append(glow)
825828
edges.location = variants["byangle"][0].location
826829
edges.rotation_euler = variants["byangle"][0].rotation_euler
-6.43 KB
Loading

‎examples/gallery.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@
447447
"name": "custom-normals-shade",
448448
"dir": "examples/custom-normals-shade",
449449
"teaches": "A jerry can prop shaded three ways to prove the post-4.1 shading contract: hard edges are mesh data, landing exactly where the dihedral crosses. Face smooth flags plus a sharp_edge attribute, verified against an independently recomputed dihedral test, and per-loop custom normals surviving depsgraph evaluation within their int16 storage quantization (3.904e-05 over 8196 loops, not float-exact).",
450-
"alt": "Three olive jerry cans with X-pressed panels, triple handles and red-sealed spouts: faceted flat, glossy-smeared smooth-everywhere, and crisp by-angle with its sharp edges traced in thin cyan lines.",
450+
"alt": "Three olive jerry cans with X-pressed panels, triple handles and red-sealed spouts: faceted flat, glossy-smeared smooth-everywhere, and crisp by-angle with its sharp edges traced in thin amber lines.",
451451
"witnessesFix": "use_auto_smooth, use_custom_normals and calc_normals are AttributeError on BOTH 4.5 LTS and 5.1 - AI code still emits them. The legacy shade_auto_smooth operator CANCELS headless on 4.5 (asset load never finishes; mesh untouched; no exception) while 5.1 FINISHES with the Smooth by Angle NODES modifier. By-angle sharp sets match the independent dihedral recompute exactly (1304 of 4738 edges over 3 meshes).",
452452
"hero": "docs/gallery/assets/custom-normals-shade-hero.webp",
453453
"preview": "examples/custom-normals-shade/preview.webp",

0 commit comments

Comments
 (0)