onejs-sl 0.1.10 → 0.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.11
4
+
5
+ The value noise hash no longer rounds differently from one GPU to the next. Seeded value noise looks different, with the same character; program hashes do not change.
6
+
7
+ - `fbm` with 2 or more octaves now looks different
8
+ - Default `fx.noise` fields now look different, since they are seeded
9
+ - `noise`, one octave of `fbm`, simplex, turbulence and ridged are unchanged
10
+ - A helper library change that keeps the IR's shape does not bump `SL_IR_VERSION`
11
+
3
12
  ## 0.1.10
4
13
 
5
14
  Attributes on uniforms, for a host's controls (`Specs/SL_NEXT.md` 1). A program that has none compiles to exactly what it did, and one that has them hashes as it would without.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "generatedBy": "onejs-sl goldens/run.mjs",
3
- "package": "0.1.10",
3
+ "package": "0.1.11",
4
4
  "ir": 2,
5
5
  "target": "rgba8unorm-srgb: straight alpha, 8 bit, sRGB encoded, the stored bytes of a Linear OneJS game's element",
6
6
  "size": [
@@ -24,8 +24,8 @@
24
24
  "hash": "8e7e61f6",
25
25
  "source": "// A branch, a colour literal and a function that returns a vector.\nuniform float4 tint = #ff8040;\n\nfloat2 swirl(float2 p, float a) {\n float c = cos(a);\n float s = sin(a);\n return float2(p.x * c - p.y * s, p.x * s + p.y * c);\n}\n\nfloat4 main() {\n float2 q = swirl(uv - 0.5, time * 0.3);\n float v = 0.25;\n if (q.x > 0.1) { v = 0.75; } else { v = fbm(q * 3, 4); }\n return float4(tint.rgb * v, 1);\n}\n",
26
26
  "samples": {
27
- "0": [192,95,46,255,199,98,48,255,196,97,47,255,198,98,47,255,193,95,46,255,187,92,44,255,180,89,42,255,187,92,44,255,179,88,42,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,188,93,44,255,195,97,46,255,199,98,48,255,205,102,49,255,203,101,49,255,202,100,49,255,196,97,47,255,200,99,48,255,189,93,45,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,188,93,44,255,202,100,48,255,217,108,53,255,209,104,50,255,206,102,49,255,198,98,47,255,191,94,45,255,198,98,47,255,185,91,43,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,195,97,46,255,205,102,49,255,216,107,52,255,206,102,50,255,204,101,49,255,197,98,47,255,194,96,46,255,190,94,45,255,187,92,44,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,206,102,49,255,207,103,50,255,212,106,51,255,210,105,51,255,198,98,47,255,186,92,44,255,174,85,40,255,161,78,37,255,156,76,35,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,215,107,52,255,217,108,53,255,224,112,55,255,214,107,52,255,202,100,48,255,180,89,42,255,153,74,34,255,131,62,28,255,125,59,26,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,221,110,54,255,228,114,56,255,237,119,59,255,214,107,52,255,189,94,45,255,171,84,40,255,147,71,33,255,140,68,31,255,138,66,30,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,218,108,53,255,233,117,58,255,240,120,59,255,230,115,57,255,199,99,48,255,175,86,41,255,158,77,36,255,153,74,34,255,161,78,37,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,220,110,54,255,230,115,57,255,237,119,59,255,227,113,56,255,203,101,49,255,181,89,42,255,164,80,37,255,153,74,34,255,160,78,36,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,210,104,51,255,208,103,50,255,210,104,51,255,209,104,50,255,210,105,51,255,197,98,47,255,168,82,38,255,132,63,28,255,153,74,34,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,194,96,46,255,188,93,44,255,181,89,42,255,182,89,43,255,196,97,47,255,200,99,48,255,179,88,42,255,151,73,34,255,151,73,34,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,180,89,42,255,175,86,41,255,167,82,38,255,176,87,41,255,183,90,43,255,188,93,44,255,184,91,43,255,187,92,44,255,189,93,45,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,175,86,41,255,169,83,39,255,167,82,38,255,165,80,38,255,157,77,36,255,165,81,38,255,192,95,46,255,209,104,50,255,214,107,52,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,172,85,40,255,165,80,38,255,156,76,35,255,152,74,34,255,156,76,35,255,166,81,38,255,188,93,44,255,215,107,52,255,221,110,54,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,162,79,37,255,172,84,40,255,178,88,42,255,167,82,38,255,181,89,42,255,185,91,43,255,193,95,46,255,214,107,52,255,206,103,50,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,176,87,41,255,189,94,45,255,191,94,45,255,187,92,44,255,186,92,44,255,198,98,47,255,190,94,45,255,181,89,43,255,177,87,41,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255],
28
- "1.25": [214,106,52,255,197,98,47,255,190,94,45,255,196,97,47,255,209,104,50,255,206,102,49,255,205,102,49,255,200,99,48,255,192,95,46,255,180,88,42,255,180,89,42,255,175,86,41,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,218,109,53,255,208,104,50,255,203,100,49,255,205,102,49,255,214,107,52,255,211,105,51,255,205,102,49,255,201,100,48,255,197,98,47,255,193,96,46,255,197,98,47,255,175,86,41,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,220,110,54,255,212,105,51,255,208,103,50,255,210,105,51,255,216,107,52,255,206,102,50,255,203,101,49,255,198,98,47,255,191,94,45,255,198,98,47,255,197,97,47,255,168,82,39,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,219,109,53,255,221,110,54,255,217,108,53,255,222,111,54,255,219,109,53,255,202,100,48,255,195,97,46,255,191,94,45,255,193,96,46,255,192,95,46,255,183,90,43,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,215,107,52,255,221,110,54,255,229,114,56,255,235,118,58,255,214,106,52,255,202,100,48,255,184,91,43,255,167,82,38,255,163,80,37,255,171,84,40,255,176,87,41,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,213,106,51,255,231,116,57,255,238,119,59,255,239,120,59,255,210,104,51,255,185,91,43,255,170,83,39,255,143,69,31,255,130,62,28,255,129,62,27,255,147,71,33,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,212,106,51,255,218,109,53,255,236,118,58,255,231,115,57,255,211,105,51,255,184,91,43,255,161,78,37,255,144,70,32,255,135,65,29,255,125,60,26,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,199,99,48,255,204,101,49,255,210,104,51,255,215,107,52,255,203,101,49,255,179,88,42,255,158,77,36,255,158,77,36,255,156,76,35,255,146,71,32,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,178,87,41,255,177,87,41,255,183,90,43,255,199,99,48,255,207,103,50,255,186,92,44,255,153,74,34,255,150,73,34,255,163,80,37,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,171,84,40,255,166,81,38,255,173,85,40,255,190,94,45,255,200,99,48,255,185,91,44,255,156,76,35,255,130,62,28,255,173,85,40,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,157,77,36,255,163,80,37,255,172,84,40,255,171,84,40,255,186,92,44,255,181,89,42,255,162,79,37,255,150,73,33,255,172,84,40,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,165,81,38,255,153,74,34,255,150,73,34,255,157,77,36,255,178,88,42,255,193,96,46,255,192,95,46,255,188,93,45,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,181,89,43,255,167,82,38,255,174,86,41,255,170,83,39,255,186,92,44,255,212,105,51,255,217,108,53,255,206,102,50,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,193,95,46,255,184,91,43,255,191,94,45,255,188,93,44,255,199,99,48,255,215,107,52,255,219,109,53,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,190,94,45,255,191,94,45,255,198,98,47,255,191,94,45,255,189,93,45,255,203,101,49,255,200,99,48,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,190,94,45,255,197,98,47,255,190,94,45,255,170,83,39,255,166,81,38,255,169,83,39,255,190,94,45,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255]
27
+ "0": [204,101,49,255,189,93,45,255,179,88,42,255,181,89,42,255,175,86,41,255,166,81,38,255,150,73,34,255,155,75,35,255,149,72,33,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,189,93,45,255,183,90,43,255,178,87,41,255,184,91,43,255,188,93,44,255,184,91,43,255,170,84,39,255,161,79,37,255,154,75,34,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,180,89,42,255,163,80,37,255,160,78,36,255,185,91,44,255,208,104,50,255,206,102,49,255,177,87,41,255,162,79,37,255,150,72,33,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,177,87,41,255,176,87,41,255,189,93,45,255,192,95,45,255,205,102,49,255,203,101,49,255,184,91,43,255,164,80,38,255,164,80,37,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,193,96,46,255,197,98,47,255,206,102,50,255,206,102,50,255,196,97,47,255,183,90,43,255,168,82,39,255,151,73,34,255,153,74,34,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,212,106,51,255,219,109,53,255,220,110,54,255,211,105,51,255,197,97,47,255,173,85,40,255,147,71,33,255,124,59,26,255,132,63,28,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,222,111,54,255,231,115,57,255,222,111,54,255,212,106,51,255,190,94,45,255,170,83,39,255,147,71,33,255,141,68,31,255,138,67,30,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,211,105,51,255,225,113,55,255,239,120,59,255,219,109,53,255,190,94,45,255,174,85,40,255,158,77,36,255,154,75,34,255,161,78,37,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,216,108,52,255,226,113,55,255,239,120,59,255,220,110,54,255,197,98,47,255,180,89,42,255,164,80,37,255,153,74,34,255,154,75,34,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,210,105,51,255,212,105,51,255,211,105,51,255,210,104,51,255,210,104,51,255,196,97,47,255,167,82,38,255,132,63,28,255,141,68,31,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,192,95,46,255,189,93,45,255,180,88,42,255,180,88,42,255,192,95,46,255,196,97,47,255,176,87,41,255,148,72,33,255,147,71,33,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,181,89,42,255,169,83,39,255,161,79,37,255,168,82,39,255,181,89,42,255,193,96,46,255,188,93,44,255,167,82,38,255,174,86,41,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,181,89,43,255,175,86,41,255,172,84,40,255,168,82,39,255,160,78,36,255,167,82,38,255,188,93,44,255,177,87,41,255,185,91,43,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,183,90,43,255,182,89,43,255,169,83,39,255,166,81,38,255,158,77,36,255,154,75,35,255,175,86,41,255,184,91,43,255,188,93,44,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,164,80,37,255,165,81,38,255,172,85,40,255,158,77,36,255,168,82,38,255,169,83,39,255,173,85,40,255,185,91,43,255,186,92,44,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,173,85,40,255,176,87,41,255,179,88,42,255,186,92,44,255,176,86,41,255,176,86,41,255,174,85,40,255,179,88,42,255,179,88,42,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255],
28
+ "1.25": [214,107,52,255,192,95,46,255,186,92,44,255,168,82,38,255,161,79,37,255,172,84,40,255,189,93,45,255,176,87,41,255,167,81,38,255,147,71,33,255,150,73,34,255,149,72,33,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,213,106,51,255,192,95,46,255,183,90,43,255,176,87,41,255,174,86,41,255,182,90,43,255,203,101,49,255,203,101,49,255,181,89,43,255,157,76,35,255,162,79,37,255,149,72,33,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,213,106,52,255,204,101,49,255,205,102,49,255,202,100,48,255,205,102,49,255,198,98,47,255,206,102,50,255,205,102,49,255,177,87,41,255,162,79,37,255,161,78,37,255,148,72,33,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,216,108,53,255,220,109,54,255,220,110,54,255,220,110,54,255,217,108,53,255,199,98,48,255,196,97,47,255,191,94,45,255,178,87,41,255,159,77,36,255,154,75,35,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,213,106,52,255,220,110,54,255,229,115,56,255,220,110,54,255,211,105,51,255,198,98,47,255,176,86,41,255,161,79,37,255,154,75,35,255,156,76,35,255,166,81,38,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,210,104,51,255,219,109,53,255,235,117,58,255,233,117,57,255,208,103,50,255,184,91,43,255,167,82,38,255,139,67,30,255,123,59,25,255,136,65,29,255,160,78,36,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,213,106,52,255,221,110,54,255,237,119,59,255,223,111,55,255,196,97,47,255,183,90,43,255,160,78,37,255,145,70,32,255,135,65,29,255,132,63,28,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,200,99,48,255,206,102,50,255,211,105,51,255,216,107,52,255,200,99,48,255,178,88,42,255,158,77,36,255,158,77,36,255,156,76,35,255,146,70,32,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,175,86,41,255,176,87,41,255,182,90,43,255,198,98,47,255,205,102,49,255,185,91,43,255,153,74,34,255,150,73,34,255,160,78,36,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,168,82,38,255,160,78,36,255,166,81,38,255,187,92,44,255,196,97,47,255,183,90,43,255,155,75,35,255,128,61,27,255,147,71,32,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,174,85,40,255,171,84,39,255,170,83,39,255,176,86,41,255,192,95,46,255,183,90,43,255,157,76,35,255,146,71,32,255,162,79,37,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,169,83,39,255,165,81,38,255,163,80,37,255,149,72,33,255,180,88,42,255,181,89,43,255,160,78,37,255,183,90,43,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,172,84,40,255,156,76,35,255,165,81,38,255,158,77,36,255,175,86,41,255,183,90,43,255,184,91,43,255,195,96,46,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,187,92,44,255,184,91,43,255,171,84,40,255,170,83,39,255,175,86,41,255,181,89,43,255,188,93,44,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,193,96,46,255,187,93,44,255,175,86,41,255,173,85,40,255,177,87,41,255,184,91,43,255,194,96,46,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,191,94,45,255,185,91,43,255,175,86,41,255,168,82,39,255,168,82,39,255,176,86,41,255,191,94,45,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255,225,112,55,255]
29
29
  }
30
30
  },
