@woosh/meep-engine 3.31.0 → 3.33.0
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/build/bundle-worker-terrain.js +1 -1
- package/package.json +1 -1
- package/src/core/collection/table/RowFirstTable.d.ts +8 -0
- package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
- package/src/core/collection/table/RowFirstTable.js +40 -11
- package/src/engine/graphics/ecs/sprite/Sprite.d.ts +3 -0
- package/src/engine/graphics/ecs/sprite/Sprite.d.ts.map +1 -1
- package/src/engine/graphics/ecs/sprite/Sprite.js +3 -0
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts +3 -0
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +1 -1
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +3 -0
- package/src/engine/graphics3/DebugDrawSystem.d.ts.map +1 -1
- package/src/engine/graphics3/DebugDrawSystem.js +6 -2
- package/src/engine/graphics3/PathDisplaySystem.d.ts.map +1 -1
- package/src/engine/graphics3/PathDisplaySystem.js +311 -307
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/RENDERER_CONTRACT.md +15 -2
- package/src/shade/device/IMMEDIATE_DATA_PLAN_2026_08_28.md +5 -0
- package/src/shade/device/ShadeGPUCommandContext.d.ts +15 -2
- package/src/shade/device/ShadeGPUCommandContext.d.ts.map +1 -1
- package/src/shade/device/ShadeGPUCommandContext.js +154 -25
- package/src/shade/device/mock/SoftwareGPURenderPassEncoder.d.ts +20 -3
- package/src/shade/device/mock/SoftwareGPURenderPassEncoder.d.ts.map +1 -1
- package/src/shade/device/mock/SoftwareGPURenderPassEncoder.js +21 -3
- package/src/shade/renderer/GraphicsContext.d.ts +20 -1
- package/src/shade/renderer/GraphicsContext.d.ts.map +1 -1
- package/src/shade/renderer/GraphicsContext.js +105 -52
- package/src/shade/renderer/Renderer.d.ts +19 -4
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +113 -2
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts +10 -7
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
- package/src/shade/renderer/animation/GPUAnimationManager.js +147 -45
- package/src/shade/renderer/buffer/GPUBufferReadbackAllocator.d.ts +6 -5
- package/src/shade/renderer/buffer/GPUBufferReadbackAllocator.d.ts.map +1 -1
- package/src/shade/renderer/buffer/GPUBufferReadbackAllocator.js +241 -240
- package/src/shade/renderer/buffer/GPUBufferStagingAllocator.d.ts +62 -2
- package/src/shade/renderer/buffer/GPUBufferStagingAllocator.d.ts.map +1 -1
- package/src/shade/renderer/buffer/GPUBufferStagingAllocator.js +306 -38
- package/src/shade/renderer/buffer/GPUBufferUploadAllocator.d.ts +60 -0
- package/src/shade/renderer/buffer/GPUBufferUploadAllocator.d.ts.map +1 -0
- package/src/shade/renderer/buffer/GPUBufferUploadAllocator.js +202 -0
- package/src/shade/renderer/buffer/GPUUploadBlock.d.ts +68 -0
- package/src/shade/renderer/buffer/GPUUploadBlock.d.ts.map +1 -0
- package/src/shade/renderer/buffer/GPUUploadBlock.js +97 -0
- package/src/shade/renderer/dynamic/DynamicMeshAVBOITChannel.d.ts +2 -1
- package/src/shade/renderer/dynamic/DynamicMeshAVBOITChannel.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/DynamicMeshAVBOITChannel.js +19 -17
- package/src/shade/renderer/dynamic/GPUDynamicMeshDrawList.d.ts +70 -0
- package/src/shade/renderer/dynamic/GPUDynamicMeshDrawList.d.ts.map +1 -0
- package/src/shade/renderer/dynamic/GPUDynamicMeshDrawList.js +257 -0
- package/src/shade/renderer/dynamic/GPUDynamicMeshRenderer.d.ts +20 -7
- package/src/shade/renderer/dynamic/GPUDynamicMeshRenderer.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/GPUDynamicMeshRenderer.js +39 -41
- package/src/shade/renderer/dynamic/GPUDynamicMeshResidency.d.ts +6 -20
- package/src/shade/renderer/dynamic/GPUDynamicMeshResidency.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/GPUDynamicMeshResidency.js +42 -36
- package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.d.ts +2 -1
- package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.js +4 -3
- package/src/shade/renderer/dynamic/chunk_dynamic_mesh_vertex.d.ts +4 -3
- package/src/shade/renderer/dynamic/chunk_dynamic_mesh_vertex.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/chunk_dynamic_mesh_vertex.js +7 -4
- package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.d.ts +14 -15
- package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.js +49 -83
- package/src/shade/renderer/dynamic/shader_dynamic_mesh.d.ts +19 -3
- package/src/shade/renderer/dynamic/shader_dynamic_mesh.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/shader_dynamic_mesh.js +26 -6
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.d.ts +2 -1
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.js +12 -6
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.d.ts +3 -2
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.js +21 -13
- package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.d.ts +5 -0
- package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.d.ts.map +1 -1
- package/src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.js +19 -0
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/rasterize/bucket/rasterization_has_opaque_bucket.d.ts +3 -1
- package/src/shade/renderer/rasterize/bucket/rasterization_has_opaque_bucket.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/rasterization_has_opaque_bucket.js +3 -1
- package/src/shade/renderer/rasterize/expand/bucket/mesh/shader_instances_rasterization_bucket_sort.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/bucket/mesh/shader_instances_rasterization_bucket_sort.js +134 -88
- package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_rasterization_bucket_sort.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/expand/bucket/meshlet/shader_meshlets_rasterization_bucket_sort.js +57 -26
- package/src/shade/renderer/rasterize/fast/graph_rasterize_scene_fast.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/fast/graph_rasterize_scene_fast.js +28 -20
- package/src/shade/renderer/rasterize/graph_clear_raster_targets.d.ts +38 -0
- package/src/shade/renderer/rasterize/graph_clear_raster_targets.d.ts.map +1 -0
- package/src/shade/renderer/rasterize/graph_clear_raster_targets.js +105 -0
- package/src/shade/renderer/rasterize/native/avboit/AVBOIT_LEDGER.md +20 -0
- package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.d.ts +1 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_partial_opaque.js +21 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_scene.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/standard/graph_rasterize_scene.js +12 -20
- package/src/shade/renderer/shader/graph/graph_import_typed_buffer.d.ts +2 -1
- package/src/shade/renderer/shader/graph/graph_import_typed_buffer.d.ts.map +1 -1
- package/src/shade/renderer/shader/graph/graph_import_typed_buffer.js +15 -28
- package/src/shade/renderer/shader/type/serde/write_gpu_typed_buffer.d.ts.map +1 -1
- package/src/shade/renderer/shader/type/serde/write_gpu_typed_buffer.js +8 -1
- package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts +0 -73
- package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts.map +0 -1
- package/src/engine/graphics3/terrain/GPUTerrainSplatRenderer.d.ts +0 -59
- package/src/engine/graphics3/terrain/GPUTerrainSplatRenderer.d.ts.map +0 -1
- package/src/engine/graphics3/terrain/pack_terrain_row_table.d.ts +0 -22
- package/src/engine/graphics3/terrain/pack_terrain_row_table.d.ts.map +0 -1
- package/src/engine/graphics3/terrain/shader_terrain_splat.d.ts +0 -26
- package/src/engine/graphics3/terrain/shader_terrain_splat.d.ts.map +0 -1
- package/src/shade/renderer/animation/ANIMATION_BOUND_TRACK_GROUP_STRUCT.d.ts +0 -25
- package/src/shade/renderer/animation/ANIMATION_BOUND_TRACK_GROUP_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/animation/ANIMATION_KEYFRAME_BLOCK_STRUCT.d.ts +0 -26
- package/src/shade/renderer/animation/ANIMATION_KEYFRAME_BLOCK_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/animation/ANIMATION_SKIN_JOINT_BLOCK_STRUCT.d.ts +0 -29
- package/src/shade/renderer/animation/ANIMATION_SKIN_JOINT_BLOCK_STRUCT.d.ts.map +0 -1
|
@@ -28,58 +28,27 @@ import {
|
|
|
28
28
|
/**
|
|
29
29
|
* The dynamic meshes' three contributions to the AVBOIT transparency pipeline — the
|
|
30
30
|
* `AVBOITSideChannel` contract, recorded into the frame graph the way the AVBOIT orchestrator records
|
|
31
|
-
* its own passes. `DynamicMeshAVBOITChannel` calls these with
|
|
32
|
-
* the
|
|
31
|
+
* its own passes. `DynamicMeshAVBOITChannel` calls these with what it decided for the frame — the
|
|
32
|
+
* occupancy with the meshes it found live, the splat and the draw with the list the occupancy writes
|
|
33
|
+
* their draws into — and the handles the orchestrator hands it.
|
|
33
34
|
*
|
|
34
|
-
* One draw per mesh in the splat and in the draw, as in the pass over the scene
|
|
35
|
-
*
|
|
36
|
-
*
|
|
35
|
+
* One draw per mesh in the splat and in the draw, as in the pass over the scene, out of one
|
|
36
|
+
* {@link GPUDynamicMeshDrawList} per frame: the occupancy writes it, the splat and the draw both draw
|
|
37
|
+
* it, so the meshes' constants go up once a frame and the two passes read the same ones. Order does
|
|
38
|
+
* not matter to any of them — the volume and the accumulators are sums — which is why nothing here
|
|
39
|
+
* sorts.
|
|
37
40
|
*/
|
|
38
41
|
|
|
39
42
|
/** The accumulators' and the splat target's view: one mip, the one the frame draws into. */
|
|
40
43
|
const COLOR_VIEW = TextureViewDescriptor.from({ mipLevelCount: 1, baseMipLevel: 0 });
|
|
41
44
|
|
|
42
45
|
/**
|
|
43
|
-
*
|
|
44
|
-
* over the scene, then the pass's groups, the same for every draw.
|
|
45
|
-
*
|
|
46
|
-
* **Before the render pass is opened**: staging a mesh's draw uniform records a copy onto the
|
|
47
|
-
* command encoder, and the encoder is locked for as long as a pass is open on it.
|
|
48
|
-
*
|
|
49
|
-
* @param {ShadeGPUCommandContext} encoder
|
|
50
|
-
* @param {GPUDynamicMeshResidencyTable} residency
|
|
51
|
-
* @param {DynamicMesh[]} meshes
|
|
52
|
-
* @param {GPUBuffer} camera
|
|
53
|
-
* @param {GPUBindingResource[][]} pass_groups groups 1 and up
|
|
54
|
-
* @returns {{residency: GPUDynamicMeshResidency, bindings: GPUBindingResource[][]}[]}
|
|
55
|
-
*/
|
|
56
|
-
function prepare_draws(encoder, residency, meshes, camera, pass_groups) {
|
|
57
|
-
const draws = [];
|
|
58
|
-
|
|
59
|
-
for (let i = 0; i < meshes.length; i++) {
|
|
60
|
-
const mesh = meshes[i];
|
|
61
|
-
const resident = residency.get(mesh.geometry);
|
|
62
|
-
|
|
63
|
-
if (resident === undefined || resident.index_count === 0) {
|
|
64
|
-
// not uploaded by this frame's occupancy pass, or nothing to draw
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const [mesh_group] = resident.create_bindings(encoder, mesh, camera);
|
|
69
|
-
|
|
70
|
-
draws.push({ residency: resident, bindings: [mesh_group, ...pass_groups] });
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return draws;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Upload the live meshes, then mark the depth slices their world boxes span
|
|
46
|
+
* Upload the live meshes and write their draws, then mark the depth slices their world boxes span
|
|
78
47
|
* (`shader_dynamic_mesh_avboit_occupancy`).
|
|
79
48
|
*
|
|
80
|
-
* **This is the pass that brings the vertices up to date**, being the
|
|
81
|
-
* only reachable at execution time, and the splat and the draw that
|
|
82
|
-
* same frame, behind the warp this pass's output feeds.
|
|
49
|
+
* **This is the pass that brings the vertices and the draws' constants up to date**, being the
|
|
50
|
+
* channel's first: the device is only reachable at execution time, and the splat and the draw that
|
|
51
|
+
* read them run later in the same frame, behind the warp this pass's output feeds.
|
|
83
52
|
*
|
|
84
53
|
* @param {object} params
|
|
85
54
|
* @param {import("../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} params.graph
|
|
@@ -89,6 +58,8 @@ function prepare_draws(encoder, residency, meshes, camera, pass_groups) {
|
|
|
89
58
|
* @param {GPUDynamicMeshResidencyTable} params.residency
|
|
90
59
|
* @param {DynamicMesh[]} params.meshes the live meshes, one box each
|
|
91
60
|
* @param {Float32Array} params.boxes world boxes, {@link DYNAMIC_MESH_AVBOIT_BOX_FLOATS} floats per mesh
|
|
61
|
+
* @param {GPUDynamicMeshDrawList} params.draws the frame's draws, written here for the splat and the
|
|
62
|
+
* draw of the same frame
|
|
92
63
|
* @returns {number} the occupancy handle after the write
|
|
93
64
|
*/
|
|
94
65
|
export function graph_dynamic_mesh_avboit_occupancy({
|
|
@@ -99,6 +70,7 @@ export function graph_dynamic_mesh_avboit_occupancy({
|
|
|
99
70
|
residency,
|
|
100
71
|
meshes,
|
|
101
72
|
boxes,
|
|
73
|
+
draws,
|
|
102
74
|
}) {
|
|
103
75
|
assert.isNonNegativeInteger(camera, "camera");
|
|
104
76
|
assert.isNonNegativeInteger(occupancy, "occupancy");
|
|
@@ -115,6 +87,8 @@ export function graph_dynamic_mesh_avboit_occupancy({
|
|
|
115
87
|
|
|
116
88
|
residency.upload(context.graphics.device, meshes);
|
|
117
89
|
|
|
90
|
+
draws.write(encoder, residency, meshes);
|
|
91
|
+
|
|
118
92
|
shader_dynamic_mesh_avboit_occupancy.dispatch({
|
|
119
93
|
encoder,
|
|
120
94
|
bindings: {
|
|
@@ -157,8 +131,7 @@ export function graph_dynamic_mesh_avboit_occupancy({
|
|
|
157
131
|
* @param {number} params.warp graph handle
|
|
158
132
|
* @param {number[]} params.voxel_resolution the volume's width and height, which the raster is
|
|
159
133
|
* @param {{extinction: number, overflow: number, dummy: number}} params.volume the volume, to add to
|
|
160
|
-
* @param {
|
|
161
|
-
* @param {DynamicMesh[]} params.meshes the live meshes
|
|
134
|
+
* @param {GPUDynamicMeshDrawList} params.draws the frame's draws, as the occupancy wrote them
|
|
162
135
|
* @returns {{extinction: number, overflow: number, dummy: number}} the volume after the write
|
|
163
136
|
*/
|
|
164
137
|
export function graph_dynamic_mesh_avboit_splat({
|
|
@@ -167,8 +140,7 @@ export function graph_dynamic_mesh_avboit_splat({
|
|
|
167
140
|
warp,
|
|
168
141
|
voxel_resolution,
|
|
169
142
|
volume,
|
|
170
|
-
|
|
171
|
-
meshes,
|
|
143
|
+
draws,
|
|
172
144
|
}) {
|
|
173
145
|
assert.isNonNegativeInteger(camera, "camera");
|
|
174
146
|
assert.isNonNegativeInteger(warp, "warp");
|
|
@@ -179,31 +151,30 @@ export function graph_dynamic_mesh_avboit_splat({
|
|
|
179
151
|
const encoder = context.encoder;
|
|
180
152
|
const graphics = context.graphics;
|
|
181
153
|
|
|
154
|
+
if (draws.count === 0) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const pipeline = DYNAMIC_MESH_AVBOIT_SPLAT_PIPELINE;
|
|
159
|
+
|
|
182
160
|
// By name, never by position (ledger entry 21): the order a shader declares its bindings in
|
|
183
161
|
// is the shader's business.
|
|
184
162
|
const groups = DYNAMIC_MESH_AVBOIT_SPLAT_RESOURCES.groups;
|
|
185
163
|
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}, encoder),
|
|
190
|
-
groups[DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_VOLUME].generateBindings({
|
|
191
|
-
extinction_volume: resources.get(data.extinction),
|
|
192
|
-
overflow_slice: resources.get(data.overflow),
|
|
193
|
-
}, encoder),
|
|
194
|
-
];
|
|
195
|
-
|
|
196
|
-
const draws = prepare_draws(encoder, residency, meshes, resources.get(data.camera), pass_groups);
|
|
164
|
+
const pass_group = groups[DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_PASS].generateBindings({
|
|
165
|
+
warp: resources.get(data.warp),
|
|
166
|
+
}, encoder);
|
|
197
167
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
168
|
+
const volume_group = groups[DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_VOLUME].generateBindings({
|
|
169
|
+
extinction_volume: resources.get(data.extinction),
|
|
170
|
+
overflow_slice: resources.get(data.overflow),
|
|
171
|
+
}, encoder);
|
|
201
172
|
|
|
202
173
|
// the target is never written; it only sizes the raster and gives it its samples
|
|
203
174
|
const pass_encoder = encoder.constructRenderPass({
|
|
204
175
|
label: "Dynamic Mesh AVBOIT Splat",
|
|
205
|
-
pipeline
|
|
206
|
-
//
|
|
176
|
+
pipeline,
|
|
177
|
+
// the pass's groups are set once, just below; the draws set their own
|
|
207
178
|
bindings: [],
|
|
208
179
|
colorAttachments: [{
|
|
209
180
|
view: resources.get(data.target).obtainView(COLOR_VIEW),
|
|
@@ -212,11 +183,10 @@ export function graph_dynamic_mesh_avboit_splat({
|
|
|
212
183
|
}],
|
|
213
184
|
});
|
|
214
185
|
|
|
215
|
-
|
|
216
|
-
|
|
186
|
+
graphics.setPipelineBindGroup(pass_encoder, pipeline, DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_PASS, pass_group);
|
|
187
|
+
graphics.setPipelineBindGroup(pass_encoder, pipeline, DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_VOLUME, volume_group);
|
|
217
188
|
|
|
218
|
-
|
|
219
|
-
}
|
|
189
|
+
draws.draw(pass_encoder, graphics, pipeline, resources.get(data.camera));
|
|
220
190
|
|
|
221
191
|
pass_encoder.end();
|
|
222
192
|
}
|
|
@@ -264,8 +234,7 @@ export function graph_dynamic_mesh_avboit_splat({
|
|
|
264
234
|
* @param {number} params.volumetrics_lut graph handle
|
|
265
235
|
* @param {number} params.volumetrics_metadata graph handle
|
|
266
236
|
* @param {{color: number, norm: number, extinction: number, emission: number}} params.accumulators to add to
|
|
267
|
-
* @param {
|
|
268
|
-
* @param {DynamicMesh[]} params.meshes the live meshes
|
|
237
|
+
* @param {GPUDynamicMeshDrawList} params.draws the frame's draws, as the occupancy wrote them
|
|
269
238
|
* @returns {{color: number, norm: number, extinction: number, emission: number}} the accumulators after the draw
|
|
270
239
|
*/
|
|
271
240
|
export function graph_dynamic_mesh_avboit_draw({
|
|
@@ -278,8 +247,7 @@ export function graph_dynamic_mesh_avboit_draw({
|
|
|
278
247
|
volumetrics_lut,
|
|
279
248
|
volumetrics_metadata,
|
|
280
249
|
accumulators,
|
|
281
|
-
|
|
282
|
-
meshes,
|
|
250
|
+
draws,
|
|
283
251
|
}) {
|
|
284
252
|
assert.isNonNegativeInteger(camera, "camera");
|
|
285
253
|
assert.isNonNegativeInteger(depth_texture, "depth_texture");
|
|
@@ -291,6 +259,12 @@ export function graph_dynamic_mesh_avboit_draw({
|
|
|
291
259
|
const encoder = context.encoder;
|
|
292
260
|
const graphics = context.graphics;
|
|
293
261
|
|
|
262
|
+
if (draws.count === 0) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const pipeline = DYNAMIC_MESH_AVBOIT_DRAW_PIPELINE;
|
|
267
|
+
|
|
294
268
|
// by name rather than by position, for the reason the splat gives
|
|
295
269
|
const pass_group = DYNAMIC_MESH_AVBOIT_DRAW_RESOURCES.groups[DYNAMIC_MESH_AVBOIT_DRAW_BIND_GROUP_PASS].generateBindings({
|
|
296
270
|
view: view_ctx.uniform_buffer.buffer,
|
|
@@ -302,12 +276,6 @@ export function graph_dynamic_mesh_avboit_draw({
|
|
|
302
276
|
tSTBN_vec3: graphics.textures.obtain(STATIC_GRAPHICS_ENGINE_ASSETS.stbn_vec3).obtainView(),
|
|
303
277
|
}, encoder);
|
|
304
278
|
|
|
305
|
-
const draws = prepare_draws(encoder, residency, meshes, resources.get(data.camera), [pass_group]);
|
|
306
|
-
|
|
307
|
-
if (draws.length === 0) {
|
|
308
|
-
return;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
279
|
const attachment = (handle) => ({
|
|
312
280
|
view: resources.get(handle).obtainView(COLOR_VIEW),
|
|
313
281
|
loadOp: "load",
|
|
@@ -316,8 +284,8 @@ export function graph_dynamic_mesh_avboit_draw({
|
|
|
316
284
|
|
|
317
285
|
const pass_encoder = encoder.constructRenderPass({
|
|
318
286
|
label: "Dynamic Mesh AVBOIT Draw",
|
|
319
|
-
pipeline
|
|
320
|
-
// group
|
|
287
|
+
pipeline,
|
|
288
|
+
// the pass's group is set once, just below; the draws set their own
|
|
321
289
|
bindings: [],
|
|
322
290
|
colorAttachments: [
|
|
323
291
|
attachment(data.color),
|
|
@@ -331,11 +299,9 @@ export function graph_dynamic_mesh_avboit_draw({
|
|
|
331
299
|
},
|
|
332
300
|
});
|
|
333
301
|
|
|
334
|
-
|
|
335
|
-
const draw = draws[i];
|
|
302
|
+
graphics.setPipelineBindGroup(pass_encoder, pipeline, DYNAMIC_MESH_AVBOIT_DRAW_BIND_GROUP_PASS, pass_group);
|
|
336
303
|
|
|
337
|
-
|
|
338
|
-
}
|
|
304
|
+
draws.draw(pass_encoder, graphics, pipeline, resources.get(data.camera));
|
|
339
305
|
|
|
340
306
|
pass_encoder.end();
|
|
341
307
|
}
|
|
@@ -28,12 +28,28 @@ export function create_dynamic_mesh_pipeline({ color_format, depth_format, depth
|
|
|
28
28
|
opaque?: boolean;
|
|
29
29
|
}): RenderPipelineDescriptor;
|
|
30
30
|
/**
|
|
31
|
-
* Per-draw constants
|
|
32
|
-
*
|
|
31
|
+
* Per-draw constants: one row of a frame's table of them, which a draw finds at its
|
|
32
|
+
* `instance_index` — its `first_instance`, since each draw is one instance.
|
|
33
|
+
*
|
|
34
|
+
* Every row is written anew every frame. A dynamic mesh's transform and colour are its to change as
|
|
35
|
+
* often as its vertices, so nothing about them is assumed to carry over from one frame to the next.
|
|
33
36
|
*/
|
|
34
37
|
export const DYNAMIC_MESH_DRAW_STRUCT: WebGPUStruct;
|
|
35
38
|
/**
|
|
36
|
-
*
|
|
39
|
+
* Bind group of the camera and one chunk of the frame's draw constants (`draws`), set once per chunk.
|
|
40
|
+
* @type {number}
|
|
41
|
+
*/
|
|
42
|
+
export const DYNAMIC_MESH_BIND_GROUP_DRAWS: number;
|
|
43
|
+
/**
|
|
44
|
+
* Bind group of one geometry's `vertices` and `indices`, set per draw. The same group from frame to
|
|
45
|
+
* frame, for as long as the geometry's buffers keep their size.
|
|
46
|
+
* @type {number}
|
|
47
|
+
*/
|
|
48
|
+
export const DYNAMIC_MESH_BIND_GROUP_GEOMETRY: number;
|
|
49
|
+
/**
|
|
50
|
+
* The pipeline's resource set, for building bind groups: {@link DYNAMIC_MESH_BIND_GROUP_DRAWS} and
|
|
51
|
+
* {@link DYNAMIC_MESH_BIND_GROUP_GEOMETRY}, which every pipeline that draws a dynamic mesh opens its
|
|
52
|
+
* layout with.
|
|
37
53
|
*
|
|
38
54
|
* @type {ShaderResourceSetDescriptor}
|
|
39
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_dynamic_mesh.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/shader_dynamic_mesh.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_dynamic_mesh.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/shader_dynamic_mesh.js"],"names":[],"mappings":"AA8GA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAN4B,YAAY,GAA7B,MAAM;IACW,YAAY,GAA7B,MAAM;IACuB,aAAa;IACxB,MAAM,GAAxB,OAAO;IACL,wBAAwB,CAgCpC;AAvJD;;;;;;GAMG;AACH,oDAY6B;AAE7B;;;GAGG;AACH,4CAFU,MAAM,CAE+B;AAE/C;;;;GAIG;AACH,+CAFU,MAAM,CAEkC;AAyHlD;;;;;;GAMG;AACH,qCAFU,2BAA2B,CAEW;yCA1KP,8DAA8D;6BAO1E,gCAAgC;4CAJjB,mDAAmD"}
|
|
@@ -11,8 +11,11 @@ import { WebGPUStruct } from "../shader/type/WebGPUStruct.js";
|
|
|
11
11
|
import { chunk_dynamic_mesh_vertex } from "./chunk_dynamic_mesh_vertex.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Per-draw constants
|
|
15
|
-
*
|
|
14
|
+
* Per-draw constants: one row of a frame's table of them, which a draw finds at its
|
|
15
|
+
* `instance_index` — its `first_instance`, since each draw is one instance.
|
|
16
|
+
*
|
|
17
|
+
* Every row is written anew every frame. A dynamic mesh's transform and colour are its to change as
|
|
18
|
+
* often as its vertices, so nothing about them is assumed to carry over from one frame to the next.
|
|
16
19
|
*/
|
|
17
20
|
export const DYNAMIC_MESH_DRAW_STRUCT = WebGPUStruct.from({
|
|
18
21
|
/**
|
|
@@ -28,11 +31,26 @@ export const DYNAMIC_MESH_DRAW_STRUCT = WebGPUStruct.from({
|
|
|
28
31
|
color: vec4f,
|
|
29
32
|
}, "DynamicMeshDraw").pack();
|
|
30
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Bind group of the camera and one chunk of the frame's draw constants (`draws`), set once per chunk.
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
38
|
+
export const DYNAMIC_MESH_BIND_GROUP_DRAWS = 0;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Bind group of one geometry's `vertices` and `indices`, set per draw. The same group from frame to
|
|
42
|
+
* frame, for as long as the geometry's buffers keep their size.
|
|
43
|
+
* @type {number}
|
|
44
|
+
*/
|
|
45
|
+
export const DYNAMIC_MESH_BIND_GROUP_GEOMETRY = 1;
|
|
46
|
+
|
|
31
47
|
const resources = new ShaderResourceSetDescriptor();
|
|
32
48
|
|
|
33
49
|
resources.createGroup()
|
|
34
50
|
.addUniform("camera", CAMERA_UNIFORM_STRUCT)
|
|
35
|
-
.
|
|
51
|
+
.addStorageBuffer("draws", WebGPUArray.from(DYNAMIC_MESH_DRAW_STRUCT), false);
|
|
52
|
+
|
|
53
|
+
resources.createGroup()
|
|
36
54
|
.addStorageBuffer("vertices", WebGPUArray.f32, false)
|
|
37
55
|
.addStorageBuffer("indices", WebGPUArray.u32, false);
|
|
38
56
|
|
|
@@ -45,8 +63,8 @@ struct DynamicMeshVertexOut {
|
|
|
45
63
|
}
|
|
46
64
|
|
|
47
65
|
@vertex
|
|
48
|
-
fn vs_main(@builtin(vertex_index) vi : u32) -> DynamicMeshVertexOut {
|
|
49
|
-
let vertex = dynamic_mesh_vertex(vi);
|
|
66
|
+
fn vs_main(@builtin(vertex_index) vi : u32, @builtin(instance_index) draw_index : u32) -> DynamicMeshVertexOut {
|
|
67
|
+
let vertex = dynamic_mesh_vertex(vi, draw_index);
|
|
50
68
|
|
|
51
69
|
var out : DynamicMeshVertexOut;
|
|
52
70
|
|
|
@@ -146,7 +164,9 @@ export function create_dynamic_mesh_pipeline({
|
|
|
146
164
|
}
|
|
147
165
|
|
|
148
166
|
/**
|
|
149
|
-
* The pipeline's resource set, for building bind groups
|
|
167
|
+
* The pipeline's resource set, for building bind groups: {@link DYNAMIC_MESH_BIND_GROUP_DRAWS} and
|
|
168
|
+
* {@link DYNAMIC_MESH_BIND_GROUP_GEOMETRY}, which every pipeline that draws a dynamic mesh opens its
|
|
169
|
+
* layout with.
|
|
150
170
|
*
|
|
151
171
|
* @type {ShaderResourceSetDescriptor}
|
|
152
172
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bind group of everything the draw reads once per pass — the view, the warp, the integral and the
|
|
3
|
-
* fog.
|
|
3
|
+
* fog. Groups 0 and 1 are the dynamic-mesh groups: the draw constants per chunk, the geometry per
|
|
4
|
+
* mesh.
|
|
4
5
|
* @type {number}
|
|
5
6
|
*/
|
|
6
7
|
export const DYNAMIC_MESH_AVBOIT_DRAW_BIND_GROUP_PASS: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_dynamic_mesh_avboit_draw.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_dynamic_mesh_avboit_draw.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.js"],"names":[],"mappings":"AAuBA;;;;;GAKG;AACH,uDAFU,MAAM,CAE0C;AAyF1D;;;;GAIG;AACH,gDAFU,wBAAwB,CAc/B;AAEH,8EAA8E;AAC9E,6EAA4D;AAE5D,mDAAmD;AACnD,+DAA0D;yCA5IjB,8DAA8D;4CAU3D,mDAAmD;iCAC9D,+BAA+B"}
|
|
@@ -15,14 +15,19 @@ import { SAMPLER_LINEAR_UPSCALE } from "../texture/SAMPLER_LINEAR_UPSCALE.js";
|
|
|
15
15
|
import { VIEW_UNIFORM_STRUCT } from "../view/VIEW_UNIFORM_STRUCT.js";
|
|
16
16
|
import { VOLUMETRICS_METADATA_STRUCT } from "../volumetrics/VOLUMETRICS_METADATA_STRUCT.js";
|
|
17
17
|
import { chunk_dynamic_mesh_avboit_vertex } from "./chunk_dynamic_mesh_avboit_vertex.js";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
DYNAMIC_MESH_BIND_GROUP_DRAWS,
|
|
20
|
+
DYNAMIC_MESH_BIND_GROUP_GEOMETRY,
|
|
21
|
+
DYNAMIC_MESH_RESOURCES
|
|
22
|
+
} from "./shader_dynamic_mesh.js";
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
25
|
* Bind group of everything the draw reads once per pass — the view, the warp, the integral and the
|
|
22
|
-
* fog.
|
|
26
|
+
* fog. Groups 0 and 1 are the dynamic-mesh groups: the draw constants per chunk, the geometry per
|
|
27
|
+
* mesh.
|
|
23
28
|
* @type {number}
|
|
24
29
|
*/
|
|
25
|
-
export const DYNAMIC_MESH_AVBOIT_DRAW_BIND_GROUP_PASS =
|
|
30
|
+
export const DYNAMIC_MESH_AVBOIT_DRAW_BIND_GROUP_PASS = 2;
|
|
26
31
|
|
|
27
32
|
/**
|
|
28
33
|
* The dynamic meshes' AVBOIT draw: every mesh's triangles at internal resolution, depth-tested
|
|
@@ -42,7 +47,8 @@ export const DYNAMIC_MESH_AVBOIT_DRAW_BIND_GROUP_PASS = 1;
|
|
|
42
47
|
|
|
43
48
|
const resources = new ShaderResourceSetDescriptor();
|
|
44
49
|
|
|
45
|
-
resources.addGroup(DYNAMIC_MESH_RESOURCES.groups[
|
|
50
|
+
resources.addGroup(DYNAMIC_MESH_RESOURCES.groups[DYNAMIC_MESH_BIND_GROUP_DRAWS]);
|
|
51
|
+
resources.addGroup(DYNAMIC_MESH_RESOURCES.groups[DYNAMIC_MESH_BIND_GROUP_GEOMETRY]);
|
|
46
52
|
|
|
47
53
|
resources.createGroup()
|
|
48
54
|
.addUniform("view", VIEW_UNIFORM_STRUCT)
|
|
@@ -66,8 +72,8 @@ struct DynamicMeshAVBOITDrawOutput {
|
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
@vertex
|
|
69
|
-
fn vs_main(@builtin(vertex_index) vi : u32) -> DynamicMeshAVBOITVertexOut {
|
|
70
|
-
return dynamic_mesh_avboit_vertex(vi);
|
|
75
|
+
fn vs_main(@builtin(vertex_index) vi : u32, @builtin(instance_index) draw_index : u32) -> DynamicMeshAVBOITVertexOut {
|
|
76
|
+
return dynamic_mesh_avboit_vertex(vi, draw_index);
|
|
71
77
|
}
|
|
72
78
|
|
|
73
79
|
@fragment
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Bind group of the warp, set once per pass.
|
|
2
|
+
* Bind group of the warp, set once per pass. Groups 0 and 1 are the dynamic-mesh groups: the draw
|
|
3
|
+
* constants per chunk, the geometry per mesh.
|
|
3
4
|
* @type {number}
|
|
4
5
|
*/
|
|
5
6
|
export const DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_PASS: number;
|
|
6
7
|
/**
|
|
7
|
-
* Bind group of the volume atomics.
|
|
8
|
+
* Bind group of the volume atomics, set once per pass.
|
|
8
9
|
* @type {number}
|
|
9
10
|
*/
|
|
10
11
|
export const DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_VOLUME: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_dynamic_mesh_avboit_splat.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_dynamic_mesh_avboit_splat.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.js"],"names":[],"mappings":"AAsBA;;;;GAIG;AACH,wDAFU,MAAM,CAE2C;AAE3D;;;GAGG;AACH,0DAFU,MAAM,CAE6C;AAE7D;;;;GAIG;AACH,gDAFU,MAAM,CAEmC;AA0GnD;;;;;;GAMG;AACH,iDAFU,wBAAwB,CAa/B;AAEH,gFAAgF;AAChF,8EAA6D;AAE7D,mDAAmD;AACnD,gEAA2D;yCAzKlB,8DAA8D;4CAU3D,mDAAmD;iCAC9D,+BAA+B"}
|
|
@@ -14,19 +14,24 @@ import { ShaderDescriptor } from "../shader/ShaderDescriptor.js";
|
|
|
14
14
|
import { atomic_u32 } from "../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
15
15
|
import { WebGPUArray } from "../shader/type/WebGPUArray.js";
|
|
16
16
|
import { chunk_dynamic_mesh_avboit_vertex } from "./chunk_dynamic_mesh_avboit_vertex.js";
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
DYNAMIC_MESH_BIND_GROUP_DRAWS,
|
|
19
|
+
DYNAMIC_MESH_BIND_GROUP_GEOMETRY,
|
|
20
|
+
DYNAMIC_MESH_RESOURCES
|
|
21
|
+
} from "./shader_dynamic_mesh.js";
|
|
18
22
|
|
|
19
23
|
/**
|
|
20
|
-
* Bind group of the warp, set once per pass.
|
|
24
|
+
* Bind group of the warp, set once per pass. Groups 0 and 1 are the dynamic-mesh groups: the draw
|
|
25
|
+
* constants per chunk, the geometry per mesh.
|
|
21
26
|
* @type {number}
|
|
22
27
|
*/
|
|
23
|
-
export const DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_PASS =
|
|
28
|
+
export const DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_PASS = 2;
|
|
24
29
|
|
|
25
30
|
/**
|
|
26
|
-
* Bind group of the volume atomics.
|
|
31
|
+
* Bind group of the volume atomics, set once per pass.
|
|
27
32
|
* @type {number}
|
|
28
33
|
*/
|
|
29
|
-
export const DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_VOLUME =
|
|
34
|
+
export const DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_VOLUME = 3;
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
37
|
* Samples per pixel of the splat's raster, which is what a fragment's extinction is weighted by the
|
|
@@ -64,13 +69,15 @@ export const DYNAMIC_MESH_AVBOIT_SPLAT_SAMPLES = 4;
|
|
|
64
69
|
* reason the meshlet splat has none: a splat behind an opaque surface lies deeper than anything the
|
|
65
70
|
* draw will look it up for.
|
|
66
71
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
72
|
+
* Groups 0 and 1 are `DYNAMIC_MESH_RESOURCES`' own groups, the same objects, so their layouts are
|
|
73
|
+
* the ones every dynamic-mesh pipeline declares and a geometry's one group serves them all. The AVBOIT
|
|
74
|
+
* draw binds the same groups this splat does, and reads the same constants: one upload a frame.
|
|
69
75
|
*/
|
|
70
76
|
|
|
71
77
|
const resources = new ShaderResourceSetDescriptor();
|
|
72
78
|
|
|
73
|
-
resources.addGroup(DYNAMIC_MESH_RESOURCES.groups[
|
|
79
|
+
resources.addGroup(DYNAMIC_MESH_RESOURCES.groups[DYNAMIC_MESH_BIND_GROUP_DRAWS]);
|
|
80
|
+
resources.addGroup(DYNAMIC_MESH_RESOURCES.groups[DYNAMIC_MESH_BIND_GROUP_GEOMETRY]);
|
|
74
81
|
|
|
75
82
|
resources.createGroup()
|
|
76
83
|
.addStorageBuffer("warp", AVBOIT_WARP_STRUCT);
|
|
@@ -83,8 +90,8 @@ const body = CodeChunk.from(
|
|
|
83
90
|
//language=WGSL
|
|
84
91
|
`
|
|
85
92
|
@vertex
|
|
86
|
-
fn vs_main(@builtin(vertex_index) vi : u32) -> DynamicMeshAVBOITVertexOut {
|
|
87
|
-
return dynamic_mesh_avboit_vertex(vi);
|
|
93
|
+
fn vs_main(@builtin(vertex_index) vi : u32, @builtin(instance_index) draw_index : u32) -> DynamicMeshAVBOITVertexOut {
|
|
94
|
+
return dynamic_mesh_avboit_vertex(vi, draw_index);
|
|
88
95
|
}
|
|
89
96
|
|
|
90
97
|
@fragment
|
|
@@ -127,11 +134,12 @@ fn fs_main(in : DynamicMeshAVBOITVertexOut, @builtin(sample_mask) sample_mask :
|
|
|
127
134
|
const descriptor = ShaderDescriptor.from({ label: "Dynamic Mesh AVBOIT Splat", body, resources });
|
|
128
135
|
|
|
129
136
|
// Built group by group: the atomics are fragment-only, and WebGPU refuses a read-write storage
|
|
130
|
-
// buffer that is visible to the vertex stage. The dynamic-mesh
|
|
131
|
-
// the pass over the scene, so the
|
|
137
|
+
// buffer that is visible to the vertex stage. The dynamic-mesh groups keep the visibility they have
|
|
138
|
+
// in the pass over the scene, so the layouts agree and one geometry group serves every pipeline.
|
|
132
139
|
const groups = resources.groups;
|
|
133
140
|
const layout = PipelineLayoutDescriptor.from([
|
|
134
|
-
groups[
|
|
141
|
+
groups[DYNAMIC_MESH_BIND_GROUP_DRAWS].generateBindGroupLayoutDescriptor(GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT),
|
|
142
|
+
groups[DYNAMIC_MESH_BIND_GROUP_GEOMETRY].generateBindGroupLayoutDescriptor(GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT),
|
|
135
143
|
groups[DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_PASS].generateBindGroupLayoutDescriptor(GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT),
|
|
136
144
|
groups[DYNAMIC_MESH_AVBOIT_SPLAT_BIND_GROUP_VOLUME].generateBindGroupLayoutDescriptor(GPUShaderStage.FRAGMENT),
|
|
137
145
|
], resources.immediateSize);
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Needs meshoptimizer's WASM, which instantiates asynchronously at import. A build before it has
|
|
3
|
+
* fails inside the vendored module, on an instance that is not there yet, with a message about
|
|
4
|
+
* `exports` that names nothing the caller did — so await `MeshoptClusterizer.ready` before the
|
|
5
|
+
* first call.
|
|
6
|
+
*
|
|
2
7
|
* @param {RowFirstTable} result_metadata
|
|
3
8
|
* @param {BinaryBuffer} result_data
|
|
4
9
|
* @param {number[]} input_index Index array
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry_to_meshlets_meshoptimizer.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geometry_to_meshlets_meshoptimizer.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/geometry/meshlet/build/meshoptimizer/geometry_to_meshlets_meshoptimizer.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;GAcG;AACH,2HAPW,MAAM,EAAE,qBACR,MAAM,gBACN,MAAM,oBACN,YAAY,yBACZ,MAAM,2BACN,MAAM,QAmDhB"}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
+
import { assert } from "../../../../../../core/assert.js";
|
|
1
2
|
import { MeshoptClusterizer } from "./meshopt_clusterizer.js";
|
|
2
3
|
import { meshopt_optimizeMeshlet } from "./meshopt_optimizeMeshlet.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
6
|
+
* Whether meshoptimizer's WASM has landed. The vendored module instantiates it asynchronously at
|
|
7
|
+
* import and exposes only the promise, so this holds the promise's outcome for the assertion below.
|
|
8
|
+
*
|
|
9
|
+
* @type {boolean}
|
|
10
|
+
*/
|
|
11
|
+
let clusterizer_ready = false;
|
|
12
|
+
|
|
13
|
+
MeshoptClusterizer.ready?.then(() => {
|
|
14
|
+
clusterizer_ready = true;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Needs meshoptimizer's WASM, which instantiates asynchronously at import. A build before it has
|
|
19
|
+
* fails inside the vendored module, on an instance that is not there yet, with a message about
|
|
20
|
+
* `exports` that names nothing the caller did — so await `MeshoptClusterizer.ready` before the
|
|
21
|
+
* first call.
|
|
22
|
+
*
|
|
5
23
|
* @param {RowFirstTable} result_metadata
|
|
6
24
|
* @param {BinaryBuffer} result_data
|
|
7
25
|
* @param {number[]} input_index Index array
|
|
@@ -21,6 +39,7 @@ export function geometry_to_meshlets_meshoptimizer(
|
|
|
21
39
|
meshlet_vertex_limit = 64,
|
|
22
40
|
meshlet_triangle_limit = 64,
|
|
23
41
|
) {
|
|
42
|
+
assert.ok(clusterizer_ready, 'meshoptimizer is not ready; await MeshoptClusterizer.ready');
|
|
24
43
|
|
|
25
44
|
const meshlets = MeshoptClusterizer.buildMeshlets(input_index, vertex_positions, 3, meshlet_vertex_limit, meshlet_triangle_limit, 0.0);
|
|
26
45
|
|
|
@@ -13,7 +13,7 @@ export class TinyGltf {
|
|
|
13
13
|
* @readonly
|
|
14
14
|
* @type {TextureFormat}
|
|
15
15
|
*/
|
|
16
|
-
static readonly "__#
|
|
16
|
+
static readonly "__#252@#UNCOMPRESSED_TARGET": TextureFormat;
|
|
17
17
|
/**
|
|
18
18
|
* @param {AssetManager} assetManager
|
|
19
19
|
* @param {AssetRequestScope} [scope]
|
|
@@ -53,7 +53,7 @@ export class NSS {
|
|
|
53
53
|
* @returns {number}
|
|
54
54
|
*/
|
|
55
55
|
static recommended_jitter_sequence_size(upscale_ratio: number): number;
|
|
56
|
-
static "__#
|
|
56
|
+
static "__#186@#preprocess_tensor_descriptor"(render_w: any, render_h: any): TextureResourceDescriptor;
|
|
57
57
|
/**
|
|
58
58
|
* @param {GraphicsContext} graphics
|
|
59
59
|
*/
|
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
* and every pixel the alpha-tested pass did not cover keeping last frame's mesh and triangle ids for
|
|
10
10
|
* the deferred shading to resolve as real surfaces.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* The composers used this to hand the clear to the first alpha-tested draw, which left a scene with
|
|
13
|
+
* no draw of either kind uncleared. They no longer ask: the opaque loop knows whether it drew, and
|
|
14
|
+
* when it did not, `graph_clear_raster_targets` clears in its first draw's place.
|
|
13
15
|
*
|
|
14
16
|
* @param {Set<number>} active_buckets bucket ids any material in the scene asks for
|
|
15
17
|
* @returns {boolean}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rasterization_has_opaque_bucket.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/rasterize/bucket/rasterization_has_opaque_bucket.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"rasterization_has_opaque_bucket.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/rasterize/bucket/rasterization_has_opaque_bucket.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,gEANW,IAAI,MAAM,CAAC,GACT,OAAO,CAWnB"}
|
|
@@ -11,7 +11,9 @@ import { rasterization_opaque_buckets } from "./rasterization_opaque_buckets.js"
|
|
|
11
11
|
* and every pixel the alpha-tested pass did not cover keeping last frame's mesh and triangle ids for
|
|
12
12
|
* the deferred shading to resolve as real surfaces.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* The composers used this to hand the clear to the first alpha-tested draw, which left a scene with
|
|
15
|
+
* no draw of either kind uncleared. They no longer ask: the opaque loop knows whether it drew, and
|
|
16
|
+
* when it did not, `graph_clear_raster_targets` clears in its first draw's place.
|
|
15
17
|
*
|
|
16
18
|
* @param {Set<number>} active_buckets bucket ids any material in the scene asks for
|
|
17
19
|
* @returns {boolean}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_instances_rasterization_bucket_sort.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/rasterize/expand/bucket/mesh/shader_instances_rasterization_bucket_sort.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_instances_rasterization_bucket_sort.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/rasterize/expand/bucket/mesh/shader_instances_rasterization_bucket_sort.js"],"names":[],"mappings":"AAkBA,yEAGG;AA6GH,uEAIE;6BAnI2B,yCAAyC;8BAMxC,qCAAqC"}
|