mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-28 01:11:23 +01:00
* 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
77 lines
2.7 KiB
Plaintext
77 lines
2.7 KiB
Plaintext
# Rule: what a node of the compiled format keeps of a value v, by its format (flags bits 4-5).
|
|
# 8 bits (0x09): fine = round(v 65535) >> 4 (16 bits to the nearest, cut to 12), out = (255 fine + 2047) >> 12 (a tie goes
|
|
# down: 0.5 gives 127). v is limited to 0..1 first.
|
|
# 16 bits (0x19): fine = floor(v 2^20), out = (65535 fine + 2^19 - 1) >> 20; v limited to 0..1 first.
|
|
# Half float (0x29): v cut to half precision towards zero, not rounded; below 2^-14 in steps of 2^-24; at 65536 and above,
|
|
# and NaN or infinite, unchanged. Negative values cut the same way towards zero (assumed, not measured).
|
|
# Source: measurement "Node formats" (8 bits), "Fx-map frames, draw order and small rules" > "Images" (8 bits),
|
|
# "One-effect projects" > "What nodes hold and how they read" (16 bits, half float).
|
|
# Tolerance: exact.
|
|
# Columns: value = v (as f32); level_8 = k of k/255; level_16 = k of k/65535; half = the half-float node's value (as f32).
|
|
value level_8 level_16 half
|
|
0 0 0 0
|
|
1 255 65535 1
|
|
0.5 127 32767 0.5
|
|
0.5019608 128 32896 0.5019531
|
|
0.0021875 0 143 0.0021858215
|
|
0.0021972656 1 144 0.0021972656
|
|
0.056862745 14 3726 0.056854248
|
|
0.060784314 16 3983 0.060760498
|
|
0.12352941 32 8095 0.12347412
|
|
0.4372549 112 28656 0.43701172
|
|
0.5 127 32767 0.5
|
|
0.25 64 16384 0.25
|
|
0.75 191 49151 0.75
|
|
0.1 25 6553 0.099975586
|
|
0.2 51 13107 0.19995117
|
|
0.3 76 19660 0.2998047
|
|
0.7 178 45874 0.69970703
|
|
0.9 229 58981 0.89990234
|
|
0.999 255 65469 0.99853516
|
|
0.001 0 65 0.0009994507
|
|
0.000015259022 0 1 0.000015258789
|
|
0.000022888533 0 1 0.000022888184
|
|
0.000007629511 0 0 0.0000076293945
|
|
0.000021934844 0 1 0.00002193451
|
|
0.000006675822 0 0 0.00000667572
|
|
0.000030518044 0 2 0.000030517578
|
|
0.000038147555 0 2 0.000038146973
|
|
0.000022888533 0 1 0.000022888184
|
|
0.000037193866 0 2 0.0000371933
|
|
0.000021934844 0 1 0.00002193451
|
|
0.0015259022 0 100 0.0015258789
|
|
0.0015335317 0 100 0.0015335083
|
|
0.0015182727 0 99 0.0015182495
|
|
0.001532578 0 100 0.0015325546
|
|
0.001517319 0 99 0.0015172958
|
|
0.015259022 4 1000 0.015258789
|
|
0.015266651 4 1000 0.015266418
|
|
0.0152513925 4 999 0.01525116
|
|
0.015265698 4 1000 0.015258789
|
|
0.015250439 4 999 0.01524353
|
|
0.49999237 127 32767 0.49975586
|
|
0.5 127 32767 0.5
|
|
0.49998474 127 32767 0.49975586
|
|
0.49999905 127 32767 0.49975586
|
|
0.4999838 127 32766 0.49975586
|
|
0.5000076 127 32768 0.5
|
|
0.50001526 127 32768 0.5
|
|
0.5 127 32767 0.5
|
|
0.5000143 127 32768 0.5
|
|
0.49999905 127 32767 0.49975586
|
|
0.99998474 255 65534 0.9995117
|
|
0.9999924 255 65535 0.9995117
|
|
0.9999771 255 65534 0.9995117
|
|
0.9999914 255 65534 0.9995117
|
|
0.99997616 255 65533 0.9995117
|
|
-0.25 0 0 -0.25
|
|
-0.000001 0 0 -0.0000009536743
|
|
1.5 255 65535 1.5
|
|
2 255 65535 2
|
|
0.125 32 8192 0.125
|
|
0.3333333 85 21845 0.33325195
|
|
0.6666667 170 43690 0.6665039
|
|
0.000061035156 0 4 0.000061035156
|
|
0.00003 0 2 0.000029981136
|
|
0.0000001 0 0 0.000000059604645
|