@woosh/meep-engine 3.60.5 → 3.60.6
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 +19 -0
- package/package.json +1 -1
- package/src/shade/renderer/Renderer.d.ts +11 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +43 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +26 -43
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +109 -117
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts +20 -2
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/cards/GPUMeshCardSets.js +66 -2
- package/src/shade/renderer/geometry/virtual/proxy/vgeo_proxy_triangle_limit.d.ts +19 -0
- package/src/shade/renderer/geometry/virtual/proxy/vgeo_proxy_triangle_limit.d.ts.map +1 -0
- package/src/shade/renderer/geometry/virtual/proxy/vgeo_proxy_triangle_limit.js +25 -0
- package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts +15 -0
- package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/VirtualGeometry.js +38 -0
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts +28 -59
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.d.ts.map +1 -1
- package/src/shade/renderer/geometry/virtual/sdf/VGeoSDFProxies.js +84 -789
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSceneHolds.js +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.d.ts +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_instance.js +2 -2
- package/src/shade/renderer/material/GPUMaterialManager.d.ts +4 -1
- package/src/shade/renderer/material/GPUMaterialManager.d.ts.map +1 -1
- package/src/shade/renderer/material/GPUMaterialManager.js +5 -8
- package/src/shade/renderer/postprocess/gtao/GTAO.d.ts +7 -3
- package/src/shade/renderer/postprocess/gtao/GTAO.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/GTAO.js +26 -13
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts +14 -0
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.js +196 -68
- package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao.js +42 -28
- package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/fragment_shader_gtao_with_irradiance.js +429 -414
- package/src/shade/renderer/postprocess/gtao/shader_gtao_spatial_denoise.d.ts +16 -0
- package/src/shade/renderer/postprocess/gtao/shader_gtao_spatial_denoise.d.ts.map +1 -0
- package/src/shade/renderer/postprocess/gtao/shader_gtao_spatial_denoise.js +156 -0
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +2 -2
- package/src/shade/renderer/scene/GPUSceneContext.js +5 -5
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts +0 -47
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.d.ts.map +0 -1
- package/src/shade/renderer/geometry/virtual/sdf/VGEO_SDF.js +0 -80
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts +0 -16
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.d.ts.map +0 -1
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_collect.js +0 -67
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts +0 -17
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.d.ts.map +0 -1
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_decode.js +0 -145
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts +0 -12
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.d.ts.map +0 -1
- package/src/shade/renderer/geometry/virtual/sdf/shader_vgeo_sdf_traverse.js +0 -105
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Probe clipmap GI: virtual geometry has cards, through a proxy
|
|
6
|
+
|
|
7
|
+
- **Added:** `VirtualGeometry.get_proxy()`: an ordinary geometry standing in for a virtual one, cut from its
|
|
8
|
+
container (`vgeo_to_proxy_mesh`) at `vgeo_proxy_triangle_limit(source_triangles)`, clamp(1%, 128, 64,000), through
|
|
9
|
+
a reader of its own. A container is expected to be delivered with its proxy, baked offline; until then the proxy is
|
|
10
|
+
cut at load.
|
|
11
|
+
- **Changed:** a virtual geometry's geometry cache and cards are its proxy's. The GI's rays now see virtual geometry's
|
|
12
|
+
materials instead of black: on Zorah, cards serve 82% of front-face hits (none before) and the frame's mean luma
|
|
13
|
+
goes 50.83 → 58.14. The proxy's detail is its own, so the field and the cards are coarser than the asset. Zorah's
|
|
14
|
+
1,012 proxies are 3.18M triangles and take the geometry manager's device memory from 406 MB to 743–780 MB.
|
|
15
|
+
- **Changed:** `GPUGeometrySDFManager.alias(clone, source)` moves the clone's holders to the source and sends
|
|
16
|
+
`onBaked` with the clone when the source's cache turns resident; card sets of an aliased geometry capture its
|
|
17
|
+
source's layout (`GPUMeshCardSets.alias` / `unalias`). New `GPUGeometrySDFManager.onForgotten`.
|
|
18
|
+
- **Breaking:** `GPUGeometrySDFManager.adopt`, `add_source`, `remove_source` and the `MeshSDFSource` typedef are
|
|
19
|
+
gone, as are the GPU extraction (`shader_vgeo_sdf_collect`, `shader_vgeo_sdf_traverse`, `shader_vgeo_sdf_decode`,
|
|
20
|
+
`VGEO_SDF.js`). `VGeoSDFProxies` takes `{ geometries }` alone; its `cut`, `job_count`, `requested_count`,
|
|
21
|
+
`extracted_count`, `adopted_count`, `triangles_extracted` and `cluster_capacity` are replaced by `pending_count`,
|
|
22
|
+
`applied_count`, `failed_count` and `proxy_of(record)`.
|
|
23
|
+
|
|
5
24
|
### Virtual geometry: proxy meshes, offline
|
|
6
25
|
|
|
7
26
|
- **Added:** `vgeo_to_proxy_mesh(reader, triangle_limit)` (`geometry/virtual/proxy/`) turns an open
|
package/package.json
CHANGED
|
@@ -303,6 +303,17 @@ export class Renderer {
|
|
|
303
303
|
* @returns {GPUTextureContext}
|
|
304
304
|
*/
|
|
305
305
|
get texture_depth_previous(): GPUTextureContext;
|
|
306
|
+
/**
|
|
307
|
+
*
|
|
308
|
+
* @returns {GPUTextureContext}
|
|
309
|
+
*/
|
|
310
|
+
get texture_normal_current(): GPUTextureContext;
|
|
311
|
+
/**
|
|
312
|
+
* At the size last frame was drawn at, as {@link texture_depth_previous} is.
|
|
313
|
+
*
|
|
314
|
+
* @returns {GPUTextureContext}
|
|
315
|
+
*/
|
|
316
|
+
get texture_normal_previous(): GPUTextureContext;
|
|
306
317
|
/**
|
|
307
318
|
*
|
|
308
319
|
* @param {number} ratio
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["../../../../src/shade/renderer/Renderer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Renderer.d.ts","sourceRoot":"","sources":["../../../../src/shade/renderer/Renderer.js"],"names":[],"mappings":"AAyJA;IAOI,0BAEC;IAED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"}
|
|
@@ -39,6 +39,7 @@ import { PresentTarget } from "./extension/PresentTarget.js";
|
|
|
39
39
|
import { RenderExtensionRegistry } from "./extension/RenderExtensionRegistry.js";
|
|
40
40
|
import { SceneColor } from "./extension/SceneColor.js";
|
|
41
41
|
import { ViewTextures } from "./extension/ViewTextures.js";
|
|
42
|
+
import { G_BUFFER_COLOR_TARGETS } from "./gbuffer/G_BUFFER_COLOR_TARGETS.js";
|
|
42
43
|
import { G_BUFFER_MIP_LEVELS } from "./gbuffer/G_BUFFER_MIP_LEVELS.js";
|
|
43
44
|
import { shader_brick4_diffuse } from "./global_illumination/brick4/gpu/draw/shader_brick4_diffuse.js";
|
|
44
45
|
import {
|
|
@@ -856,6 +857,34 @@ export class Renderer {
|
|
|
856
857
|
*/
|
|
857
858
|
#textures_taa_history = new Array(2);
|
|
858
859
|
|
|
860
|
+
/**
|
|
861
|
+
* The G-buffer normal, ping-ponged as depth is: reprojection asks which surface a history texel was
|
|
862
|
+
* written on, and only last frame's normal says.
|
|
863
|
+
* @type {GPUTextureContext[]}
|
|
864
|
+
*/
|
|
865
|
+
#textures_normal = new Array(2);
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
*
|
|
869
|
+
* @returns {GPUTextureContext}
|
|
870
|
+
*/
|
|
871
|
+
get texture_normal_current() {
|
|
872
|
+
const tx = this.#textures_normal;
|
|
873
|
+
|
|
874
|
+
return tx[this.#frame_count % tx.length];
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* At the size last frame was drawn at, as {@link texture_depth_previous} is.
|
|
879
|
+
*
|
|
880
|
+
* @returns {GPUTextureContext}
|
|
881
|
+
*/
|
|
882
|
+
get texture_normal_previous() {
|
|
883
|
+
const tx = this.#textures_normal;
|
|
884
|
+
|
|
885
|
+
return tx[(this.#frame_count - 1 + tx.length) % tx.length];
|
|
886
|
+
}
|
|
887
|
+
|
|
859
888
|
/**
|
|
860
889
|
*
|
|
861
890
|
* @returns {GPUTextureContext}
|
|
@@ -1820,6 +1849,14 @@ export class Renderer {
|
|
|
1820
1849
|
mipLevelCount: G_BUFFER_MIP_LEVELS,
|
|
1821
1850
|
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_SRC,
|
|
1822
1851
|
}));
|
|
1852
|
+
|
|
1853
|
+
this.#textures_normal[i] = graphics.textures.contextFromDescriptor(TextureDescriptor.from({
|
|
1854
|
+
label: `Normal ${i}`,
|
|
1855
|
+
size: resolution_internal,
|
|
1856
|
+
format: G_BUFFER_COLOR_TARGETS[1].format,
|
|
1857
|
+
mipLevelCount: 1,
|
|
1858
|
+
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING,
|
|
1859
|
+
}));
|
|
1823
1860
|
}
|
|
1824
1861
|
|
|
1825
1862
|
|
|
@@ -2063,6 +2100,7 @@ export class Renderer {
|
|
|
2063
2100
|
#destroy_render_targets() {
|
|
2064
2101
|
const targets = [
|
|
2065
2102
|
...this.#textures_depth,
|
|
2103
|
+
...this.#textures_normal,
|
|
2066
2104
|
...this.#textures_taa_history,
|
|
2067
2105
|
...(this.#vis_render_target?.color_attachments ?? []),
|
|
2068
2106
|
];
|
|
@@ -2072,6 +2110,7 @@ export class Renderer {
|
|
|
2072
2110
|
}
|
|
2073
2111
|
|
|
2074
2112
|
this.#textures_depth.fill(undefined);
|
|
2113
|
+
this.#textures_normal.fill(undefined);
|
|
2075
2114
|
this.#textures_taa_history.fill(undefined);
|
|
2076
2115
|
|
|
2077
2116
|
this.#vis_render_target = undefined;
|
|
@@ -2311,9 +2350,10 @@ export class Renderer {
|
|
|
2311
2350
|
}
|
|
2312
2351
|
|
|
2313
2352
|
// cycle depth attachment, then size the target this frame draws into. Previous depth is not
|
|
2314
|
-
// attached, so it keeps the size it was drawn at.
|
|
2353
|
+
// attached, so it keeps the size it was drawn at. The normal cycles with it, the same way.
|
|
2315
2354
|
this.#vis_render_target.depth_attachment = this.texture_depth_current;
|
|
2316
2355
|
this.#vis_render_target.resize(this.#internal_resolution.x, this.#internal_resolution.y);
|
|
2356
|
+
this.texture_normal_current.resize(this.#internal_resolution.x, this.#internal_resolution.y);
|
|
2317
2357
|
this.#postprocess.update(this.#frame_count);
|
|
2318
2358
|
|
|
2319
2359
|
// Advance whichever upscaler we're going to ask for jitter on this
|
|
@@ -2749,6 +2789,7 @@ export class Renderer {
|
|
|
2749
2789
|
view: view_ctx,
|
|
2750
2790
|
texture_viz_mesh: gr_viz_buffer_mesh,
|
|
2751
2791
|
texture_viz_triangle: gr_viz_buffer_triangle,
|
|
2792
|
+
texture_normal: graph_import_texture(graph, this.texture_normal_current, "normal"),
|
|
2752
2793
|
});
|
|
2753
2794
|
|
|
2754
2795
|
// update texture references
|
|
@@ -3035,6 +3076,7 @@ export class Renderer {
|
|
|
3035
3076
|
input_depth: gr_texture_depth_current,
|
|
3036
3077
|
input_velocity: gr_velocity,
|
|
3037
3078
|
input_normal: gr_texture_normal,
|
|
3079
|
+
input_normal_previous: graph_import_texture(graph, this.texture_normal_previous, "normal previous"),
|
|
3038
3080
|
input_occlusion: gr_occlusion_clip,
|
|
3039
3081
|
input_hzb: gr_texture_hzb,
|
|
3040
3082
|
// NOTE: AO is blended into the G-buffer
|
|
@@ -14,7 +14,8 @@ export const MESH_SDF_BAKE_BUDGET_MAX: number;
|
|
|
14
14
|
* queues a bake; the last one going leaves the cache in place until {@link trim}, which only a user of
|
|
15
15
|
* the caches calls, so a cache outlives a mode that stops using it and is there when the mode comes
|
|
16
16
|
* back (D28). {@link forget} drops a geometry the geometry manager has let go of, whatever holds it.
|
|
17
|
-
* {@link alias} points a
|
|
17
|
+
* {@link alias} points a geometry's id at another's cache, which readers follow, and whose holders and card sets
|
|
18
|
+
* the aliased geometry's become: a skinned clone's at its source's, a virtual geometry's at its proxy's.
|
|
18
19
|
*
|
|
19
20
|
* **Side.** A holder says whether it draws both sides of the geometry. A field is baked two-sided
|
|
20
21
|
* while any of its holders does: its vote then counts no back face, so nothing is inside it.
|
|
@@ -36,11 +37,11 @@ export const MESH_SDF_BAKE_BUDGET_MAX: number;
|
|
|
36
37
|
* {@link cards}, whose card sets — one per (geometry, material) pair — are captured after the bake,
|
|
37
38
|
* `capture_budget` pages a frame.
|
|
38
39
|
*
|
|
39
|
-
* **
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* geometry
|
|
40
|
+
* **A geometry with no tree of its own** to bake from, a virtual geometry's, waits queued, as one whose
|
|
41
|
+
* tree is not resident yet does, until it is pointed at a stand-in ({@link alias}): an ordinary geometry
|
|
42
|
+
* in the same local space, baked, placed and captured here as any is. Whoever makes stand-ins hears of
|
|
43
|
+
* each geometry queued ({@link onRequested}) and let go ({@link onForgotten}), and aliases between
|
|
44
|
+
* frames, its stand-in added to the geometry manager as any geometry is.
|
|
44
45
|
*
|
|
45
46
|
* **Readers** bind {@link headers}, {@link indirection}, {@link texture} and {@link MESH_SDF_SAMPLER}
|
|
46
47
|
* (see {@link write_bindings}) and sample through `mesh_sdf_sample`, which only a resident header
|
|
@@ -55,15 +56,23 @@ export class GPUGeometrySDFManager {
|
|
|
55
56
|
*/
|
|
56
57
|
constructor(device: GPUDevice, geometries: GPUGeometryManager);
|
|
57
58
|
/**
|
|
58
|
-
* Sent with a geometry id when its cache turns resident, on the frame its completion is read back
|
|
59
|
+
* Sent with a geometry id when its cache turns resident, on the frame its completion is read back, and with each
|
|
60
|
+
* geometry aliased to it, whose readers read that cache: also when the alias is made to a cache resident already.
|
|
59
61
|
* @type {Signal<number>}
|
|
60
62
|
*/
|
|
61
63
|
onBaked: any;
|
|
62
64
|
/**
|
|
63
|
-
* Sent with a geometry's record each time its cache is queued for a bake: what a
|
|
65
|
+
* Sent with a geometry's record each time its cache is queued for a bake: what a maker of stand-ins
|
|
66
|
+
* listens to.
|
|
64
67
|
* @type {Signal<GPUGeometryMetadata>}
|
|
65
68
|
*/
|
|
66
69
|
onRequested: any;
|
|
70
|
+
/**
|
|
71
|
+
* Sent with a geometry's record when {@link forget} lets it go: what a maker of stand-ins that made one for it
|
|
72
|
+
* listens to.
|
|
73
|
+
* @type {Signal<GPUGeometryMetadata>}
|
|
74
|
+
*/
|
|
75
|
+
onForgotten: any;
|
|
67
76
|
/**
|
|
68
77
|
* The card sets: one capture of a geometry's layout per (geometry, material) pair, which their
|
|
69
78
|
* user acquires and releases. Layouts reach it as they are placed.
|
|
@@ -87,14 +96,14 @@ export class GPUGeometrySDFManager {
|
|
|
87
96
|
*/
|
|
88
97
|
get max_bricks(): number;
|
|
89
98
|
/**
|
|
90
|
-
* One more holder of a geometry's cache; the first queues its bake.
|
|
99
|
+
* One more holder of a geometry's cache; the first queues its bake. A holder of an alias holds its source.
|
|
91
100
|
*
|
|
92
101
|
* @param {GPUGeometryMetadata} record
|
|
93
102
|
* @param {boolean} two_sided whether the holder draws both sides of the geometry
|
|
94
103
|
*/
|
|
95
104
|
acquire(record: GPUGeometryMetadata, two_sided: boolean): void;
|
|
96
105
|
/**
|
|
97
|
-
* One holder fewer. The cache stays until {@link trim}.
|
|
106
|
+
* One holder fewer. The cache stays until {@link trim}. A holder of an alias holds its source.
|
|
98
107
|
*
|
|
99
108
|
* @param {GPUGeometryMetadata} record
|
|
100
109
|
* @param {boolean} two_sided as the holder acquired it
|
|
@@ -113,7 +122,13 @@ export class GPUGeometrySDFManager {
|
|
|
113
122
|
forget(record: GPUGeometryMetadata): void;
|
|
114
123
|
/**
|
|
115
124
|
* Readers of `clone` read `source`'s cache: the hook for a skinned clone, whose unskinned shape is
|
|
116
|
-
* its source's (§6.3)
|
|
125
|
+
* its source's (§6.3), and for a virtual geometry, whose proxy is its stand-in (§17). Written once; it
|
|
126
|
+
* follows the source through its bake.
|
|
127
|
+
*
|
|
128
|
+
* Whatever held `clone`'s own cache holds `source`'s from here on, its side included, as does every holder of
|
|
129
|
+
* `clone` after; and `clone`'s card sets capture `source`'s layout through `source`'s meshlets
|
|
130
|
+
* ({@link GPUMeshCardSets#alias}). So a source whose stand-in arrives after `clone` was asked for needs
|
|
131
|
+
* nothing moved by its holders.
|
|
117
132
|
*
|
|
118
133
|
* @param {GPUGeometryMetadata} clone
|
|
119
134
|
* @param {GPUGeometryMetadata} source
|
|
@@ -141,27 +156,6 @@ export class GPUGeometrySDFManager {
|
|
|
141
156
|
* @returns {boolean}
|
|
142
157
|
*/
|
|
143
158
|
holds_two_sided(record: GPUGeometryMetadata): boolean;
|
|
144
|
-
/**
|
|
145
|
-
* @param {MeshSDFSource} source run first in each {@link graph_bake} from here on
|
|
146
|
-
*/
|
|
147
|
-
add_source(source: MeshSDFSource): void;
|
|
148
|
-
/**
|
|
149
|
-
* @param {MeshSDFSource} source
|
|
150
|
-
*/
|
|
151
|
-
remove_source(source: MeshSDFSource): void;
|
|
152
|
-
/**
|
|
153
|
-
* Give `target` the resident cache baked for `proxy`: a source's hand-in, for a geometry with no tree of its own,
|
|
154
|
-
* of a proxy in the same local space baked as any geometry is. Nothing is copied. The target's header takes the
|
|
155
|
-
* proxy's layout, entries and side, and the proxy's reads None, as dropped; {@link onBaked} is sent with the
|
|
156
|
-
* target. The cache has no cards, the target having no tree to capture them with. Held for another side than the
|
|
157
|
-
* proxy was baked for, it is queued again at the next bake, as any cache is.
|
|
158
|
-
*
|
|
159
|
-
* @param {GPUGeometryMetadata} target waiting for its bake ({@link is_requested})
|
|
160
|
-
* @param {GPUGeometryMetadata} proxy whose cache is resident
|
|
161
|
-
* @returns {boolean} whether it was adopted: false, changing nothing, when `target` no longer waits or `proxy`'s
|
|
162
|
-
* cache is not resident
|
|
163
|
-
*/
|
|
164
|
-
adopt(target: GPUGeometryMetadata, proxy: GPUGeometryMetadata): boolean;
|
|
165
159
|
/**
|
|
166
160
|
* Geometries whose layout was coarsened by the cap, of those baked: coarser than asked.
|
|
167
161
|
* @returns {number}
|
|
@@ -265,17 +259,6 @@ export type GPUGeometryManager = import("../GPUGeometryManager.js").GPUGeometryM
|
|
|
265
259
|
export type GPUGeometryMetadata = import("../GPUGeometryMetadata.js").GPUGeometryMetadata;
|
|
266
260
|
export type GPUResidentMaterialContext = import("../../material/resident/GPUResidentMaterialContext.js").GPUResidentMaterialContext;
|
|
267
261
|
export type GPUMaterialManager = import("../../material/GPUMaterialManager.js").GPUMaterialManager;
|
|
268
|
-
/**
|
|
269
|
-
* What makes caches for geometries the bake cannot bake from a tree of their own
|
|
270
|
-
* ({@link GPUGeometrySDFManageradd_source }): it learns what is asked for from `onRequested`, records its own work in
|
|
271
|
-
* each frame's graph ahead of the bake, and hands each cache in through `adopt`.
|
|
272
|
-
*/
|
|
273
|
-
export type MeshSDFSource = {
|
|
274
|
-
/**
|
|
275
|
-
* records the source's work for the frame, ahead of the bake
|
|
276
|
-
*/
|
|
277
|
-
graph_update: (arg0: FrameGraph) => void;
|
|
278
|
-
};
|
|
279
262
|
import { GPUMeshCardSets } from "./cards/GPUMeshCardSets.js";
|
|
280
263
|
import { MeshSDFState } from "./MESH_SDF.js";
|
|
281
264
|
//# sourceMappingURL=GPUGeometrySDFManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUGeometrySDFManager.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUGeometrySDFManager.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js"],"names":[],"mappings":"AAsIA;;;;GAIG;AACH,uCAFU,MAAM,CAEuH;AAgDvI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH;IAyQI;;;OAGG;IACH,2CAFW,kBAAkB,EAS5B;IAxQD;;;;OAIG;IACH,aAAuB;IAEvB;;;;OAIG;IACH,iBAA2B;IAE3B;;;;OAIG;IACH,iBAA2B;IAuP3B;;;;OAIG;IACH,6BAEC;IAED;;;;;;OA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