Skip to content

Commit 1f6eba6

Browse files
feat: add sky-texture-sun-elevation example (#99)
Witness World ShaderNodeTexSky across 4.5 NISHITA vs 5.1 MULTIPLE_SCATTERING, the dust_density/aerosol_density trap, and sun_elevation zenith rise with a dual-elevation gallery diptych. Signed-off-by: fOuttaMyPaint <TMhospitalitystrategies@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 15dc4f7 commit 1f6eba6

12 files changed

Lines changed: 1425 additions & 3 deletions

File tree

.cursor-plugin/plugin.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"examples/png-exr-alpha",
8282
"examples/shader-node-group",
8383
"examples/shape-key-blend",
84+
"examples/sky-texture-sun-elevation",
8485
"examples/swatch-grid",
8586
"examples/temp-override-join",
8687
"examples/text-version-stamp",

.github/workflows/blender-smoke.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,3 +474,14 @@ jobs:
474474
# Exits non-zero on failure.
475475
xvfb-run -a "$BLENDER" --background \
476476
--python examples/custom-normals-shade/custom_normals_shade.py --
477+
478+
- name: Shipped example - sky texture sun elevation (Nishita / MS + zenith rise)
479+
run: |
480+
set -euo pipefail
481+
# Check only (no gallery still): World ShaderNodeTexSky drives
482+
# Background Color; sky_type is NISHITA on 4.5 and MULTIPLE_SCATTERING
483+
# on 5.1 (NISHITA gone); dust_density is 4.5-only (aerosol_density on
484+
# 5.1). Two tiny Cycles OPEN_EXR zenith probes assert sun_elevation
485+
# 8→55 deg brightens zenith (rise gate ≥ 1.25). Exits non-zero on failure.
486+
xvfb-run -a "$BLENDER" --background \
487+
--python examples/sky-texture-sun-elevation/sky_texture_sun_elevation.py --

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</p>
1919

2020
<p align="center">
21-
<strong>12 skills</strong> &nbsp;&bull;&nbsp; <strong>6 rules</strong> &nbsp;&bull;&nbsp; <strong>2 templates</strong> &nbsp;&bull;&nbsp; <strong>17 snippets</strong> &nbsp;&bull;&nbsp; <strong>32 examples</strong>
21+
<strong>12 skills</strong> &nbsp;&bull;&nbsp; <strong>6 rules</strong> &nbsp;&bull;&nbsp; <strong>2 templates</strong> &nbsp;&bull;&nbsp; <strong>17 snippets</strong> &nbsp;&bull;&nbsp; <strong>33 examples</strong>
2222
</p>
2323

2424
<p align="center">
@@ -36,7 +36,7 @@
3636

3737
## Overview
3838

39-
This repository ships **12 skills, 6 rules, 2 templates, 17 snippets, and 32 runnable examples** for Blender Python development targeting Blender 5.1 (current stable) with Blender 4.5 LTS fallback support.
39+
This repository ships **12 skills, 6 rules, 2 templates, 17 snippets, and 33 runnable examples** for Blender Python development targeting Blender 5.1 (current stable) with Blender 4.5 LTS fallback support.
4040

4141
The content is consumed by AI coding agents (Cursor, Claude Code, any MCP-capable client) when working on Blender add-ons, geometry nodes scripts, batch pipelines, or animation tooling. There is no build step. Edit the markdown and Python files directly.
4242

@@ -85,7 +85,7 @@ or expand a category below.
8585
</p>
8686

8787
<details>
88-
<summary><strong>Materials, shading &amp; compositing</strong> — 6 examples</summary>
88+
<summary><strong>Materials, shading &amp; compositing</strong> — 7 examples</summary>
8989

9090
<table>
9191
<tr>
@@ -179,6 +179,23 @@ as if associated-alpha — straight-authored dark values at low alpha clamp to w
179179
(closed-form error **0.98** at `(0.02, a=1/255)`). OpenEXR preserves float RGBA;
180180
byte images stay straight 8-bit. Also witnesses `EXR color_mode='RGB'` dropping alpha.
181181

182+
</td>
183+
</tr>
184+
<tr>
185+
<td width="46%" valign="middle">
186+
<a href="examples/sky-texture-sun-elevation/"><img src="examples/sky-texture-sun-elevation/preview.webp" alt="Sky texture sun elevation: terracotta jar diptych on a dark floor — left panel low sun at 8 degrees with a deep blue zenith and warm horizon limb, right panel high sun at 55 degrees with a brighter cyan sky, proving ShaderNodeTexSky sun_elevation" /></a>
187+
</td>
188+
<td valign="middle">
189+
190+
### [sky-texture-sun-elevation](examples/sky-texture-sun-elevation/)
191+
192+
World `ShaderNodeTexSky` driving Background Color — the sky contract AI lighting
193+
code misses across 4.5 → 5.1. `sky_type` is `NISHITA` on 4.5 LTS and
194+
`MULTIPLE_SCATTERING` on 5.1 (`NISHITA` gone); `dust_density` exists only on 4.5
195+
(`aerosol_density` on 5.1). Two tiny Cycles EXR zenith probes assert
196+
`sun_elevation` 8° → 55° brightens zenith (rise **2.25x** / **1.50x**, gate ≥ 1.25).
197+
Gallery still is a dual-elevation diptych so the contract reads at thumbnail scale.
198+
182199
</td>
183200
</tr>
184201
</table>

ROADMAP.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ Not committed; target list for the next content version. (v0.3.0 shipped the smo
114114
- Falsy `bpy_prop_collection` trap snippet: an empty collection is falsy, so `editor.strips or editor.sequences` silently falls through to the legacy accessor on an empty timeline — always branch on `hasattr`; likely generalizes across the API (found authoring `vse-cut-list`)
115115
- ~~Collision compound witness~~ **SHIPPED** as `examples/collision-hull-proxy/` — game-prop collision as a compound of convex pieces, each a `bmesh.ops.convex_hull` of a coarse `sec(π/n)`-inflated cage (containment 4.4e-08, watertight, positive signed volume, Euler 2, per-piece 255-face budget: body 70, caps 60×3, compound 250); a hull of the dense render mesh measures 380 faces — over budget — which is why pipelines hull cages; proud details cost cage rows, concave grooves are free; byte-identical on 4.5.11 and 5.1.2
116116
- ~~Custom-normals / shade-by-angle witness~~ **SHIPPED** as `examples/custom-normals-shade/` — the post-4.1 shading contract: `use_auto_smooth`/`use_custom_normals`/`calc_normals` are AttributeError on BOTH 4.5.11 and 5.1.2; `set_sharp_from_angle` sharp sets match an independent dihedral recompute exactly (188/388 edges, 3 meshes); evaluated normal welds/splits exact (0.0 dev); custom split normals survive depsgraph evaluation within int16 quantization (1.407e-04, not float-exact); **divergence**: the legacy `shade_auto_smooth` operator CANCELS headless on 4.5 ("Asset loading is unfinished", mesh untouched, no exception) while 5.1 FINISHES with the Smooth-by-Angle NODES modifier — the data API is the portable path
117+
- ~~Sky Texture / sun_elevation witness~~ **SHIPPED** as `examples/sky-texture-sun-elevation/` — World `ShaderNodeTexSky` → Background; `sky_type` is `NISHITA` on 4.5 and `MULTIPLE_SCATTERING` on 5.1 (`NISHITA` gone); `dust_density` is 4.5-only (`aerosol_density` on 5.1); zenith EXR rise 8°→55° measured **2.25x** (5.1.2) / **1.50x** (4.5.11), gate ≥ 1.25; dual-elevation gallery diptych
118+
- Grease Pencil Line Art contour witness: empty GPv3 object + `modifiers.new(..., "LINEART")`; `thickness` on 4.5 vs `radius` on 5.1; evaluated contour stroke counts for a known source mesh
119+
- Camera DOF + focus_distance witness: `cam.dof.use_dof`, focus plane vs defocus variance on high-freq cards (Stage deviation — depth needs background content)
120+
- Volumetric scatter optical-depth witness: Volume Scatter density → Beer–Lambert transmittance along a known path (Cycles; Stage deviation)
121+
- Freestyle SVG / line-set witness: Freestyle line set on a silhouette (full render pass; prefer Line Art first)
117122
- prop-origin-transform witness — origin to base center, `transform_apply` through the data API, delta transforms, `matrix_parent_inverse` so parented children do not teleport; closed forms: post-apply scale exactly (1,1,1), local bbox min Z == 0, world bbox unchanged (builds on `parent-inverse-orrery`, does not duplicate it)
118123
- mesh-hygiene-audit witness — the engine-ingest checklist as executable contract: no ngons, no loose vertices, no non-manifold edges, no zero-area faces, consistent outward winding; closed forms via Euler characteristic and exact edge-face incidence counts
119124

18 KB
Loading
22 KB
Loading

docs/gallery/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,14 @@ <h1>Examples Gallery</h1>
197197
<button class="chip" data-tag="objects" type="button">objects</button>
198198
<button class="chip" data-tag="operators" type="button">operators</button>
199199
<button class="chip" data-tag="performance" type="button">performance</button>
200+
<button class="chip" data-tag="render" type="button">render</button>
200201
<button class="chip" data-tag="rendering" type="button">rendering</button>
201202
<button class="chip" data-tag="sequencer" type="button">sequencer</button>
202203
<button class="chip" data-tag="shape-keys" type="button">shape-keys</button>
204+
<button class="chip" data-tag="sky" type="button">sky</button>
203205
<button class="chip" data-tag="transforms" type="button">transforms</button>
204206
<button class="chip" data-tag="uv" type="button">uv</button>
207+
<button class="chip" data-tag="world" type="button">world</button>
205208
</div>
206209
<main id="main">
207210
<div class="grid">
@@ -557,6 +560,17 @@ <h2><a href="custom-normals-shade/">custom-normals-shade</a></h2>
557560
<a class="card-link" href="custom-normals-shade/">View example <span aria-hidden="true">&rarr;</span></a>
558561
</div>
559562
</article>
563+
<article class="card" data-tags="world sky render">
564+
<a class="card-media" href="sky-texture-sun-elevation/" aria-label="sky-texture-sun-elevation example detail page">
565+
<img src="assets/sky-texture-sun-elevation-hero.webp" alt="sky-texture-sun-elevation — World ShaderNodeTexSky driving Background Color — the sky contract across 4.5 LTS and 5.1." loading="lazy" decoding="async" />
566+
</a>
567+
<div class="card-body">
568+
<h2><a href="sky-texture-sun-elevation/">sky-texture-sun-elevation</a></h2>
569+
<p class="teaches">World ShaderNodeTexSky driving Background Color — the sky contract across 4.5 LTS and 5.1. sky_type is NISHITA on 4.5 and MULTIPLE_SCATTERING on 5.1 (NISHITA gone); dust_density exists only on 4.5 (aerosol_density on 5.1). Two tiny Cycles OPEN_EXR zenith probes prove sun_elevation 8 deg to 55 deg brightens zenith (rise 2.25x on 5.1.2, 1.50x on 4.5.11, gate &gt;= 1.25).</p>
570+
<p class="witnesses"><span class="tag">witnesses</span> AI code still assigns sky_type=&#x27;NISHITA&#x27; and dust_density on 5.1 — both are wrong (NISHITA removed; dust_density is AttributeError; use MULTIPLE_SCATTERING + aerosol_density). A near-black Background Strength alone is not a sky: Sky must link into Background Color. Elevation that does not brighten zenith fails the rise gate.</p>
571+
<a class="card-link" href="sky-texture-sun-elevation/">View example <span aria-hidden="true">&rarr;</span></a>
572+
</div>
573+
</article>
560574
</div>
561575
</main>
562576
<footer>

0 commit comments

Comments
 (0)