@plasius/gpu-world-generator 0.0.10 → 0.0.12
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/README.md +48 -0
- package/dist/index.cjs +769 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +120 -1
- package/dist/index.d.ts +120 -1
- package/dist/index.js +757 -1
- package/dist/index.js.map +1 -1
- package/docs/adrs/adr-0004-worker-dag-manifests-for-chunk-and-voxel-generation.md +37 -0
- package/docs/adrs/adr-0005-render-representation-tiers-and-proxy-outputs.md +51 -0
- package/docs/adrs/index.md +2 -0
- package/docs/design/worker-manifest-integration.md +42 -0
- package/docs/tdrs/index.md +4 -0
- package/docs/tdrs/tdr-0001-world-generator-worker-manifest-contract.md +39 -0
- package/docs/tdrs/tdr-0002-render-representation-tier-contract.md +60 -0
- package/package.json +6 -3
- package/src/index.ts +1 -0
- package/src/worker.ts +978 -0
package/README.md
CHANGED
|
@@ -59,6 +59,52 @@ const { levelSpec, cells, terrain } = generateTemperateMixedForest({
|
|
|
59
59
|
import terrainWgsl from "@plasius/gpu-world-generator/terrain.wgsl?raw";
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
+
## Worker DAG Manifests
|
|
63
|
+
|
|
64
|
+
`@plasius/gpu-world-generator` now publishes worker-first generation manifests
|
|
65
|
+
so chunk and voxel work can be scheduled as a multi-root DAG instead of a flat
|
|
66
|
+
queue.
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
import { getWorldGeneratorWorkerManifest } from "@plasius/gpu-world-generator";
|
|
70
|
+
|
|
71
|
+
const streaming = getWorldGeneratorWorkerManifest();
|
|
72
|
+
const bake = getWorldGeneratorWorkerManifest("bake");
|
|
73
|
+
|
|
74
|
+
console.log(streaming.jobs.map((job) => job.worker.jobType));
|
|
75
|
+
console.log(bake.jobs.find((job) => job.key === "assetSerialize"));
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
- `streaming` models runtime chunk generation and mesh materialization.
|
|
79
|
+
- `bake` extends the DAG with asset serialization for background/offline output.
|
|
80
|
+
- Jobs include queue class, priority, dependencies, adaptive budget ladders, and
|
|
81
|
+
debug allocation tags for integration with `@plasius/gpu-performance` and
|
|
82
|
+
`@plasius/gpu-debug`.
|
|
83
|
+
|
|
84
|
+
## Render Representation Plans
|
|
85
|
+
|
|
86
|
+
`@plasius/gpu-world-generator` now also publishes explicit chunk
|
|
87
|
+
representation-tier plans so renderer and worker packages can coordinate near,
|
|
88
|
+
mid, far, and horizon outputs without guessing from distance alone.
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
import { createWorldGeneratorRepresentationPlan } from "@plasius/gpu-world-generator";
|
|
92
|
+
|
|
93
|
+
const plan = createWorldGeneratorRepresentationPlan({
|
|
94
|
+
chunkId: "hex-12-9",
|
|
95
|
+
profile: "streaming",
|
|
96
|
+
gameplayImportance: "critical",
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
console.log(plan.bands);
|
|
100
|
+
console.log(plan.representations.find((entry) => entry.output === "rtProxy"));
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Each plan exposes raster-facing and RT-facing outputs separately, plus refresh
|
|
104
|
+
cadence, shadow relevance, chunk-identity preservation, and scheduling metadata
|
|
105
|
+
that downstream renderer and worker packages can prioritize by band and
|
|
106
|
+
importance.
|
|
107
|
+
|
|
62
108
|
## Demo
|
|
63
109
|
The WebGPU mixed-forest demo lives in `demo/`. Run it with:
|
|
64
110
|
|
|
@@ -81,3 +127,5 @@ npm run pack:check
|
|
|
81
127
|
## Notes
|
|
82
128
|
- For Vite/Pnpm setups, raw WGSL import is the most reliable.
|
|
83
129
|
- See `docs/plan.md` for hierarchy and biome rules.
|
|
130
|
+
- See `docs/design/worker-manifest-integration.md` for the chunk/voxel DAG
|
|
131
|
+
contract.
|