Commit eb03556
committed
feat: add vertex-color-ao example (baked occlusion in a colour attribute)
Most bakes can only be regression-tested against a previous run. This one
cannot drift silently, because the hemisphere visibility integral has closed
forms: an unoccluded surface integrates to exactly 1, and a point a distance d
from an infinitely wide wall of height H integrates to 1 - 0.5(1 - 1/sqrt(1+k^2))
with k = H/d. The check holds a deterministic cosine-weighted integrator to
that formula across two decades of k, then runs the same integrator over the
asset that ships, so what is in the attribute is the thing that was measured.
The storage half is the trap worth shipping. BYTE_COLOR is not linear 8-bit,
it is sRGB-encoded 8-bit: a linear 0.735 reads back 0.7379107. The check
reproduces the readback with an independent encode/quantise/decode model
rather than asserting a captured constant, so an exporter handing raw bytes to
an engine expecting linear occlusion is caught by construction.
Two authoring hazards are recorded with the geometry that provoked them:
bmesh.ops.bevel offsets along cached face normals and flips outward once a
transform leaves them more than 90 degrees stale, and point-domain AO needs
subdivision or the crevice gradient never reaches the attribute at all.
The depsgraph check originally compared zip(src.data, eva.data), which stops
at the shorter sequence; a Subdivision modifier resampling the attribute
reported a clean 0.0 deviation and the falsification probe exited 0. The
length guard exists because the probe failed to fail.
Signed-off-by: fOuttaMyPaint <tmhospitalitystrategies@gmail.com>
Signed-off-by: fOuttaMyPaint <TMhospitalitystrategies@gmail.com>1 parent 4bfe83b commit eb03556
13 files changed
Lines changed: 2401 additions & 3 deletions
File tree
- .cursor-plugin
- .github/workflows
- docs/gallery
- asset-sheets
- assets
- contact-sheets
- vertex-color-ao
- examples
- vertex-color-ao
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
843 | 843 | | |
844 | 844 | | |
845 | 845 | | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
846 | 867 | | |
847 | 868 | | |
848 | 869 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
Loading
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| |||
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
798 | 809 | | |
799 | 810 | | |
800 | 811 | | |
| |||
0 commit comments