Skip to content

Commit 6d6082f

Browse files
committed
fix: rake gn-sdf-remesh with a low key so the SDF facets glint
1 parent 6f6221e commit 6d6082f

5 files changed

Lines changed: 18 additions & 12 deletions

File tree

470 Bytes
Loading
497 KB
Loading

‎docs/gallery/gn-sdf-remesh/index.html‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ <h2>Source</h2>
252252
p.use_smooth = <span class="k">True</span>
253253
mat = bpy.data.materials.new(<span class="s">&quot;Ceramic&quot;</span>); mat.use_nodes = <span class="k">True</span>
254254
b = mat.node_tree.nodes.get(<span class="s">&#x27;Principled BSDF&#x27;</span>)
255-
b.inputs[<span class="s">&#x27;Base Color&#x27;</span>].default_value = (<span class="n">0.42</span>, <span class="n">0.028</span>, <span class="n">0.045</span>, <span class="n">1</span>) <span class="c"># crimson ceramic</span>
256-
b.inputs[<span class="s">&#x27;Roughness&#x27;</span>].default_value = <span class="n">0.22</span>
255+
b.inputs[<span class="s">&#x27;Base Color&#x27;</span>].default_value = (<span class="n">0.45</span>, <span class="n">0.025</span>, <span class="n">0.05</span>, <span class="n">1</span>) <span class="c"># crimson ceramic</span>
256+
b.inputs[<span class="s">&#x27;Roughness&#x27;</span>].default_value = <span class="n">0.16</span> <span class="c"># glossy: the SDF facets read by their glints</span>
257257
obj.data.materials.append(mat)
258258
<span class="k">return</span> obj
259259

@@ -275,12 +275,15 @@ <h2>Source</h2>
275275
wall.rotation_euler = (<span class="n">1.5708</span>, <span class="n">0</span>, <span class="n">0</span>); bpy.context.collection.objects.link(wall)
276276
w = bpy.data.worlds.new(<span class="s">&quot;W&quot;</span>); w.use_nodes = <span class="k">True</span>
277277
w.node_tree.nodes[<span class="s">&quot;Background&quot;</span>].inputs[<span class="n">0</span>].default_value = (<span class="n">0.02</span>, <span class="n">0.021</span>, <span class="n">0.025</span>, <span class="n">1</span>); sc.world = w
278-
aim = bpy.data.objects.new(<span class="s">&quot;Aim&quot;</span>, <span class="k">None</span>); aim.location = (<span class="n">0</span>, <span class="n">0</span>, <span class="n">0.55</span>); bpy.context.collection.objects.link(aim)
279-
cam = bpy.data.objects.new(<span class="s">&quot;cam&quot;</span>, bpy.data.cameras.new(<span class="s">&quot;cam&quot;</span>)); cam.location = (<span class="n">0</span>, -<span class="n">6.5</span>, <span class="n">2.2</span>)
278+
aim = bpy.data.objects.new(<span class="s">&quot;Aim&quot;</span>, <span class="k">None</span>); aim.location = (<span class="n">0</span>, <span class="n">0</span>, <span class="n">0.5</span>); bpy.context.collection.objects.link(aim)
279+
<span class="c"># off-axis and low: the remesh facets are the API evidence, and they only</span>
280+
<span class="c"># read when a raking key skims them from the side</span>
281+
cam = bpy.data.objects.new(<span class="s">&quot;cam&quot;</span>, bpy.data.cameras.new(<span class="s">&quot;cam&quot;</span>)); cam.location = (<span class="n">2.6</span>, -<span class="n">5.2</span>, <span class="n">1.5</span>)
280282
bpy.context.collection.objects.link(cam); sc.camera = cam
281283
c = cam.constraints.new(<span class="s">&#x27;TRACK_TO&#x27;</span>); c.target = aim; c.track_axis = <span class="s">&#x27;TRACK_NEGATIVE_Z&#x27;</span>; c.up_axis = <span class="s">&#x27;UP_Y&#x27;</span>
282-
<span class="c"># shaped warm key, faint cool fill (docs/VISUAL-STYLE.md)</span>
283-
<span class="k">for</span> nm, loc, en, sz, col <span class="k">in</span> [(<span class="s">&quot;K&quot;</span>, (-<span class="n">4</span>, -<span class="n">5</span>, <span class="n">7</span>), <span class="n">650</span>, <span class="n">4.5</span>, (<span class="n">1.0</span>, <span class="n">0.96</span>, <span class="n">0.9</span>)),
284+
<span class="c"># low raking warm key so every facet catches a distinct glint, faint cool</span>
285+
<span class="c"># fill (docs/VISUAL-STYLE.md)</span>
286+
<span class="k">for</span> nm, loc, en, sz, col <span class="k">in</span> [(<span class="s">&quot;K&quot;</span>, (-<span class="n">5</span>, -<span class="n">3.5</span>, <span class="n">2.8</span>), <span class="n">480</span>, <span class="n">3.0</span>, (<span class="n">1.0</span>, <span class="n">0.96</span>, <span class="n">0.9</span>)),
284287
(<span class="s">&quot;F2&quot;</span>, (<span class="n">5</span>, -<span class="n">4</span>, <span class="n">2</span>), <span class="n">110</span>, <span class="n">7.0</span>, (<span class="n">0.75</span>, <span class="n">0.85</span>, <span class="n">1.0</span>))]:
285288
ld = bpy.data.lights.new(nm, <span class="s">&#x27;AREA&#x27;</span>); ld.energy = en; ld.size = sz; ld.color = col
286289
lo = bpy.data.objects.new(nm, ld); lo.location = loc; bpy.context.collection.objects.link(lo)

‎examples/gn-sdf-remesh/gn_sdf_remesh.py‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def build():
4949
p.use_smooth = True
5050
mat = bpy.data.materials.new("Ceramic"); mat.use_nodes = True
5151
b = mat.node_tree.nodes.get('Principled BSDF')
52-
b.inputs['Base Color'].default_value = (0.42, 0.028, 0.045, 1) # crimson ceramic
53-
b.inputs['Roughness'].default_value = 0.22
52+
b.inputs['Base Color'].default_value = (0.45, 0.025, 0.05, 1) # crimson ceramic
53+
b.inputs['Roughness'].default_value = 0.16 # glossy: the SDF facets read by their glints
5454
obj.data.materials.append(mat)
5555
return obj
5656

@@ -72,12 +72,15 @@ def render_still(obj, path, engine):
7272
wall.rotation_euler = (1.5708, 0, 0); bpy.context.collection.objects.link(wall)
7373
w = bpy.data.worlds.new("W"); w.use_nodes = True
7474
w.node_tree.nodes["Background"].inputs[0].default_value = (0.02, 0.021, 0.025, 1); sc.world = w
75-
aim = bpy.data.objects.new("Aim", None); aim.location = (0, 0, 0.55); bpy.context.collection.objects.link(aim)
76-
cam = bpy.data.objects.new("cam", bpy.data.cameras.new("cam")); cam.location = (0, -6.5, 2.2)
75+
aim = bpy.data.objects.new("Aim", None); aim.location = (0, 0, 0.5); bpy.context.collection.objects.link(aim)
76+
# off-axis and low: the remesh facets are the API evidence, and they only
77+
# read when a raking key skims them from the side
78+
cam = bpy.data.objects.new("cam", bpy.data.cameras.new("cam")); cam.location = (2.6, -5.2, 1.5)
7779
bpy.context.collection.objects.link(cam); sc.camera = cam
7880
c = cam.constraints.new('TRACK_TO'); c.target = aim; c.track_axis = 'TRACK_NEGATIVE_Z'; c.up_axis = 'UP_Y'
79-
# shaped warm key, faint cool fill (docs/VISUAL-STYLE.md)
80-
for nm, loc, en, sz, col in [("K", (-4, -5, 7), 650, 4.5, (1.0, 0.96, 0.9)),
81+
# low raking warm key so every facet catches a distinct glint, faint cool
82+
# fill (docs/VISUAL-STYLE.md)
83+
for nm, loc, en, sz, col in [("K", (-5, -3.5, 2.8), 480, 3.0, (1.0, 0.96, 0.9)),
8184
("F2", (5, -4, 2), 110, 7.0, (0.75, 0.85, 1.0))]:
8285
ld = bpy.data.lights.new(nm, 'AREA'); ld.energy = en; ld.size = sz; ld.color = col
8386
lo = bpy.data.objects.new(nm, ld); lo.location = loc; bpy.context.collection.objects.link(lo)
348 Bytes
Loading

0 commit comments

Comments
 (0)