@plasius/gpu-renderer 0.2.56 → 0.2.57
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 +17 -0
- package/README.md +48 -0
- package/dist/index.cjs +2256 -1811
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2256 -1811
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/gpu-allocation-budget.js +92 -0
- package/src/index.d.ts +30 -0
- package/src/wavefront-bind-groups.js +2 -0
- package/src/wavefront-compute.js +41 -10
- package/src/wavefront-config.js +16 -2
- package/src/wavefront-instance-shader.js +86 -0
- package/src/wavefront-instances.js +107 -0
- package/src/wavefront-mesh-sources.js +2 -2
- package/src/wavefront-pipelines.js +6 -5
- package/src/wavefront-runtime-support.js +8 -6
- package/src/wavefront-shader-bvh.js +4 -2
- package/src/wavefront-shader-kernels.js +1 -1
- package/src/wavefront-shader-layout.js +1 -0
- package/src/wavefront-shaders.js +5 -1
- package/src/wavefront-upload.js +12 -0
package/CHANGELOG.md
CHANGED
|
@@ -23,6 +23,22 @@ All notable changes to this project will be documented in this file.
|
|
|
23
23
|
- **Security**
|
|
24
24
|
- (placeholder)
|
|
25
25
|
|
|
26
|
+
## [0.2.57] - 2026-10-27
|
|
27
|
+
|
|
28
|
+
- Add opt-in shared mesh BLAS/TLAS instancing with affine transforms and renderer-owned GPU resource byte budgets, allocation diagnostics and failure cleanup.
|
|
29
|
+
|
|
30
|
+
- **Added**
|
|
31
|
+
- (placeholder)
|
|
32
|
+
|
|
33
|
+
- **Changed**
|
|
34
|
+
- (placeholder)
|
|
35
|
+
|
|
36
|
+
- **Fixed**
|
|
37
|
+
- Stage large scene-buffer uploads in bounded sequential chunks to reduce temporary memory pressure during high-resolution initialization.
|
|
38
|
+
|
|
39
|
+
- **Security**
|
|
40
|
+
- (placeholder)
|
|
41
|
+
|
|
26
42
|
## [0.2.56] - 2026-10-24
|
|
27
43
|
|
|
28
44
|
- **Added**
|
|
@@ -1330,3 +1346,4 @@ All notable changes to this project will be documented in this file.
|
|
|
1330
1346
|
[0.2.54]: https://github.com/Plasius-LTD/gpu-renderer/releases/tag/v0.2.54
|
|
1331
1347
|
[0.2.55]: https://github.com/Plasius-LTD/gpu-renderer/releases/tag/v0.2.55
|
|
1332
1348
|
[0.2.56]: https://github.com/Plasius-LTD/gpu-renderer/releases/tag/v0.2.56
|
|
1349
|
+
[0.2.57]: https://github.com/Plasius-LTD/gpu-renderer/releases/tag/v0.2.57
|
package/README.md
CHANGED
|
@@ -84,6 +84,54 @@ unlit-capable rendering path; do not drop their markers or reinterpret them as l
|
|
|
84
84
|
For an interactive model viewer with loading, integrity checks, camera gestures
|
|
85
85
|
and quality controls, use the shared package's `model-inspection` entry.
|
|
86
86
|
|
|
87
|
+
## Repeat geometry with instances
|
|
88
|
+
|
|
89
|
+
Pass each mesh once and reference its ID from `instances`. This shares geometry,
|
|
90
|
+
material textures and each mesh's acceleration structure across placements:
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
import { createWavefrontPathTracingComputeRenderer } from "@plasius/gpu-renderer";
|
|
94
|
+
|
|
95
|
+
const renderer = await createWavefrontPathTracingComputeRenderer({
|
|
96
|
+
canvas: "#scene",
|
|
97
|
+
meshes: [{
|
|
98
|
+
id: 1,
|
|
99
|
+
positions: [-0.4, 0, 0, 0.4, 0, 0, 0, 0.8, 0],
|
|
100
|
+
indices: [0, 1, 2],
|
|
101
|
+
color: [0.3, 0.6, 0.4, 1],
|
|
102
|
+
}],
|
|
103
|
+
instances: Array.from({ length: 100 }, (_, index) => ({
|
|
104
|
+
id: index + 1,
|
|
105
|
+
meshId: 1,
|
|
106
|
+
transform: [
|
|
107
|
+
1, 0, 0, 0,
|
|
108
|
+
0, 1, 0, 0,
|
|
109
|
+
0, 0, 1, 0,
|
|
110
|
+
(index % 10) - 4.5, 0, Math.floor(index / 10) - 4.5, 1,
|
|
111
|
+
],
|
|
112
|
+
})),
|
|
113
|
+
camera: { position: [12, 10, 16], target: [0, 0, 0] },
|
|
114
|
+
memoryBudgetBytes: 512 * 1024 * 1024,
|
|
115
|
+
});
|
|
116
|
+
await renderer.renderFrame();
|
|
117
|
+
console.log(renderer.getSnapshot().allocations);
|
|
118
|
+
renderer.destroy();
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Transforms are invertible column-major affine matrices, including nonuniform
|
|
122
|
+
scale and reflection. Every supplied mesh needs an instance; IDs must be unique
|
|
123
|
+
within their respective mesh/instance lists. The initial instance path supports
|
|
124
|
+
static non-emissive meshes with CPU acceleration construction. Unsupported
|
|
125
|
+
emissive instances or GPU acceleration requests fail explicitly.
|
|
126
|
+
|
|
127
|
+
`memoryBudgetBytes` limits renderer-owned resource storage. Admission also checks
|
|
128
|
+
individual device limits. `getSnapshot().allocations` reports current/peak bytes
|
|
129
|
+
and individual buffers/textures, including refinement and denoising resources.
|
|
130
|
+
These are requested allocation sizes, not a measurement of free VRAM or driver
|
|
131
|
+
residency. A larger instance count adds transforms and scene-index nodes without
|
|
132
|
+
multiplying the underlying geometry. Large buffer uploads use bounded sequential
|
|
133
|
+
staging to reduce temporary upload pressure. Recreate the runtime to replace instances.
|
|
134
|
+
|
|
87
135
|
## Choose a rendering API
|
|
88
136
|
|
|
89
137
|
| API | Purpose |
|