31
31
  "cov-arith.sl": {
@@ -64,8 +64,8 @@
64
64
  "hash": "4c59d609",
65
65
  "source": "// Every noise: value, simplex, fbm, turbulence, ridged, voronoi.\nfloat4 main() {\n float2 p = uv * 5.0 + time * 0.1;\n float a = noise(p) * 0.5 + simplex(p * 1.3) * 0.5;\n float b = fbm(p, 3) * 0.5 + turbulence(p * 0.7, 2) * 0.5;\n float c = ridged(p * 0.6, 4) * 0.6 + voronoi(p * 1.5) * 0.4;\n return float4(a, b, c, 1);\n}\n",
66
66
  "samples": {
67
- "0": [174,149,126,255,210,178,205,255,158,184,175,255,225,193,173,255,147,162,159,255,135,170,158,255,173,162,188,255,178,159,183,255,141,175,181,255,132,185,161,255,199,181,94,255,212,195,150,255,240,203,200,255,231,201,184,255,226,197,172,255,217,211,188,255,161,154,160,255,178,178,187,255,192,158,236,255,180,189,203,255,211,180,201,255,195,196,171,255,186,187,164,255,146,145,176,255,210,164,158,255,191,162,155,255,207,150,174,255,174,166,183,255,202,176,201,255,231,192,212,255,178,206,157,255,220,206,189,255,195,178,156,255,215,160,197,255,195,200,201,255,195,205,130,255,179,191,119,255,189,159,164,255,196,168,118,255,156,157,150,255,162,182,122,255,165,196,113,255,179,184,162,255,212,172,179,255,221,187,173,255,214,184,160,255,180,189,170,255,178,190,189,255,190,202,165,255,219,183,163,255,209,146,181,255,206,163,158,255,156,156,180,255,182,185,189,255,190,170,155,255,188,195,192,255,196,192,169,255,166,198,165,255,180,196,176,255,200,150,185,255,145,185,174,255,178,166,188,255,188,185,181,255,187,146,174,255,168,179,208,255,164,148,179,255,141,183,174,255,213,205,201,255,143,173,157,255,213,210,149,255,162,188,141,255,224,218,192,255,216,208,215,255,208,184,182,255,203,174,192,255,190,178,148,255,182,166,148,255,218,161,208,255,223,180,192,255,204,182,174,255,186,158,222,255,177,180,180,255,139,156,177,255,173,145,131,255,181,187,163,255,223,170,151,255,186,178,167,255,216,196,192,255,181,169,178,255,204,189,137,255,222,168,165,255,203,168,188,255,183,144,196,255,195,182,184,255,193,201,156,255,186,202,161,255,165,130,179,255,188,190,157,255,180,153,196,255,142,124,152,255,180,195,152,255,211,201,199,255,190,174,197,255,201,159,91,255,174,164,185,255,179,186,165,255,210,197,165,255,196,171,121,255,199,177,155,255,167,189,165,255,179,184,180,255,165,196,141,255,122,146,130,255,165,163,152,255,134,153,170,255,131,192,164,255,142,156,198,255,166,160,175,255,215,193,181,255,201,169,148,255,213,205,164,255,195,208,143,255,218,176,135,255,181,194,139,255,160,155,180,255,200,200,216,255,204,174,210,255,182,160,208,255,144,179,130,255,187,162,193,255,176,168,113,255,174,162,175,255,163,181,168,255,181,169,136,255,118,179,183,255,206,174,171,255,172,202,186,255,159,191,193,255,173,188,176,255,193,173,187,255,169,144,174,255,178,143,176,255,121,164,160,255,160,164,198,255,135,183,182,255,94,108,190,255,90,157,135,255,117,167,164,255,175,189,161,255,174,156,160,255,127,136,205,255,179,154,155,255,195,171,161,255,203,165,135,255,153,160,146,255,154,178,175,255,179,143,189,255,192,140,125,255,153,149,166,255,167,179,147,255,181,160,177,255,153,144,176,255,175,181,181,255,138,180,186,255,150,149,168,255,117,122,182,255,148,158,178,255,182,182,129,255,213,201,176,255,207,212,179,255,213,174,162,255,193,195,154,255,123,131,222,255,175,156,213,255,154,169,160,255,105,139,87,255,186,165,153,255,122,144,177,255,143,151,221,255,92,143,173,255,192,150,151,255,192,173,184,255,193,159,169,255,165,149,189,255,216,187,189,255,204,198,172,255,182,176,157,255,197,145,177,255,160,161,179,255,184,185,163,255,180,149,169,255,154,133,153,255,200,176,157,255,120,158,167,255,104,154,182,255,137,188,194,255,189,184,149,255,164,183,161,255,152,145,212,255,215,208,187,255,188,225,135,255,218,201,155,255,178,176,122,255,162,167,162,255,137,138,168,255,145,171,130,255,112,180,165,255,167,159,187,255,175,146,184,255,168,178,150,255,179,143,107,255,177,180,185,255,173,179,132,255,185,157,149,255,202,183,174,255,223,203,184,255,220,204,115,255,244,178,153,255,200,166,198,255,187,180,187,255,179,179,193,255,149,129,175,255,110,186,166,255,170,165,196,255,124,162,161,255,178,136,212,255,187,139,177,255,129,154,194,255,149,196,163,255,193,198,101,255,170,183,165,255,219,213,188,255,218,198,160,255,198,211,174,255,215,198,206,255,167,147,176,255,158,180,184,255,194,192,166,255,140,156,163,255,175,138,126,255,163,173,150,255,172,150,210,255,189,175,194,255,164,153,194,255,162,151,198,255,208,194,202,255,181,183,178,255,184,188,195,255,197,196,178,255,194,189,164,255,199,183,140,255,173,143,171,255,182,178,186,255,199,185,207,255,185,129,162,255,171,139,142,255],
68
- "1.25": [178,180,193,255,193,178,191,255,196,197,130,255,195,190,168,255,124,192,148,255,162,181,139,255,188,186,164,255,193,159,176,255,124,176,195,255,143,165,171,255,207,156,139,255,236,207,173,255,244,209,197,255,215,191,154,255,246,183,151,255,195,185,108,255,176,147,165,255,183,176,217,255,185,175,209,255,201,169,206,255,187,176,213,255,173,171,191,255,137,152,165,255,167,131,172,255,190,192,136,255,180,181,157,255,212,159,145,255,196,162,194,255,229,185,224,255,215,209,169,255,205,216,180,255,214,216,185,255,183,151,148,255,221,186,196,255,164,213,190,255,189,200,160,255,188,190,177,255,200,188,150,255,191,180,156,255,182,143,206,255,180,174,143,255,177,190,143,255,213,177,157,255,189,202,178,255,217,169,193,255,215,215,191,255,183,188,184,255,209,196,154,255,186,202,176,255,230,182,188,255,201,167,159,255,211,164,122,255,139,133,185,255,209,154,145,255,155,151,123,255,159,199,201,255,171,198,156,255,159,211,136,255,182,159,179,255,188,197,187,255,183,162,143,255,179,178,164,255,164,171,202,255,175,189,168,255,187,181,203,255,168,175,171,255,185,181,160,255,191,186,198,255,159,193,163,255,187,198,174,255,208,154,172,255,216,211,207,255,218,176,207,255,179,172,199,255,220,182,138,255,194,162,151,255,176,161,189,255,217,165,201,255,220,159,154,255,175,184,189,255,178,168,216,255,146,159,187,255,159,163,171,255,181,160,164,255,200,167,169,255,205,202,170,255,194,169,161,255,215,205,198,255,202,145,209,255,217,161,184,255,179,179,203,255,176,191,187,255,176,167,193,255,214,177,193,255,220,195,140,255,200,197,183,255,194,176,182,255,158,191,176,255,190,124,178,255,122,173,142,255,220,209,144,255,192,194,192,255,199,172,189,255,185,181,114,255,181,175,182,255,203,205,131,255,218,180,154,255,228,160,155,255,189,184,165,255,178,168,175,255,139,194,179,255,163,184,120,255,148,170,147,255,184,159,155,255,102,180,164,255,130,171,179,255,186,178,172,255,197,169,201,255,223,191,177,255,183,182,158,255,194,206,179,255,201,172,106,255,207,178,169,255,157,176,140,255,180,195,140,255,204,185,178,255,208,154,200,255,162,176,194,255,137,161,152,255,171,154,180,255,182,175,149,255,164,163,162,255,142,137,156,255,168,154,168,255,179,183,178,255,212,171,184,255,206,204,195,255,164,193,147,255,204,198,154,255,174,191,195,255,148,154,210,255,177,174,164,255,161,154,179,255,135,120,190,255,148,169,187,255,145,136,185,255,105,156,149,255,159,176,172,255,179,169,170,255,150,158,117,255,134,166,192,255,185,153,179,255,166,191,170,255,176,151,161,255,132,135,168,255,189,163,204,255,177,134,153,255,186,157,146,255,125,155,144,255,180,177,166,255,172,159,175,255,121,170,148,255,109,179,174,255,169,171,188,255,129,182,188,255,169,136,184,255,154,124,143,255,202,190,152,255,222,204,128,255,200,183,146,255,206,206,130,255,158,182,191,255,178,108,202,255,174,168,188,255,122,142,127,255,126,174,129,255,186,162,184,255,130,159,192,255,166,152,193,255,134,136,159,255,171,135,164,255,171,168,195,255,137,174,146,255,188,181,189,255,232,196,188,255,179,204,165,255,201,168,179,255,184,135,202,255,138,167,201,255,184,159,192,255,149,164,162,255,175,119,151,255,171,139,166,255,123,134,176,255,120,161,194,255,128,188,160,255,192,182,161,255,184,160,180,255,185,167,214,255,192,197,170,255,208,209,170,255,199,191,123,255,165,173,137,255,166,145,179,255,149,182,142,255,181,167,154,255,126,171,168,255,179,164,173,255,154,164,197,255,142,154,133,255,168,154,179,255,177,187,154,255,205,185,110,255,164,136,153,255,203,184,209,255,222,220,114,255,219,219,151,255,220,188,176,255,185,177,204,255,201,176,199,255,139,131,173,255,134,179,153,255,120,175,175,255,188,158,216,255,139,151,179,255,195,184,165,255,174,127,184,255,128,182,205,255,142,187,155,255,167,191,126,255,207,220,177,255,230,209,132,255,213,199,105,255,226,215,185,255,198,182,194,255,134,179,167,255,178,175,170,255,148,153,167,255,150,144,166,255,134,116,152,255,122,154,158,255,179,120,222,255,194,157,188,255,136,169,202,255,198,192,167,255,213,191,167,255,171,182,172,255,213,183,165,255,188,185,169,255,182,179,180,255,223,182,175,255,154,166,183,255,200,185,170,255,186,173,166,255,185,117,154,255,149,153,136,255]
67
+ "0": [174,158,126,255,210,189,205,255,158,187,175,255,225,193,173,255,147,149,159,255,135,169,158,255,173,156,188,255,178,161,183,255,141,180,181,255,132,192,161,255,199,176,94,255,212,191,150,255,240,219,200,255,231,197,184,255,226,193,172,255,217,203,188,255,161,175,160,255,178,177,187,255,192,159,236,255,180,184,203,255,211,168,201,255,195,193,171,255,186,189,164,255,146,163,176,255,210,170,158,255,191,156,155,255,207,158,174,255,174,174,183,255,202,184,201,255,231,196,212,255,178,204,157,255,220,205,189,255,195,183,156,255,215,155,197,255,195,202,201,255,195,214,130,255,179,191,119,255,189,167,164,255,196,174,118,255,156,166,150,255,162,180,122,255,165,183,113,255,179,183,162,255,212,178,179,255,221,200,173,255,214,186,160,255,180,193,170,255,178,191,189,255,190,209,165,255,219,173,163,255,209,158,181,255,206,181,158,255,156,173,180,255,182,189,189,255,190,180,155,255,188,197,192,255,196,193,169,255,166,184,165,255,180,194,176,255,200,152,185,255,145,199,174,255,178,175,188,255,188,187,181,255,187,158,174,255,168,189,208,255,164,168,179,255,141,189,174,255,213,205,201,255,143,180,157,255,213,210,149,255,162,171,141,255,224,204,192,255,216,199,215,255,208,184,182,255,203,195,192,255,190,192,148,255,182,144,148,255,218,160,208,255,223,180,192,255,204,191,174,255,186,161,222,255,177,182,180,255,139,154,177,255,173,141,131,255,181,176,163,255,223,153,151,255,186,170,167,255,216,191,192,255,181,175,178,255,204,197,137,255,222,186,165,255,203,177,188,255,183,143,196,255,195,175,184,255,193,188,156,255,186,202,161,255,165,125,179,255,188,180,157,255,180,151,196,255,142,126,152,255,180,183,152,255,211,197,199,255,190,175,197,255,201,166,91,255,174,176,185,255,179,192,165,255,210,210,165,255,196,178,121,255,199,183,155,255,167,177,165,255,179,166,180,255,165,198,141,255,122,125,130,255,165,145,152,255,134,131,170,255,131,185,164,255,142,157,198,255,166,160,175,255,215,202,181,255,201,172,148,255,213,204,164,255,195,199,143,255,218,180,135,255,181,202,139,255,160,157,180,255,200,187,216,255,204,157,210,255,182,163,208,255,144,164,130,255,187,153,193,255,176,161,113,255,174,165,175,255,163,190,168,255,181,175,136,255,118,188,183,255,206,180,171,255,172,196,186,255,159,179,193,255,173,186,176,255,193,183,187,255,169,152,174,255,178,134,176,255,121,136,160,255,160,152,198,255,135,186,182,255,94,96,190,255,90,168,135,255,117,181,164,255,175,183,161,255,174,149,160,255,127,142,205,255,179,137,155,255,195,160,161,255,203,162,135,255,153,159,146,255,154,175,175,255,179,156,189,255,192,141,125,255,153,133,166,255,167,174,147,255,181,146,177,255,153,143,176,255,175,178,181,255,138,181,186,255,150,156,168,255,117,129,182,255,148,163,178,255,182,184,129,255,213,201,176,255,207,205,179,255,213,162,162,255,193,190,154,255,123,140,222,255,175,166,213,255,154,168,160,255,105,138,87,255,186,150,153,255,122,125,177,255,143,144,221,255,92,143,173,255,192,164,151,255,192,183,184,255,193,171,169,255,165,151,189,255,216,187,189,255,204,187,172,255,182,178,157,255,197,144,177,255,160,166,179,255,184,191,163,255,180,161,169,255,154,134,153,255,200,163,157,255,120,161,167,255,104,151,182,255,137,193,194,255,189,186,149,255,164,180,161,255,152,148,212,255,215,203,187,255,188,226,135,255,218,207,155,255,178,181,122,255,162,178,162,255,137,145,168,255,145,167,130,255,112,179,165,255,167,160,187,255,175,139,184,255,168,179,150,255,179,148,107,255,177,183,185,255,173,179,132,255,185,162,149,255,202,183,174,255,223,196,184,255,220,202,115,255,244,185,153,255,200,178,198,255,187,186,187,255,179,182,193,255,149,136,175,255,110,181,166,255,170,171,196,255,124,169,161,255,178,146,212,255,187,137,177,255,129,151,194,255,149,192,163,255,193,199,101,255,170,177,165,255,219,207,188,255,218,196,160,255,198,214,174,255,215,199,206,255,167,151,176,255,158,182,184,255,194,198,166,255,140,158,163,255,175,155,126,255,163,173,150,255,172,150,210,255,189,177,194,255,164,154,194,255,162,157,198,255,208,197,202,255,181,182,178,255,184,199,195,255,197,207,178,255,194,194,164,255,199,180,140,255,173,149,171,255,182,180,186,255,199,197,207,255,185,152,162,255,171,136,142,255],
68
+ "1.25": [178,187,193,255,193,186,191,255,196,197,130,255,195,189,168,255,124,186,148,255,162,166,139,255,188,170,164,255,193,146,176,255,124,172,195,255,143,164,171,255,207,147,139,255,236,212,173,255,244,223,197,255,215,189,154,255,246,175,151,255,195,168,108,255,176,160,165,255,183,182,217,255,185,168,209,255,201,168,206,255,187,163,213,255,173,173,191,255,137,160,165,255,167,152,172,255,190,194,136,255,180,181,157,255,212,163,145,255,196,168,194,255,229,196,224,255,215,206,169,255,205,210,180,255,214,215,185,255,183,154,148,255,221,184,196,255,164,211,190,255,189,203,160,255,188,183,177,255,200,189,150,255,191,190,156,255,182,148,206,255,180,165,143,255,177,186,143,255,213,183,157,255,189,213,178,255,217,179,193,255,215,214,191,255,183,187,184,255,209,191,154,255,186,200,176,255,230,177,188,255,201,190,159,255,211,177,122,255,139,146,185,255,209,172,145,255,155,173,123,255,159,204,201,255,171,194,156,255,159,198,136,255,182,153,179,255,188,204,187,255,183,182,143,255,179,181,164,255,164,181,202,255,175,191,168,255,187,189,203,255,168,179,171,255,185,183,160,255,191,197,198,255,159,205,163,255,187,191,174,255,208,139,172,255,216,199,207,255,218,174,207,255,179,178,199,255,220,193,138,255,194,165,151,255,176,158,189,255,217,168,201,255,220,169,154,255,175,195,189,255,178,177,216,255,146,170,187,255,159,159,171,255,181,158,164,255,200,165,169,255,205,190,170,255,194,160,161,255,215,187,198,255,202,152,209,255,217,175,184,255,179,196,203,255,176,192,187,255,176,153,193,255,214,172,193,255,220,198,140,255,200,200,183,255,194,165,182,255,158,181,176,255,190,139,178,255,122,159,142,255,220,198,144,255,192,193,192,255,199,172,189,255,185,190,114,255,181,187,182,255,203,215,131,255,218,188,154,255,228,166,155,255,189,189,165,255,178,147,175,255,139,184,179,255,163,190,120,255,148,161,147,255,184,140,155,255,102,171,164,255,130,164,179,255,186,171,172,255,197,172,201,255,223,203,177,255,183,185,158,255,194,207,179,255,201,178,106,255,207,181,169,255,157,189,140,255,180,196,140,255,204,169,178,255,208,127,200,255,162,187,194,255,137,140,152,255,171,131,180,255,182,165,149,255,164,168,162,255,142,142,156,255,168,164,168,255,179,186,178,255,212,173,184,255,206,194,195,255,164,179,147,255,204,207,154,255,174,199,195,255,148,153,210,255,177,153,164,255,161,139,179,255,135,130,190,255,148,167,187,255,145,132,185,255,105,171,149,255,159,185,172,255,179,169,170,255,150,161,117,255,134,167,192,255,185,139,179,255,166,185,170,255,176,145,161,255,132,139,168,255,189,162,204,255,177,144,153,255,186,146,146,255,125,138,144,255,180,171,166,255,172,151,175,255,121,170,148,255,109,186,174,255,169,176,188,255,129,180,188,255,169,137,184,255,154,116,143,255,202,188,152,255,222,200,128,255,200,174,146,255,206,201,130,255,158,181,191,255,178,117,202,255,174,165,188,255,122,138,127,255,126,169,129,255,186,149,184,255,130,145,192,255,166,149,193,255,134,151,159,255,171,159,164,255,171,177,195,255,137,180,146,255,188,185,189,255,232,193,188,255,179,200,165,255,201,162,179,255,184,126,202,255,138,178,201,255,184,175,192,255,149,163,162,255,175,120,151,255,171,129,166,255,123,128,176,255,120,165,194,255,128,186,160,255,192,185,161,255,184,170,180,255,185,166,214,255,192,193,170,255,208,207,170,255,199,191,123,255,165,184,137,255,166,154,179,255,149,183,142,255,181,167,154,255,126,176,168,255,179,156,173,255,154,162,197,255,142,155,133,255,168,162,179,255,177,190,154,255,205,186,110,255,164,138,153,255,203,181,209,255,222,214,114,255,219,222,151,255,220,195,176,255,185,185,204,255,201,184,199,255,139,136,173,255,134,177,153,255,120,178,175,255,188,157,216,255,139,160,179,255,195,187,165,255,174,125,184,255,128,178,205,255,142,183,155,255,167,188,126,255,207,210,177,255,230,203,132,255,213,199,105,255,226,217,185,255,198,185,194,255,134,182,167,255,178,179,170,255,148,155,167,255,150,155,166,255,134,133,152,255,122,153,158,255,179,121,222,255,194,160,188,255,136,168,202,255,198,192,167,255,213,191,167,255,171,188,172,255,213,194,165,255,188,191,169,255,182,178,180,255,223,185,175,255,154,172,183,255,200,187,170,255,186,184,166,255,185,128,154,255,149,156,136,255]
69
69
  }
70
70
  },
