Files
craft-libs/crates/material-graph/tests/rules/pattern_shape.tsv
T
Valentin Klein c3155aad96 Share the material graph runtime and WGSL pixel compiler (#3109)
* Extract the material graph runtime from TextureCraft

Preserve its evaluator, compiler, existing verification, and format reference from TextureCraft #777 at 22a37c29.

Original TextureCraft importer author: xilefenko (TextureCraft #521).

* Adapt graph helpers to the shared workspace lints

Preserve node evaluation and version tracking while splitting long dispatch branches. Update the EXR doctest and rule table references for the shared crate.

* Read the format reference with LF endings in its test

* Test that the format reference example reads the same with CRLF line endings

* Make the kind versions follow module attributes, arm order, raw strings, includes and the epoch

* Fix graph cache keys, publish, import and subgraph extraction; harden the graph tests

* Keep the cubic sampler from panicking on NaN texels; say what RGBE drops; check NaN halves by their bits

* Lower vector inputs of f_to_bool and f_vec to valid WGSL; tighten the FX-map error and pattern coverage tests; document clamping and the splatter data cutoff

* Say which composite glyph placements the font reader lacks; fail the y-up text test on a blank render

* Leave publish as it was; unit-test the WGSL vector lowering; document EPOCH and keep_outputs results

* Satisfy clippy in the version scanner and the WGSL lowering; compare cache hits by relation
2026-11-23 08:55:49 -05:00

3.1 KiB

1# Rule: the built-in fx-map patterns, at local coordinates x, y in (-1, 1] of the pattern's box, r = sqrt(x^2 + y^2),
2# variation v limited to 0..1 (waves: not limited). S(t) = 3t^2 - 2t^3 on t limited to 0..1, F(t, s) = 1 - S(t/s) (0 for s <= 0).
3# 0 square 1; 1 disc (r <= 1); 2 1 - r^2; 3 (1 - r^2)^4; 4 gaussian exp(-11.1 r^2) - exp(-11.1) inside the disc; 5 (1 - r)^4;
4# 6 1 - max(|x|, |y|); 7 brick S((1 - |x|)/v) S((1 - |y|)/v), 1 at v = 0; 8 (x + 1)/2 (1 - v); 9 (1 - r^2) cos^2((1.5 + 6v) pi x);
5# 10 (1 - r^2)^4 F(x, 1 - v) for x > 0; 11 (1 - r^2)^4 (1 - |x|)^2; 12 6.75 r^2 (1 - r^2)^2 F(x + 1, 2(1 - v));
6# 13 1 - 20 d^2, d^2 = max(|x| - 0.7698 v, 0)^2 + y^2; 14 1 - r; 15 min(1, (x + 1)/2 + v); 16 min(1, sqrt(1 - r^2) + v) inside
7# the disc. Negative results are 0. Outside the box (x or y <= -1 or > 1) nothing is drawn.
8# Tolerance: 1e-6 absolute.
9# Columns: pattern = its number; x, y; variation = v; value = the pattern's value, or none outside its box.
10patternxyvariationvalue
1100001
1200.5001
1300.30.40.51
140-0.70.211
1500.9-0.90.251
160110.51
170-100none
1810001
1910.5001
2010.30.40.51
211-0.70.211
2210.9-0.90.250
231110.50
241-100none
2520001
2620.5000.75
2720.30.40.50.75
282-0.70.210.47000003
2920.9-0.90.250
302110.50
312-100none
3230001
3330.5000.31640625
3430.30.40.50.31640625
353-0.70.210.04879682
3630.9-0.90.250
373110.50
383-100none
3940000.99998486
4040.5000.06233436
4140.30.40.50.06233436
424-0.70.210.0027713014
4340.9-0.90.250
444110.50
454-100none
4650001
4750.5000.0625
4850.30.40.50.0625
495-0.70.210.005472751
5050.9-0.90.250
515110.50
525-100none
5360001
5460.5000.5
5560.30.40.50.6
566-0.70.210.3
5760.9-0.90.250.100000024
586110.50
596-100none
6070001
6170.5001
6270.30.40.51
637-0.70.210.19353603
6470.9-0.90.250.12390408
657110.50
667-100none
6780000.5
6880.5000.75
6980.30.40.50.325
708-0.70.210
7180.9-0.90.250.7125
728110.50.5
738-100none
7490001
7590.5000.37499997
7690.30.40.50.15458034
779-0.70.210.23500043
7890.9-0.90.250
799110.50
809-100none
81100001
82100.5000.15820313
83100.30.40.50.111375
8410-0.70.210.04879682
85100.9-0.90.250
8610110.50
8710-100none
88110001
89110.5000.07910156
90110.30.40.50.15503906
9111-0.70.210.004391714
92110.9-0.90.250
9311110.50
9411-100none
95120000
96120.5000.14831543
97120.30.40.50
9812-0.70.210
99120.9-0.90.250
10012110.50
10112-100none
102130001
103130.5000
104130.30.40.50
10513-0.70.210.19999987
106130.9-0.90.250
10713110.50
10813-100none
109140001
110140.5000.5
111140.30.40.50.5
11214-0.70.210.27198905
113140.9-0.90.250
11414110.50
11514-100none
116150000.5
117150.5000.75
118150.30.40.51
11915-0.70.211
120150.9-0.90.251
12115110.51
12215-100none
123160001
124160.5000.8660254
125160.30.40.51
12616-0.70.211
127160.9-0.90.250
12816110.50
12916-100none