@woosh/meep-engine 3.74.0 → 3.75.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/CHANGELOG.md +20 -19
- package/package.json +1 -1
- package/src/core/geom/2d/hilbert/v2_hilbert_encode.d.ts +11 -0
- package/src/core/geom/2d/hilbert/v2_hilbert_encode.d.ts.map +1 -0
- package/src/core/geom/2d/hilbert/v2_hilbert_encode.js +46 -0
- package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts +6 -0
- package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/FrameGraph.js +9 -0
- package/src/engine/graphics3/GPUAcousticSystem.d.ts +29 -32
- package/src/engine/graphics3/GPUAcousticSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUAcousticSystem.js +87 -162
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +35 -17
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/LiveEmitterSet.js +2 -3
- package/src/engine/sound/simulation/AcousticSimulator.d.ts +7 -0
- package/src/engine/sound/simulation/AcousticSimulator.d.ts.map +1 -1
- package/src/engine/sound/simulation/AcousticSimulator.js +27 -0
- package/src/engine/sound/simulation/README.md +121 -107
- package/src/engine/sound/sopra/README.md +8 -3
- package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts +2 -2
- package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.js +4 -3
- package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts +118 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.js +472 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts +166 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbLines.js +447 -0
- package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts +69 -113
- package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.js +143 -491
- package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts +102 -0
- package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/AcousticSpeakers.js +232 -0
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts +17 -3
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/BusGraph.js +55 -5
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts +8 -6
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/EventInstance.js +113 -105
- package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts +13 -0
- package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.js +15 -0
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +4 -6
- package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js +4 -5
- package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/main.js +6 -12
- package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
- package/src/shade/playground/skinned_mesh_soup/main.js +1 -2
- package/src/shade/playground/vgeo_scene/README.md +12 -2
- package/src/shade/playground/vgeo_scene/main.js +1 -1
- package/src/shade/playground/volumetrics_froxel/README.md +191 -191
- package/src/shade/playground/volumetrics_froxel/measure.d.ts +3 -3
- package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
- package/src/shade/playground/volumetrics_froxel/measure.js +11 -13
- package/src/shade/playground/vsm/main.d.ts.map +1 -1
- package/src/shade/playground/vsm/main.js +5 -6
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +31 -8
- package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts +28 -0
- package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.js +42 -0
- package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts +58 -0
- package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.js +108 -0
- package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +161 -0
- package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/GPUAcousticProbes.js +760 -0
- package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
- package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts +12 -0
- package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/acoustic_listener_order.js +56 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_direct.d.ts.map +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_direct.js +5 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts +57 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.js +314 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts +15 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_finite.js +21 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_gather.js +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts +27 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_lean.js +42 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts +80 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_listener.js +274 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_partials.d.ts +2 -2
- package/src/shade/renderer/acoustics/chunk_acoustic_partials.js +2 -2
- package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts +7 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts.map +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_phonon.js +24 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_resample.js +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_reservoir.js +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts +43 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_through.js +153 -0
- package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts +3 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts.map +1 -1
- package/src/shade/renderer/acoustics/chunk_acoustic_trace.js +10 -1
- package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts +7 -3
- package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts.map +1 -1
- package/src/shade/renderer/acoustics/shader_acoustic_combine.js +22 -6
- package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts +14 -0
- package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/shader_acoustic_coupling.js +102 -0
- package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts +12 -0
- package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/shader_acoustic_listener.js +80 -0
- package/src/shade/renderer/acoustics/shader_acoustic_receive.d.ts.map +1 -1
- package/src/shade/renderer/acoustics/shader_acoustic_receive.js +27 -6
- package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts +11 -0
- package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/shader_acoustic_room.js +111 -0
- package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts +18 -0
- package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts.map +1 -0
- package/src/shade/renderer/acoustics/shader_acoustic_source.js +130 -0
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
- package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.d.ts +2 -2
- package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.js +2 -2
- package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts +5 -2
- package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.js +5 -2
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts +9 -2
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +48 -12
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts +0 -22
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.js +0 -42
- package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts +2 -18
- package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.js +2 -19
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.js +0 -1
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts +5 -4
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +3 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.js +3 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.js +0 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts +60 -14
- package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.js +75 -39
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +0 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +45 -17
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +7 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +43 -7
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
|
@@ -13,6 +13,22 @@ import { MeshSDFBrickProvider } from "./mesh/MeshSDFBrickProvider.js";
|
|
|
13
13
|
* @typedef {import("./GPUBrickClipmap.js").BrickMaterialWriter} BrickMaterialWriter
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* What a frame's build is recorded with (`GPUBrickClipmap#graph_update`), kept rather than made: a class, so that a
|
|
18
|
+
* double stored in its anchor stays in place rather than boxed.
|
|
19
|
+
*/
|
|
20
|
+
class BrickBuildOptions {
|
|
21
|
+
graph = null;
|
|
22
|
+
x = 0.5;
|
|
23
|
+
y = 0.5;
|
|
24
|
+
z = 0.5;
|
|
25
|
+
budget = 1;
|
|
26
|
+
providers = null;
|
|
27
|
+
material_writers = null;
|
|
28
|
+
scene = null;
|
|
29
|
+
movers = -1;
|
|
30
|
+
}
|
|
31
|
+
|
|
16
32
|
/**
|
|
17
33
|
* The world as rays see it, a service of one scene (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §6, §7; GPU acoustics
|
|
18
34
|
* design, "What the tracer has to gain"): the {@link GPUBrickClipmap} around a view, the mesh provider that builds
|
|
@@ -67,6 +83,10 @@ export class GPUSceneBrickClipmap {
|
|
|
67
83
|
*/
|
|
68
84
|
#providers = [];
|
|
69
85
|
|
|
86
|
+
/** What a frame's bake and build are recorded with, kept rather than made. */
|
|
87
|
+
#bake_options = { graph: null, budget: 0, surface_budget: 0, materials: null };
|
|
88
|
+
#build_options = new BrickBuildOptions();
|
|
89
|
+
|
|
70
90
|
/**
|
|
71
91
|
* What the build writes after its store, in the order they were added.
|
|
72
92
|
* @type {BrickMaterialWriter[]}
|
|
@@ -266,12 +286,16 @@ export class GPUSceneBrickClipmap {
|
|
|
266
286
|
|
|
267
287
|
sdf.configure(settings.mesh_sdf_voxel_size, settings.mesh_sdf_max_bricks);
|
|
268
288
|
sdf.trim();
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
289
|
+
const bake = this.#bake_options;
|
|
290
|
+
|
|
291
|
+
bake.graph = graph;
|
|
292
|
+
bake.budget = settings.mesh_sdf_bake_budget;
|
|
293
|
+
bake.surface_budget = surfaces ? settings.surface_bake_budget : 0;
|
|
294
|
+
bake.materials = this.#graphics.materials_resident;
|
|
295
|
+
|
|
296
|
+
sdf.graph_bake(bake);
|
|
297
|
+
|
|
298
|
+
bake.graph = null;
|
|
275
299
|
|
|
276
300
|
// the surface caches the bake made resident, for this frame's readers
|
|
277
301
|
this.#holds.flush();
|
|
@@ -283,17 +307,21 @@ export class GPUSceneBrickClipmap {
|
|
|
283
307
|
|
|
284
308
|
const transform = view.camera.camera.transform;
|
|
285
309
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
310
|
+
const build = this.#build_options;
|
|
311
|
+
|
|
312
|
+
build.graph = graph;
|
|
313
|
+
build.x = transform[12];
|
|
314
|
+
build.y = transform[13];
|
|
315
|
+
build.z = transform[14];
|
|
316
|
+
build.budget = settings.brick_build_budget;
|
|
317
|
+
build.providers = this.#providers;
|
|
318
|
+
build.material_writers = this.#material_writers;
|
|
319
|
+
build.scene = this.#scene;
|
|
320
|
+
build.movers = movers;
|
|
321
|
+
|
|
322
|
+
this.#bricks = this.#clipmap.graph_update(build);
|
|
323
|
+
|
|
324
|
+
build.graph = null;
|
|
297
325
|
|
|
298
326
|
this.#graph = graph;
|
|
299
327
|
|
package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts
CHANGED
|
@@ -117,7 +117,8 @@ export const chunk_brick_clipmap_march: CodeChunk;
|
|
|
117
117
|
*
|
|
118
118
|
* A march that spends its steps is unresolved, at the `t` it reached: the probe rays discard it (§8.8),
|
|
119
119
|
* and a caller that resumes it marches on from there. One past `t_max`, or out of every window, is a
|
|
120
|
-
* miss
|
|
120
|
+
* miss; `unknown` on a miss says it left through a cell no cascade has built yet, which a caller that must
|
|
121
|
+
* not take unbuilt space for open air reads. `steps` in the hit is how many it took, so a caller that bounds several marches by one budget
|
|
121
122
|
* passes on what is left.
|
|
122
123
|
*
|
|
123
124
|
* @type {CodeChunk}
|
|
@@ -146,15 +147,18 @@ export const chunk_brick_clipmap_trace: CodeChunk;
|
|
|
146
147
|
*/
|
|
147
148
|
export const chunk_brick_clipmap_trace_through: CodeChunk;
|
|
148
149
|
/**
|
|
149
|
-
* The finest cascade's signed distance at a point (§7.9), for probe relocation
|
|
150
|
+
* The finest cascade's signed distance at a point (§7.9), for probe relocation; and with it the cell
|
|
151
|
+
* that answered.
|
|
150
152
|
*
|
|
151
153
|
* ```wgsl
|
|
152
154
|
* fn brick_clipmap_distance(position: vec3<f32>, cascade_count: u32, atlas_shift: u32) -> f32
|
|
155
|
+
* fn brick_clipmap_point(position: vec3<f32>, cascade_count: u32, atlas_shift: u32) -> BrickClipmapPoint
|
|
153
156
|
* ```
|
|
154
157
|
*
|
|
155
158
|
* The finest window holding the point answers, unless its cell is UNKNOWN, which defers to the
|
|
156
159
|
* parent. EMPTY reads R of its cascade, EMPTY inside -R: the surface is at least that far. A point no
|
|
157
|
-
* window holds, or that only UNKNOWN cells cover, reads R of the coarsest cascade.
|
|
160
|
+
* window holds, or that only UNKNOWN cells cover, reads R of the coarsest cascade, its entry UNKNOWN.
|
|
161
|
+
* The point's `entry` is the answering cell's (a slot, EMPTY or EMPTY inside) and `voxel` its cascade's.
|
|
158
162
|
*
|
|
159
163
|
* @type {CodeChunk}
|
|
160
164
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_brick_clipmap_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,gCAFU,MAAM,CAEoB;AAEpC;;;;GAIG;AACH,gCAFU,MAAM,CAEwB;AAExC;;;;GAIG;AACH,qCAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,yCAFU,wBAAwB,CAEoE;AAEtG;;;GAGG;AACH,+CAFU,wBAAwB,CAEgF;AAElH;;;GAGG;AACH,2CAFU,wBAAwB,CAEyE;AAE3G;;;GAGG;AACH,qCAFU,wBAAwB,CAEqF;AAEvH;;;GAGG;AACH,oCAFU,wBAAwB,CAEyE;AAE3G;;;;;;;;;;;;;;;;;;GAkBG;AACH,yCAFU,SAAS,CAyCZ;AAKP;;;;;;;;;;;;GAYG;AACH,yCAFU,SAAS,CAyBZ;AAIP;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wCAFU,SAAS,
|
|
1
|
+
{"version":3,"file":"chunk_brick_clipmap_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,gCAFU,MAAM,CAEoB;AAEpC;;;;GAIG;AACH,gCAFU,MAAM,CAEwB;AAExC;;;;GAIG;AACH,qCAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,yCAFU,wBAAwB,CAEoE;AAEtG;;;GAGG;AACH,+CAFU,wBAAwB,CAEgF;AAElH;;;GAGG;AACH,2CAFU,wBAAwB,CAEyE;AAE3G;;;GAGG;AACH,qCAFU,wBAAwB,CAEqF;AAEvH;;;GAGG;AACH,oCAFU,wBAAwB,CAEyE;AAE3G;;;;;;;;;;;;;;;;;;GAkBG;AACH,yCAFU,SAAS,CAyCZ;AAKP;;;;;;;;;;;;GAYG;AACH,yCAFU,SAAS,CAyBZ;AAIP;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wCAFU,SAAS,CAmFZ;AAKP;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wCAFU,SAAS,CAgHZ;AAEP;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,gDAFU,SAAS,CA6FZ;AAEP;;;;;;;;;;;;;;;GAeG;AACH,2CAFU,SAAS,CA4DZ;AAIP;;;;;;;;;;;;;;GAcG;AACH,2CAFU,SAAS,CA0BZ;yCAjoBkC,sDAAsD;0BADrE,uCAAuC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js
CHANGED
|
@@ -215,6 +215,8 @@ struct BrickClipmapMarch {
|
|
|
215
215
|
voxel: f32,
|
|
216
216
|
/** where the march stands */
|
|
217
217
|
position: vec3<f32>,
|
|
218
|
+
/** it left every window through a cell no cascade has built yet, not through open air */
|
|
219
|
+
unknown: bool,
|
|
218
220
|
}
|
|
219
221
|
|
|
220
222
|
fn brick_clipmap_march(origin: vec3<f32>, direction: vec3<f32>, cascade_count: u32, march: ptr<function, BrickClipmapMarch>) -> u32 {
|
|
@@ -249,6 +251,7 @@ fn brick_clipmap_march(origin: vec3<f32>, direction: vec3<f32>, cascade_count: u
|
|
|
249
251
|
|
|
250
252
|
if (entry == BRICK_CLIPMAP_UNKNOWN) {
|
|
251
253
|
(*march).cascade++;
|
|
254
|
+
(*march).unknown = (*march).cascade >= cascade_count;
|
|
252
255
|
|
|
253
256
|
return select(BRICK_MARCH_MOVED, BRICK_MARCH_LEFT, (*march).cascade >= cascade_count);
|
|
254
257
|
}
|
|
@@ -296,7 +299,8 @@ chunk_brick_clipmap_march.requireResource(BRICK_OCCUPANCY_TEXTURE_RESOURCE);
|
|
|
296
299
|
*
|
|
297
300
|
* A march that spends its steps is unresolved, at the `t` it reached: the probe rays discard it (§8.8),
|
|
298
301
|
* and a caller that resumes it marches on from there. One past `t_max`, or out of every window, is a
|
|
299
|
-
* miss
|
|
302
|
+
* miss; `unknown` on a miss says it left through a cell no cascade has built yet, which a caller that must
|
|
303
|
+
* not take unbuilt space for open air reads. `steps` in the hit is how many it took, so a caller that bounds several marches by one budget
|
|
300
304
|
* passes on what is left.
|
|
301
305
|
*
|
|
302
306
|
* @type {CodeChunk}
|
|
@@ -325,6 +329,8 @@ struct BrickClipmapHit {
|
|
|
325
329
|
cell_min: vec3<f32>,
|
|
326
330
|
/** steps the march took */
|
|
327
331
|
steps: u32,
|
|
332
|
+
/** a miss that left through space no cascade has built yet: what lies there is not known */
|
|
333
|
+
unknown: bool,
|
|
328
334
|
}
|
|
329
335
|
|
|
330
336
|
fn brick_clipmap_trace(origin: vec3<f32>, direction: vec3<f32>, t_min: f32, t_max: f32, cascade_count: u32, atlas_shift: u32) -> BrickClipmapHit {
|
|
@@ -357,6 +363,8 @@ fn brick_clipmap_trace_steps(origin: vec3<f32>, direction: vec3<f32>, t_min: f32
|
|
|
357
363
|
let stood = brick_clipmap_march(origin, direction, cascade_count, &march);
|
|
358
364
|
|
|
359
365
|
if (stood == BRICK_MARCH_LEFT) {
|
|
366
|
+
hit.unknown = march.unknown;
|
|
367
|
+
|
|
360
368
|
return hit;
|
|
361
369
|
}
|
|
362
370
|
|
|
@@ -440,6 +448,8 @@ struct BrickClipmapExit {
|
|
|
440
448
|
t: f32,
|
|
441
449
|
/** steps the march took */
|
|
442
450
|
steps: u32,
|
|
451
|
+
/** a miss that left through space no cascade has built yet */
|
|
452
|
+
unknown: bool,
|
|
443
453
|
}
|
|
444
454
|
|
|
445
455
|
fn brick_clipmap_trace_through(origin: vec3<f32>, direction: vec3<f32>, t_min: f32, t_max: f32, cascade_count: u32, atlas_shift: u32, steps: u32) -> BrickClipmapExit {
|
|
@@ -471,6 +481,7 @@ fn brick_clipmap_trace_through(origin: vec3<f32>, direction: vec3<f32>, t_min: f
|
|
|
471
481
|
|
|
472
482
|
if (stood == BRICK_MARCH_LEFT) {
|
|
473
483
|
exit.t = before;
|
|
484
|
+
exit.unknown = march.unknown;
|
|
474
485
|
|
|
475
486
|
return exit;
|
|
476
487
|
}
|
|
@@ -521,23 +532,33 @@ fn brick_clipmap_trace_through(origin: vec3<f32>, direction: vec3<f32>, t_min: f
|
|
|
521
532
|
]);
|
|
522
533
|
|
|
523
534
|
/**
|
|
524
|
-
* The finest cascade's signed distance at a point (§7.9), for probe relocation
|
|
535
|
+
* The finest cascade's signed distance at a point (§7.9), for probe relocation; and with it the cell
|
|
536
|
+
* that answered.
|
|
525
537
|
*
|
|
526
538
|
* ```wgsl
|
|
527
539
|
* fn brick_clipmap_distance(position: vec3<f32>, cascade_count: u32, atlas_shift: u32) -> f32
|
|
540
|
+
* fn brick_clipmap_point(position: vec3<f32>, cascade_count: u32, atlas_shift: u32) -> BrickClipmapPoint
|
|
528
541
|
* ```
|
|
529
542
|
*
|
|
530
543
|
* The finest window holding the point answers, unless its cell is UNKNOWN, which defers to the
|
|
531
544
|
* parent. EMPTY reads R of its cascade, EMPTY inside -R: the surface is at least that far. A point no
|
|
532
|
-
* window holds, or that only UNKNOWN cells cover, reads R of the coarsest cascade.
|
|
545
|
+
* window holds, or that only UNKNOWN cells cover, reads R of the coarsest cascade, its entry UNKNOWN.
|
|
546
|
+
* The point's `entry` is the answering cell's (a slot, EMPTY or EMPTY inside) and `voxel` its cascade's.
|
|
533
547
|
*
|
|
534
548
|
* @type {CodeChunk}
|
|
535
549
|
*/
|
|
536
550
|
export const chunk_brick_clipmap_distance = CodeChunk.from(
|
|
537
551
|
//language=WGSL
|
|
538
552
|
`
|
|
539
|
-
|
|
553
|
+
struct BrickClipmapPoint {
|
|
554
|
+
distance: f32,
|
|
555
|
+
entry: u32,
|
|
556
|
+
voxel: f32,
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
fn brick_clipmap_point(position: vec3<f32>, cascade_count: u32, atlas_shift: u32) -> BrickClipmapPoint {
|
|
540
560
|
let count = min(cascade_count, ${CLIPMAP_LEVEL_LIMIT}u);
|
|
561
|
+
var point: BrickClipmapPoint;
|
|
541
562
|
|
|
542
563
|
for (var c = 0u; c < count; c++) {
|
|
543
564
|
let level = brick_levels[c];
|
|
@@ -556,14 +577,29 @@ fn brick_clipmap_distance(position: vec3<f32>, cascade_count: u32, atlas_shift:
|
|
|
556
577
|
continue;
|
|
557
578
|
}
|
|
558
579
|
|
|
580
|
+
point.entry = entry;
|
|
581
|
+
point.voxel = voxel;
|
|
582
|
+
|
|
559
583
|
if (!brick_clipmap_entry_holds_slot(entry)) {
|
|
560
|
-
|
|
584
|
+
point.distance = select(1.0, -1.0, entry == BRICK_CLIPMAP_EMPTY_INSIDE) * BRICK_CLIPMAP_BAND_VOXELS * voxel;
|
|
585
|
+
|
|
586
|
+
return point;
|
|
561
587
|
}
|
|
562
588
|
|
|
563
|
-
|
|
589
|
+
point.distance = brick_clipmap_sample(entry, (position - vec3<f32>(cell) * level.cell_size) / voxel, voxel, atlas_shift);
|
|
590
|
+
|
|
591
|
+
return point;
|
|
564
592
|
}
|
|
565
593
|
|
|
566
|
-
|
|
594
|
+
point.voxel = brick_levels[max(count, 1u) - 1u].cell_size / ${MESH_SDF_BRICK_VOXELS}.0;
|
|
595
|
+
point.distance = BRICK_CLIPMAP_BAND_VOXELS * point.voxel;
|
|
596
|
+
point.entry = BRICK_CLIPMAP_UNKNOWN;
|
|
597
|
+
|
|
598
|
+
return point;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
fn brick_clipmap_distance(position: vec3<f32>, cascade_count: u32, atlas_shift: u32) -> f32 {
|
|
602
|
+
return brick_clipmap_point(position, cascade_count, atlas_shift).distance;
|
|
567
603
|
}
|
|
568
604
|
`, [
|
|
569
605
|
chunk_brick_clipmap,
|
|
@@ -13,7 +13,7 @@ export class TinyGltf {
|
|
|
13
13
|
* @readonly
|
|
14
14
|
* @type {TextureFormat}
|
|
15
15
|
*/
|
|
16
|
-
static readonly "__#
|
|
16
|
+
static readonly "__#318@#UNCOMPRESSED_TARGET": TextureFormat;
|
|
17
17
|
/**
|
|
18
18
|
* @param {AssetManager} assetManager
|
|
19
19
|
* @param {AssetRequestScope} [scope]
|
|
@@ -24,7 +24,7 @@ export class GPUWaterQueries {
|
|
|
24
24
|
* @param {PipelineEnquiry} enquiry
|
|
25
25
|
*/
|
|
26
26
|
static enquirePipelines(enquiry: PipelineEnquiry): void;
|
|
27
|
-
static "__#
|
|
27
|
+
static "__#291@#execute"(pass: any, resources: any, context: any): void;
|
|
28
28
|
/**
|
|
29
29
|
* @param {object} options
|
|
30
30
|
* @param {GPUDevice} options.device
|