71
71
  "cov-step.sl": {
package/lib/noise2d.hlsl CHANGED
@@ -9,9 +9,16 @@
9
9
  // is the kind of thing nobody notices until two effects that should match do
10
10
  // not.
11
11
 
12
+ // The product is reduced before the seed is added, and must stay that way.
13
+ // p * k reaches the tens of thousands, where one rounding step is a few
14
+ // thousandths, and `p * k + seed * c` is a multiply-add a compiler may fuse
15
+ // into one rounding. Dawn on Windows did and Metal and ANGLE did not, so the
16
+ // same program drew a different fbm on each. frac(frac(x) + frac(y)) is the
17
+ // same number, with nothing large left to fuse, and at seed 0 it is exactly
18
+ // what it was.
12
19
  float onejsHash21(float2 p, float seed)
13
20
  {
14
- p = frac(p * float2(123.34, 456.21) + seed * 0.1731);
21
+ p = frac(frac(p * float2(123.34, 456.21)) + frac(seed * 0.1731));
15
22
  p += dot(p, p + 45.32);
16
23
  return frac(p.x * p.y);
17
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onejs-sl",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "The OneJS shader language: a small typed language for per pixel programs, compiled to a portable IR and emitted as HLSL, WGSL, GLSL ES or a VM buffer",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
package/src/ir.ts CHANGED
@@ -425,9 +425,12 @@ export function hashProgram(nodes: SLNode[], result: NodeRef, uniforms: UniformD
425
425
  return d
426
426
  }
427
427
 
428
- // The IR version is in the hash, so a change to what an opcode computes
429
- // changes every hash and every cache keyed by one (an editor's generated
430
- // shaders, Magerie's pipelines) recompiles rather than serving the old maths.
428
+ // The IR version is in the hash, so a change to what an opcode means in the
429
+ // IR changes every hash and every cache keyed by one recompiles rather than
430
+ // serving the old maths. A change to the helper library alone (a noise's
431
+ // arithmetic, say) is not one: every host includes the library's text when
432
+ // it compiles, and none caches a compiled program by hash across a
433
+ // library update, so the new text reaches every shader without a bump.
431
434
  const parts: string[] = [`v${SL_HASH_VERSION}:${SL_IR_VERSION}`, of(result)]
432
435
  for (const u of uniforms) parts.push(`U:${u.name}:${u.type}:${u.value.map(fixed).join(",")}`)
433
436
  for (const t of textures) parts.push(`T:${t.name}:${t.slot}`)
@@ -451,8 +454,17 @@ export const SL_HASH_VERSION = 1
451
454
 
452
455
  /**
453
456
  * Bumped whenever the IR changes in a way a reader has to know about: a new
454
- * opcode, a new shape, a change to what an existing opcode computes, or a
455
- * change to the JSON shape (which also gets a migration in `fromJSON`).
457
+ * opcode, a new shape, a change to what an existing opcode's operands or
458
+ * result mean, or a change to the JSON shape (which also gets a migration in
459
+ * `fromJSON`).
460
+ *
461
+ * NOT bumped for a change to the helper library (`lib/*.hlsl`) that keeps the
462
+ * IR's shape, such as 0.1.11's value noise hash. Hosts include the library's
463
+ * text when they compile and do not cache its output by hash: OneJS's
464
+ * generated shaders include `SLCommon.cginc`, which recompiles, and Magerie
465
+ * keys its compiled pipelines by source text. A bump would change every hash,
466
+ * which strands every recorded program in a player built before the editor
467
+ * records it again, for no gain.
456
468
  *
457
469
  * A reader accepts every version up to its own and refuses a newer one with a
458
470
  * message naming both, the rule the particle wire and fx follow. Part of the
@@ -58,7 +58,9 @@ It writes two things beside the code:
58
58
 
59
59
  - **`<name>.sl.d.ts`**, the way a USS module gets one, carrying the uniform
60
60
  names in the type. `uniforms={{ wrap: 1 }}` is then a call site error rather
61
- than a console warning on a frame nobody is looking at.
61
+ than a console warning on a frame nobody is looking at. Its doc comment lists
62
+ each uniform with its default and the control its attributes ask for, so
63
+ hovering the import says what to set (from onejs-unity after 0.5.19).
62
64
  - **`app.sl.json`** beside the bundle, the manifest `SLShaderGenerator` already
63
65
  watches for. This is the thing the file format makes possible and the EDSL
64
66
  cannot: a program in a file is known statically, so **an ejected game is
package/src/lib/glsl.ts CHANGED
@@ -548,7 +548,7 @@ float sdCircleWave(vec2 p, float tb, float ra) {
548
548
  `,
549
549
  `
550
550
  float onejsHash21(vec2 p, float seed) {
551
- p = fract(p * vec2(123.34, 456.21) + seed * 0.1731);
551
+ p = fract(fract(p * vec2(123.34, 456.21)) + fract(seed * 0.1731));
552
552
  p += dot(p, p + 45.32);
553
553
  return fract(p.x * p.y);
554
554
  }
package/src/lib/hlsl.ts CHANGED
@@ -548,7 +548,7 @@ float sdCircleWave(float2 p, float tb, float ra) {
548
548
  `,
549
549
  `
550
550
  float onejsHash21(float2 p, float seed) {
551
- p = frac(p * float2(123.34, 456.21) + seed * 0.1731);
551
+ p = frac(frac(p * float2(123.34, 456.21)) + frac(seed * 0.1731));
552
552
  p += dot(p, p + 45.32);
553
553
  return frac(p.x * p.y);
554
554
  }
package/src/lib/wgsl.ts CHANGED
@@ -589,7 +589,7 @@ fn sdCircleWave(pIn: vec2f, tbIn: f32, ra: f32) -> f32 {
589
589
  `
590
590
  fn onejsHash21(pIn: vec2f, seed: f32) -> f32 {
591
591
  var p: vec2f = pIn;
592
- p = fract(p * vec2f(123.34, 456.21) + seed * 0.1731);
592
+ p = fract(fract(p * vec2f(123.34, 456.21)) + fract(seed * 0.1731));
593
593
  p += dot(p, p + 45.32);
594
594
  return fract(p.x * p.y);
595
595
  }