@aethervtt/shard-noise 0.1.0 → 0.2.1

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/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { compileGraph, FRACTAL, type NoiseProgram, OP, POSITION_REGS, SKEW, WIDTH, } from './compile.js';
2
2
  export { NOISE_LIBRARY_PATH, registerNoiseGraph, registerNoiseLibrary } from './gpu.js';
3
3
  export { forEachInput, type GraphInput, type GraphNode, type ParamValue, type ParsedGraph, parseGraph, pointer, } from './graph.js';
4
- export { BLOCK, computeOrigins, directionToFace, faceToDirection, gridOrigin, gridPoints, ORIGIN_WORDS, type OriginTerms, patchOrigin, patchPoints, } from './kernel.js';
5
- export { loadNoiseKernel, type NoiseKernel, noiseKernel, simdSupported, useNoiseKernel, } from './loader.js';
4
+ export { BLOCK, computeOrigins, directionToFace, evalProgram, faceToDirection, gridOrigin, gridPoints, ORIGIN_WORDS, type OriginTerms, patchOrigin, patchPoints, } from './kernel.js';
5
+ export { loadNoiseKernel, NOISE_KERNEL_MODULE, type NoiseKernel, noiseKernel, simdSupported, useNoiseKernel, } from './loader.js';
6
6
  export { MAX_SAMPLE_POINTS, noiseMethods, resolveGraph } from './methods.js';
7
7
  export { CELL_DISTANCES, CELL_RETURNS, MAX_OCTAVES, NODE_DEFS, type NodeCategory, type NodeDef, nodeDef, type ParamDef, SOURCE_KINDS, type SourceKind, } from './nodes.js';
8
8
  export { NoiseGraph, type NoiseGraphArtifact, NoiseGraphAssetType, NoiseGraphImporter, NoiseGraphStore, NoiseGraphs, noiseNames, type ProgramJson, } from './noise-graph.js';
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ import {
16
16
  BLOCK,
17
17
  computeOrigins,
18
18
  directionToFace,
19
+ evalProgram,
19
20
  faceToDirection,
20
21
  gridOrigin,
21
22
  gridPoints,
@@ -25,6 +26,7 @@ import {
25
26
  } from "./kernel.js";
26
27
  import {
27
28
  loadNoiseKernel,
29
+ NOISE_KERNEL_MODULE,
28
30
  noiseKernel,
29
31
  simdSupported,
30
32
  useNoiseKernel
@@ -74,6 +76,7 @@ export {
74
76
  MAX_OCTAVES,
75
77
  MAX_SAMPLE_POINTS,
76
78
  NODE_DEFS,
79
+ NOISE_KERNEL_MODULE,
77
80
  NOISE_LIBRARY,
78
81
  NOISE_LIBRARY_PATH,
79
82
  NoiseGraph,
@@ -90,6 +93,7 @@ export {
90
93
  compileGraph,
91
94
  computeOrigins,
92
95
  directionToFace,
96
+ evalProgram,
93
97
  faceToDirection,
94
98
  forEachInput,
95
99
  generateWgsl,
package/dist/loader.d.ts CHANGED
@@ -9,6 +9,12 @@ export interface NoiseKernel {
9
9
  }
10
10
  /** Whether this host runs WebAssembly SIMD (every current browser and Node does). */
11
11
  export declare function simdSupported(): boolean;
12
+ /**
13
+ * URL of the kernel's JavaScript side (kernel.js), for other packages' pool jobs: a worker module
14
+ * imports it with `import(url)` and instantiates the posted `NoiseKernel.module`, so it samples
15
+ * exactly as this thread does.
16
+ */
17
+ export declare const NOISE_KERNEL_MODULE: string;
12
18
  /**
13
19
  * Loads the WASM noise kernel once per thread: the SIMD build where the host supports it (or when
14
20
  * `simd` says so), the scalar build otherwise. The two give bitwise-equal results.
package/dist/loader.js CHANGED
@@ -36,6 +36,7 @@ const SIMD_PROBE = new Uint8Array([
36
36
  function simdSupported() {
37
37
  return WebAssembly.validate(SIMD_PROBE);
38
38
  }
39
+ const NOISE_KERNEL_MODULE = new URL("./kernel.js", import.meta.url).href;
39
40
  const loaded = /* @__PURE__ */ new Map();
40
41
  let current;
41
42
  async function readWasm(file) {
@@ -101,6 +102,7 @@ function noiseKernel() {
101
102
  return current;
102
103
  }
103
104
  export {
105
+ NOISE_KERNEL_MODULE,
104
106
  loadNoiseKernel,
105
107
  noiseKernel,
106
108
  simdSupported,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aethervtt/shard-noise",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -17,12 +17,12 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "@aethervtt/shard-assets": "0.1.0",
21
- "@aethervtt/shard-core": "0.1.0",
22
- "@aethervtt/shard-gpu": "0.1.0",
23
- "@aethervtt/shard-platform": "0.1.0",
24
- "@aethervtt/shard-runtime": "0.1.0",
25
- "@aethervtt/shard-shader": "0.1.0"
20
+ "@aethervtt/shard-assets": "0.2.1",
21
+ "@aethervtt/shard-core": "0.2.1",
22
+ "@aethervtt/shard-gpu": "0.2.1",
23
+ "@aethervtt/shard-platform": "0.2.1",
24
+ "@aethervtt/shard-runtime": "0.2.1",
25
+ "@aethervtt/shard-shader": "0.2.1"
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",
@@ -34,6 +34,6 @@
34
34
  "provenance": true
35
35
  },
36
36
  "shard": {
37
- "buildSha": "8e14c9896f82a3554b156f1ffdd68f2cc3e7d78a"
37
+ "buildSha": "772eb0d2b8a5fc499105708f4ae92c58788cc9ea"
38
38
  }
39
39
  }