@plasius/gpu-renderer 0.2.56 → 0.2.58

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
@@ -23,6 +23,38 @@ All notable changes to this project will be documented in this file.
23
23
  - **Security**
24
24
  - (placeholder)
25
25
 
26
+ ## [0.2.58] - 2026-10-28
27
+
28
+ - Pack shared instance records across device-bounded texture rows with bounded uploads, padded storage diagnostics and early TLAS byte-budget checks.
29
+
30
+ - **Added**
31
+ - (placeholder)
32
+
33
+ - **Changed**
34
+ - (placeholder)
35
+
36
+ - **Fixed**
37
+ - (placeholder)
38
+
39
+ - **Security**
40
+ - (placeholder)
41
+
42
+ ## [0.2.57] - 2026-10-27
43
+
44
+ - Add opt-in shared mesh BLAS/TLAS instancing with affine transforms and renderer-owned GPU resource byte budgets, allocation diagnostics and failure cleanup.
45
+
46
+ - **Added**
47
+ - (placeholder)
48
+
49
+ - **Changed**
50
+ - (placeholder)
51
+
52
+ - **Fixed**
53
+ - Stage large scene-buffer uploads in bounded sequential chunks to reduce temporary memory pressure during high-resolution initialization.
54
+
55
+ - **Security**
56
+ - (placeholder)
57
+
26
58
  ## [0.2.56] - 2026-10-24
27
59
 
28
60
  - **Added**
@@ -1330,3 +1362,5 @@ All notable changes to this project will be documented in this file.
1330
1362
  [0.2.54]: https://github.com/Plasius-LTD/gpu-renderer/releases/tag/v0.2.54
1331
1363
  [0.2.55]: https://github.com/Plasius-LTD/gpu-renderer/releases/tag/v0.2.55
1332
1364
  [0.2.56]: https://github.com/Plasius-LTD/gpu-renderer/releases/tag/v0.2.56
1365
+ [0.2.57]: https://github.com/Plasius-LTD/gpu-renderer/releases/tag/v0.2.57
1366
+ [0.2.58]: https://github.com/Plasius-LTD/gpu-renderer/releases/tag/v0.2.58
package/README.md CHANGED
@@ -84,6 +84,63 @@ 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
+
135
+ Instance records pack across both texture dimensions, so the texture height is
136
+ not an instance-count ceiling. The granted device texture dimensions, buffer
137
+ binding limits and `memoryBudgetBytes` determine admission. The memory snapshot
138
+ reports logical `instanceBytes` and padded `instanceTextureBytes`; allocation
139
+ diagnostics include the actual requested texture size and TLAS buffer. Instance
140
+ texture uploads also use sequential chunks no larger than 8 MiB. More instances
141
+ still require ray traversal and shading work: qualify performance at your target
142
+ resolution, sampling and material complexity.
143
+
87
144
  ## Choose a rendering API
88
145
 
89
146
  | API | Purpose |