@driftengine/core 4.9.0 → 4.10.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.json +62 -11
- package/README.md +43 -38
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -3
- package/dist/render/ambientHarmonics.d.ts +1 -1
- package/dist/render/ambientHarmonics.js +1 -1
- package/dist/render/areaLights.d.ts +4 -4
- package/dist/render/areaLights.js +1 -1
- package/dist/render/backend/api.d.ts +10 -3
- package/dist/render/backend/select.js +11 -5
- package/dist/render/backend/webgl2/boneAnimations.d.ts +29 -0
- package/dist/render/backend/webgl2/boneAnimations.js +80 -0
- package/dist/render/backend/webgl2/instanced.d.ts +5 -1
- package/dist/render/backend/webgl2/instanced.js +13 -1
- package/dist/render/backend/webgl2/renderer.d.ts +90 -2
- package/dist/render/backend/webgl2/renderer.js +253 -24
- package/dist/render/backend/webgl2/skinPaletteTexture.d.ts +5 -3
- package/dist/render/backend/webgl2/skinPaletteTexture.js +6 -4
- package/dist/render/backend/webgpu/boneAnimations.d.ts +34 -0
- package/dist/render/backend/webgpu/boneAnimations.js +76 -0
- package/dist/render/backend/webgpu/buffers.d.ts +19 -4
- package/dist/render/backend/webgpu/buffers.js +18 -11
- package/dist/render/backend/webgpu/compressedUpload.d.ts +0 -1
- package/dist/render/backend/webgpu/compressedUpload.js +53 -8
- package/dist/render/backend/webgpu/depthPass.d.ts +59 -3
- package/dist/render/backend/webgpu/depthPass.js +49 -14
- package/dist/render/backend/webgpu/drawCommand.d.ts +18 -4
- package/dist/render/backend/webgpu/drawCommand.js +10 -3
- package/dist/render/backend/webgpu/flatPass.d.ts +85 -42
- package/dist/render/backend/webgpu/flatPass.js +136 -20
- package/dist/render/backend/webgpu/instanced.d.ts +14 -1
- package/dist/render/backend/webgpu/instanced.js +24 -1
- package/dist/render/backend/webgpu/materialStore.d.ts +101 -0
- package/dist/render/backend/webgpu/materialStore.js +265 -0
- package/dist/render/backend/webgpu/pipelineCache.d.ts +6 -0
- package/dist/render/backend/webgpu/pipelineCache.js +7 -0
- package/dist/render/backend/webgpu/renderer.d.ts +152 -35
- package/dist/render/backend/webgpu/renderer.js +787 -142
- package/dist/render/backend/webgpu/skinPaletteRing.d.ts +7 -3
- package/dist/render/backend/webgpu/skinPaletteRing.js +13 -7
- package/dist/render/backend/webgpu/skinPaletteTexture.d.ts +6 -0
- package/dist/render/backend/webgpu/skinPaletteTexture.js +7 -1
- package/dist/render/backend/webgpu/staticBundles.d.ts +125 -0
- package/dist/render/backend/webgpu/staticBundles.js +241 -0
- package/dist/render/backend/webgpu/surfaceTexturePass.d.ts +10 -3
- package/dist/render/backend/webgpu/surfaceTexturePass.js +20 -2
- package/dist/render/backend/webgpu/uniformRing.d.ts +21 -0
- package/dist/render/backend/webgpu/uniformRing.js +9 -1
- package/dist/render/bloomChain.d.ts +3 -3
- package/dist/render/boneAnimation.d.ts +92 -0
- package/dist/render/boneAnimation.js +133 -0
- package/dist/render/compressedSource.d.ts +33 -13
- package/dist/render/compressedSource.js +70 -25
- package/dist/render/glCompressed.js +83 -0
- package/dist/render/instances.d.ts +26 -0
- package/dist/render/lightBudget.d.ts +10 -0
- package/dist/render/lightBudget.js +10 -0
- package/dist/render/lightmap.d.ts +1 -1
- package/dist/render/mesh.d.ts +5 -0
- package/dist/render/mesh.js +6 -0
- package/dist/render/pointLightSelection.d.ts +4 -4
- package/dist/render/screenSpaceReflection.d.ts +2 -1
- package/dist/render/shaders/boneAnimation.d.ts +19 -0
- package/dist/render/shaders/boneAnimation.js +63 -0
- package/dist/render/shaders/depth.d.ts +7 -0
- package/dist/render/shaders/depth.js +35 -10
- package/dist/render/shaders/flat/index.d.ts +6 -0
- package/dist/render/shaders/flat/index.js +27 -5
- package/dist/render/shaders/flat/main.d.ts +1 -1
- package/dist/render/shaders/flat/main.js +15 -5
- package/dist/render/shaders/flat/models.js +1 -1
- package/dist/render/shaders/flat/overlay.js +1 -1
- package/dist/render/shaders/flat/pointShadow.js +2 -2
- package/dist/render/shaders/flat/preamble.js +38 -24
- package/dist/render/shaders/generated/depth.wgsl.d.ts +93 -0
- package/dist/render/shaders/generated/depth.wgsl.js +93 -0
- package/dist/render/shaders/generated/flat.wgsl.d.ts +3077 -2903
- package/dist/render/shaders/generated/flat.wgsl.js +3100 -2925
- package/dist/render/shaders/outputTransform.d.ts +7 -0
- package/dist/render/shaders/outputTransform.js +28 -14
- package/dist/render/shaders/vertexChannel.d.ts +7 -0
- package/dist/render/shaders/vertexChannel.js +26 -0
- package/dist/render/staticDraws.d.ts +47 -0
- package/dist/render/staticDraws.js +43 -0
- package/dist/render/surfaceTexture.d.ts +38 -7
- package/dist/render/surfaceTexture.js +56 -17
- package/package.json +6 -6
- package/src/index.ts +8 -2
- package/src/render/ambientHarmonics.ts +1 -1
- package/src/render/areaLights.ts +4 -4
- package/src/render/backend/api.ts +13 -3
- package/src/render/backend/select.ts +10 -5
- package/src/render/backend/webgl2/boneAnimations.ts +105 -0
- package/src/render/backend/webgl2/instanced.ts +20 -1
- package/src/render/backend/webgl2/renderer.ts +315 -24
- package/src/render/backend/webgl2/skinPaletteTexture.ts +6 -4
- package/src/render/backend/webgpu/boneAnimations.ts +97 -0
- package/src/render/backend/webgpu/buffers.ts +42 -16
- package/src/render/backend/webgpu/compressedUpload.ts +59 -9
- package/src/render/backend/webgpu/depthPass.ts +51 -10
- package/src/render/backend/webgpu/drawCommand.ts +22 -4
- package/src/render/backend/webgpu/flatPass.ts +187 -14
- package/src/render/backend/webgpu/instanced.ts +32 -1
- package/src/render/backend/webgpu/materialStore.ts +276 -0
- package/src/render/backend/webgpu/pipelineCache.ts +7 -0
- package/src/render/backend/webgpu/renderer.ts +928 -155
- package/src/render/backend/webgpu/skinPaletteRing.ts +13 -7
- package/src/render/backend/webgpu/skinPaletteTexture.ts +7 -1
- package/src/render/backend/webgpu/staticBundles.ts +363 -0
- package/src/render/backend/webgpu/surfaceTexturePass.ts +29 -3
- package/src/render/backend/webgpu/uniformRing.ts +10 -1
- package/src/render/bloomChain.ts +3 -3
- package/src/render/boneAnimation.ts +223 -0
- package/src/render/compressedSource.ts +121 -29
- package/src/render/glCompressed.ts +83 -0
- package/src/render/instances.ts +27 -0
- package/src/render/lightBudget.ts +11 -0
- package/src/render/lightmap.ts +1 -1
- package/src/render/mesh.ts +6 -0
- package/src/render/pointLightSelection.ts +4 -4
- package/src/render/screenSpaceReflection.ts +2 -1
- package/src/render/shaders/boneAnimation.ts +63 -0
- package/src/render/shaders/depth.ts +45 -10
- package/src/render/shaders/flat/index.ts +33 -5
- package/src/render/shaders/flat/main.ts +15 -5
- package/src/render/shaders/flat/models.ts +1 -1
- package/src/render/shaders/flat/overlay.ts +1 -1
- package/src/render/shaders/flat/pointShadow.ts +2 -2
- package/src/render/shaders/flat/preamble.ts +38 -24
- package/src/render/shaders/generated/depth.wgsl.ts +95 -0
- package/src/render/shaders/generated/flat.wgsl.ts +3100 -2925
- package/src/render/shaders/outputTransform.ts +30 -14
- package/src/render/shaders/vertexChannel.ts +27 -0
- package/src/render/staticDraws.ts +95 -0
- package/src/render/surfaceTexture.ts +94 -27
|
@@ -25,7 +25,7 @@ import { GpuClothBinding, GpuClothParticles } from './clothTextures.ts';
|
|
|
25
25
|
import type { ComputeHost } from './computeHost.ts';
|
|
26
26
|
import { type SurfaceOverlay } from '../../surfaceOverlay.ts';
|
|
27
27
|
import type { ClothBindingData } from '../../clothBindingData.ts';
|
|
28
|
-
import type { CompressedTextureFormat, SurfaceSource } from '../../compressedSource.ts';
|
|
28
|
+
import type { CompressedTextureFormat, CompressedTextureSource, SurfaceSource } from '../../compressedSource.ts';
|
|
29
29
|
import { GpuSdfText } from './sdfTextPass.ts';
|
|
30
30
|
import type { SdfFont } from '../../sdfFont.ts';
|
|
31
31
|
import type { SdfTextStyle } from '../../sdfTextLayout.ts';
|
|
@@ -47,6 +47,8 @@ import type { MeshData } from '../../mesh.ts';
|
|
|
47
47
|
import type { ShadowCasters } from '../../shadowCasters.ts';
|
|
48
48
|
import { type GpuMesh } from './buffers.ts';
|
|
49
49
|
import type { GpuSurface } from './device.ts';
|
|
50
|
+
import type { BoneAnimationClip, BoneAnimationHandle } from '../../boneAnimation.ts';
|
|
51
|
+
import type { StaticDrawsHandle } from '../../staticDraws.ts';
|
|
50
52
|
import { type GpuScatter } from './scatterPass.ts';
|
|
51
53
|
import { type GpuWater } from './waterPass.ts';
|
|
52
54
|
import { type GpuPlumes } from './plumePass.ts';
|
|
@@ -143,6 +145,8 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
143
145
|
private readonly skinnedBindGroupLayout;
|
|
144
146
|
private readonly morphedBindGroupLayout;
|
|
145
147
|
private readonly bothBindGroupLayout;
|
|
148
|
+
/** The instanced layout of a batch playing a bone animation. See `animatedGroup`. */
|
|
149
|
+
private readonly animatedBindGroupLayout;
|
|
146
150
|
/** The morph weights the following draws use, or null for none. */
|
|
147
151
|
private morphWeights;
|
|
148
152
|
/**
|
|
@@ -156,13 +160,6 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
156
160
|
* Keyed by slot instead, the groups are built once and reused for the life of the renderer.
|
|
157
161
|
*/
|
|
158
162
|
private readonly skinnedGroups;
|
|
159
|
-
/** The unskinned group each was built beside, for identity-based invalidation. */
|
|
160
|
-
private readonly skinnedGroupsBeside;
|
|
161
|
-
private readonly skinnedGroupsPalette;
|
|
162
|
-
private readonly skinnedGroupsDeltas;
|
|
163
|
-
/** The cloth views each skinned twin was built with, compared by identity like the palette. */
|
|
164
|
-
private readonly skinnedGroupsCloth;
|
|
165
|
-
private readonly skinnedGroupsClothBinding;
|
|
166
163
|
/** The cloth the next skinned draws are placed by, or null. See `setCloth`. */
|
|
167
164
|
private cloth;
|
|
168
165
|
private clothStandCache;
|
|
@@ -230,22 +227,51 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
230
227
|
/** Every distinct cache above, so a mesh's pipelines are built for each. One entry when aliased. */
|
|
231
228
|
private readonly pipelineTargets;
|
|
232
229
|
private readonly bindGroupLayout;
|
|
233
|
-
/** One slot per draw, uploaded once a frame. See `UniformRing`. */
|
|
234
|
-
private
|
|
235
|
-
/** The lights, fog and camera, settled once per frame by `bindMeshPass`. */
|
|
236
|
-
private readonly perFrame;
|
|
230
|
+
/** One slot per draw, uploaded once a frame. See `UniformRing`. Swapped while a static list records. */
|
|
231
|
+
private perDraw;
|
|
237
232
|
/**
|
|
238
|
-
* The
|
|
233
|
+
* The lights, fog and camera, a slot per mesh pass a frame opens: `bindMeshPass` writes them, and
|
|
234
|
+
* the first draw after it takes a slot. A ring rather than one buffer because a frame opens more
|
|
235
|
+
* than one pass — a mirror's, a capture's, a probe face's — and a queue write does not interleave
|
|
236
|
+
* with the draws recorded between them. See `UniformRing`.
|
|
237
|
+
*/
|
|
238
|
+
private passRing;
|
|
239
|
+
/** Each material's block, kept across frames for as long as it does not change. */
|
|
240
|
+
private readonly materialStore;
|
|
241
|
+
/**
|
|
242
|
+
* Both blocks as the CPU holds them, the pass's then the material's, patched by name and copied
|
|
243
|
+
* into a slot by the next draw after something changed them. See `FlatFragmentScratch`.
|
|
239
244
|
*
|
|
240
245
|
* Authoritative between draws: a setter changes one field here and marks the block dirty, and
|
|
241
|
-
* the next `drawMesh`
|
|
242
|
-
*
|
|
246
|
+
* the next `drawMesh` places it. That keeps a setter free of any knowledge of slots, which is
|
|
247
|
+
* what lets it be called anywhere a scene wants.
|
|
243
248
|
*/
|
|
244
249
|
private readonly perFrameStaging;
|
|
245
250
|
private readonly perFrameFloats;
|
|
246
251
|
private readonly perFrameInts;
|
|
252
|
+
/** The two halves of the scratch, as the words a slot is written from. */
|
|
253
|
+
private readonly passInts;
|
|
254
|
+
private readonly materialInts;
|
|
247
255
|
/** The slot the open material occupies, and whether the next draw must take a new one. */
|
|
248
256
|
private readonly materials;
|
|
257
|
+
/** The same for the pass's block: reopened by `bindMeshPass` and by nothing a material sets. */
|
|
258
|
+
private readonly passBlock;
|
|
259
|
+
/**
|
|
260
|
+
* The vertex stage's view block — the camera, the light's matrix, the wind — a slot a pass, and a
|
|
261
|
+
* second, unjittered, for a blended draw landing after the upscale. Reopened with the pass, and by
|
|
262
|
+
* `setWind` and `beginShadowPass`, which change what it holds.
|
|
263
|
+
*/
|
|
264
|
+
private viewRing;
|
|
265
|
+
private readonly viewBlock;
|
|
266
|
+
private readonly lateViewBlock;
|
|
267
|
+
/** The view slot the draw being submitted bound, read by the halves it keeps for later passes. */
|
|
268
|
+
private drawViewOffset;
|
|
269
|
+
/** Pass slots asked for and refused this frame, and materials refused: what grows the two. */
|
|
270
|
+
private passesAsked;
|
|
271
|
+
private passesRefused;
|
|
272
|
+
private viewsAsked;
|
|
273
|
+
private viewsRefused;
|
|
274
|
+
private materialsRefused;
|
|
249
275
|
/**
|
|
250
276
|
* What this frame asked for against the ceilings above, reported rather than only warned about.
|
|
251
277
|
*
|
|
@@ -453,7 +479,7 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
453
479
|
private readonly variant;
|
|
454
480
|
/** Whether this profile compiled the point-shadow path, and so has sentinels to write. */
|
|
455
481
|
private readonly pointShadowsCompiled;
|
|
456
|
-
/** What the generator recorded about that permutation
|
|
482
|
+
/** What the generator recorded about that permutation, as the renderer's scratch lays it out. */
|
|
457
483
|
private readonly fragment;
|
|
458
484
|
private depth;
|
|
459
485
|
private depthView;
|
|
@@ -1181,7 +1207,7 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1181
1207
|
* ones that move something *every* group holds: the shadow cubemaps, the probe fence, the cookie
|
|
1182
1208
|
* atlas and the IES rows. None of those is a frame path.
|
|
1183
1209
|
*/
|
|
1184
|
-
private
|
|
1210
|
+
private flatBindGroups;
|
|
1185
1211
|
/** The group holding the one-pixel stand-in, for every draw with no texture set. */
|
|
1186
1212
|
private blankAlbedoBindGroup;
|
|
1187
1213
|
/** Repeats across the mesh's own UV range. Per draw, because `uUvScale` is a vertex uniform. */
|
|
@@ -1238,7 +1264,7 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1238
1264
|
* opens is submitted by the time the next one begins.
|
|
1239
1265
|
*/
|
|
1240
1266
|
private readonly retiredTextures;
|
|
1241
|
-
updateSurfaceTexture(texture: GpuSurfaceTexture, source: TexImageSource): void;
|
|
1267
|
+
updateSurfaceTexture(texture: GpuSurfaceTexture, source: TexImageSource | CompressedTextureSource): void;
|
|
1242
1268
|
disposeSurfaceTexture(texture: GpuSurfaceTexture): void;
|
|
1243
1269
|
/**
|
|
1244
1270
|
* Drop every bind group that may hold `texture`'s view, and rebuild the ones bound now.
|
|
@@ -1352,6 +1378,16 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1352
1378
|
setSurfaceReflectivity(amount: number): void;
|
|
1353
1379
|
/** How bright the environment the surfaces drawn next reflect is. See `renderer.ts`. */
|
|
1354
1380
|
setEnvironmentGain(gain: number): void;
|
|
1381
|
+
/**
|
|
1382
|
+
* The reflectivity and environment gain the setters gave the pass, and the ones the material
|
|
1383
|
+
* set now states, or null where it states none (`SurfaceMaterial.reflectivity`). A draw wears the
|
|
1384
|
+
* material's where it has one and the pass's otherwise, the rule `renderer.ts` keeps too.
|
|
1385
|
+
*/
|
|
1386
|
+
private passReflectivity;
|
|
1387
|
+
private passEnvironmentGain;
|
|
1388
|
+
private materialReflectivity;
|
|
1389
|
+
private materialEnvironmentGain;
|
|
1390
|
+
private writeEnvironmentDials;
|
|
1355
1391
|
setSurfaceGrain(amount: number): void;
|
|
1356
1392
|
/** Whether the surfaces drawn next meet the medium. See `renderer.ts`. */
|
|
1357
1393
|
setSurfaceFog(enabled: boolean): void;
|
|
@@ -1818,14 +1854,6 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1818
1854
|
* its own two programs.
|
|
1819
1855
|
*/
|
|
1820
1856
|
private writeShadowWind;
|
|
1821
|
-
/**
|
|
1822
|
-
* The five wind fields of one per-draw slot.
|
|
1823
|
-
*
|
|
1824
|
-
* **Never called for an instanced draw.** That variant declares none of these, and
|
|
1825
|
-
* `flatPass.ts` records what writing a field a variant does not declare costs: the block is
|
|
1826
|
-
* shorter, so the write lands on whatever occupies that offset instead.
|
|
1827
|
-
*/
|
|
1828
|
-
private writeWind;
|
|
1829
1857
|
/** Refilled per frame rather than allocated; see `resolvePointLights`. */
|
|
1830
1858
|
private readonly lights;
|
|
1831
1859
|
/** The fixed arm's rectangles as `uAreaLightSize` holds them. See `packAreaSizesAndDoors`. */
|
|
@@ -1945,6 +1973,9 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
1945
1973
|
* at submit, and a texture's view is new when an update changes its size.
|
|
1946
1974
|
*/
|
|
1947
1975
|
private readonly shadowCutoutLayout;
|
|
1976
|
+
/** A crowd's casters: the plain and cutout layouts with a bone animation's three textures. */
|
|
1977
|
+
private readonly shadowAnimatedLayout;
|
|
1978
|
+
private readonly shadowAnimatedCutoutLayout;
|
|
1948
1979
|
private readonly cutoutGroups;
|
|
1949
1980
|
private readonly cutoutPeelGroups;
|
|
1950
1981
|
private shadowPeelPassUniforms;
|
|
@@ -2267,6 +2298,21 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2267
2298
|
* can do nothing about. Done with `complete` still false is the signal that it was abandoned.
|
|
2268
2299
|
*/
|
|
2269
2300
|
createMeshIncremental(given: MeshData, options?: MeshOptions): IncrementalMeshHandle;
|
|
2301
|
+
/**
|
|
2302
|
+
* The copies this frame's mesh rewrites owe (`StagedRewrite`), recorded since the last submit and
|
|
2303
|
+
* sent at the head of the next one: one encoder however many meshes are rewritten. Null while
|
|
2304
|
+
* nothing is owed.
|
|
2305
|
+
*/
|
|
2306
|
+
private pendingRewrites;
|
|
2307
|
+
/** One record handed to every staged rewrite, refilled each call, so a rewrite allocates nothing. */
|
|
2308
|
+
private readonly stagedRewrite;
|
|
2309
|
+
private rewriteCopies;
|
|
2310
|
+
/**
|
|
2311
|
+
* Submit `buffers`, led by any copies the frame's mesh rewrites owe. **Every submit of this
|
|
2312
|
+
* renderer goes through here**, because any of them may draw a rewritten mesh — the frame's own,
|
|
2313
|
+
* a mirror's, a shadow's, a probe's — and the copies must be ahead of the first that does.
|
|
2314
|
+
*/
|
|
2315
|
+
private submit;
|
|
2270
2316
|
/**
|
|
2271
2317
|
* Rewrite a mesh's positions, and its normals where the caller has them.
|
|
2272
2318
|
*
|
|
@@ -2285,15 +2331,34 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2285
2331
|
*/
|
|
2286
2332
|
bindMeshPass(camera: Camera, env: Environment): void;
|
|
2287
2333
|
/**
|
|
2288
|
-
* The slot the next draw's material lives in,
|
|
2334
|
+
* The slot the next draw's material lives in, placing it when something dirtied it, with the
|
|
2335
|
+
* pass's slot taken first where `bindMeshPass` reopened it: `passOffset` is that one's offset.
|
|
2289
2336
|
*
|
|
2290
|
-
* **A
|
|
2291
|
-
* material
|
|
2292
|
-
*
|
|
2337
|
+
* **A placement per material change, not per draw.** A scene drawing a hundred meshes of one
|
|
2338
|
+
* material places it once; a scene switching material every draw places one each, and a material
|
|
2339
|
+
* the store already holds — the same numbers as a draw before it, this frame or an earlier one —
|
|
2340
|
+
* is bound where it is and uploads nothing.
|
|
2293
2341
|
*/
|
|
2294
2342
|
private materialSlotForDraw;
|
|
2343
|
+
/** The pass slot `materialSlotForDraw` left open, read beside the material's by every lit draw. */
|
|
2344
|
+
private get passOffset();
|
|
2345
|
+
/** A new pass: its block, and both its views, are taken afresh by the next draw. */
|
|
2346
|
+
private reopenPass;
|
|
2347
|
+
/** What a view holds changed — the wind, the light's matrix — so the next draw takes a new one. */
|
|
2348
|
+
private reopenViews;
|
|
2349
|
+
/**
|
|
2350
|
+
* The view slot a lit draw reads its camera from: the pass's, or its unjittered twin for a blended
|
|
2351
|
+
* draw landing after the upscale. Taken by the first draw that needs it after the pass, the wind or
|
|
2352
|
+
* the light's matrix changed, and shared by every draw until then. Null when the ring is full, which
|
|
2353
|
+
* skips the draw and grows the ring for the next frame, as the pass ring does.
|
|
2354
|
+
*/
|
|
2355
|
+
private viewSlotFor;
|
|
2356
|
+
/** A view block: the camera, the light's matrix and the frame's wind, into `ring` at `slot`. */
|
|
2357
|
+
private writeView;
|
|
2358
|
+
private warnMaterialsFull;
|
|
2295
2359
|
/** Said once rather than every frame, for the reason `warnedFull` gives. */
|
|
2296
2360
|
private warnedMaterialsFull;
|
|
2361
|
+
private warnedPassesFull;
|
|
2297
2362
|
private warnedSkyFull;
|
|
2298
2363
|
private warnedParticlesTwice;
|
|
2299
2364
|
/**
|
|
@@ -2407,6 +2472,26 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2407
2472
|
* the shape this repository spent a week removing.
|
|
2408
2473
|
*/
|
|
2409
2474
|
createInstanced(mesh: GpuMesh, capacity: number, options?: InstancedOptions): GpuInstancedBatch;
|
|
2475
|
+
/** See `Renderer.setAnimationTime`. Every view taken after it reads the new clock. */
|
|
2476
|
+
setAnimationTime(seconds: number): void;
|
|
2477
|
+
/** The clock `setAnimationTime` set, 0 until it is. */
|
|
2478
|
+
private animationTime;
|
|
2479
|
+
/** See `Renderer.createBoneAnimation`. */
|
|
2480
|
+
createBoneAnimation(clip: BoneAnimationClip): BoneAnimationHandle;
|
|
2481
|
+
/** See `Renderer.disposeBoneAnimation`. A batch still playing it draws nothing after. */
|
|
2482
|
+
disposeBoneAnimation(animation: BoneAnimationHandle): void;
|
|
2483
|
+
/** An animated batch's clip and clocks, as its groups bind them. */
|
|
2484
|
+
private animationViews;
|
|
2485
|
+
/** An animated batch's groups, dropped wherever the renderer drops its own. */
|
|
2486
|
+
private freshAnimatedGroups;
|
|
2487
|
+
/**
|
|
2488
|
+
* The lit group an animated batch draws with: the material's group, or its overlay twin, again
|
|
2489
|
+
* with the clip's and the clocks' textures — kept on the batch by the group it was built beside,
|
|
2490
|
+
* as a skinned twin is kept by its palette slot.
|
|
2491
|
+
*/
|
|
2492
|
+
private animatedGroup;
|
|
2493
|
+
/** An animated caster's shadow group, by what it cuts with and whether this is the peel. */
|
|
2494
|
+
private animatedDepthGroup;
|
|
2410
2495
|
/** The device instance culls, built on the first culling draw. See `InstanceCullPass`. */
|
|
2411
2496
|
private instanceCulls;
|
|
2412
2497
|
/** Counts frames, so a batch knows when its cull slots were last taken. */
|
|
@@ -2527,6 +2612,38 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2527
2612
|
* face. What it replaces is a consumer re-entering its whole draw path with a second camera.
|
|
2528
2613
|
*/
|
|
2529
2614
|
drawSceneCasters(casters: ShadowCasters): void;
|
|
2615
|
+
/** See `Renderer.createStaticDraws`. Recorded on its first draw, into each view it is drawn in. */
|
|
2616
|
+
createStaticDraws(casters: ShadowCasters): StaticDrawsHandle;
|
|
2617
|
+
/**
|
|
2618
|
+
* See `Renderer.drawStaticDraws`. One bundle executed, after a pass block and a view block are
|
|
2619
|
+
* written for this view; the list is recorded first where it has no recording that is current for
|
|
2620
|
+
* this target and starting state. See `staticBundles.ts`.
|
|
2621
|
+
*/
|
|
2622
|
+
drawStaticDraws(draws: StaticDrawsHandle): void;
|
|
2623
|
+
/** A list drawn the way `drawSceneCasters` draws, a draw at a time, for where a bundle cannot be. */
|
|
2624
|
+
private replayStaticImmediately;
|
|
2625
|
+
/** See `Renderer.disposeStaticDraws`. Its pins let go; its meshes and materials are the caller's. */
|
|
2626
|
+
disposeStaticDraws(draws: StaticDrawsHandle): void;
|
|
2627
|
+
/** The recording to replay `list` from here, made now if none is current; null if it cannot be. */
|
|
2628
|
+
private staticRecordingFor;
|
|
2629
|
+
/** How a list's pins are let go: through the store, unless it has forgotten them since. */
|
|
2630
|
+
private unpinFor;
|
|
2631
|
+
/**
|
|
2632
|
+
* Record `list` into `recording`: its entries through the scene-caster path, with the list's
|
|
2633
|
+
* rings and group cache swapped in for the frame's and the pass and view slots held at the list's
|
|
2634
|
+
* first copy, so every command the path records binds the list's buffers and offsets the bundle
|
|
2635
|
+
* can rewrite per copy. Everything swapped is put back, whatever the path throws.
|
|
2636
|
+
*/
|
|
2637
|
+
private recordStatic;
|
|
2638
|
+
/** The recording under way, which `recordDraw` and the side passes take their commands into. */
|
|
2639
|
+
private staticRecording;
|
|
2640
|
+
/** Whether the replay about to count its material changes recorded them, and so counted them. */
|
|
2641
|
+
private staticJustRecorded;
|
|
2642
|
+
/** A disposed list drawn, said once: the frame loop does not throw. */
|
|
2643
|
+
private warnStaticDisposed;
|
|
2644
|
+
private warnedStaticDisposed;
|
|
2645
|
+
/** Bumped wherever the lit groups are dropped, which a static list's own groups follow. */
|
|
2646
|
+
private flatGroupEpoch;
|
|
2530
2647
|
drawShadowCasters(casters: ShadowCasters): void;
|
|
2531
2648
|
/** Close the shadow pass and submit it, so the frame can sample what it wrote. */
|
|
2532
2649
|
/**
|
|
@@ -2673,11 +2790,11 @@ export declare class WebGPURenderer implements RendererApi {
|
|
|
2673
2790
|
/**
|
|
2674
2791
|
* The bind group a draw uses, skinned or not.
|
|
2675
2792
|
*
|
|
2676
|
-
* **The skinned twin is
|
|
2677
|
-
*
|
|
2678
|
-
*
|
|
2679
|
-
*
|
|
2680
|
-
* missed invalidation is not possible rather than merely unlikely, and it is why
|
|
2793
|
+
* **The skinned twin is kept by palette slot and by the unskinned group it was built beside**,
|
|
2794
|
+
* which is one a material, and compared against the views it holds — the palette's, which
|
|
2795
|
+
* changes only when the slot's texture grows, the morph deltas and the cloth's — rather than
|
|
2796
|
+
* against a flag somebody has to remember to clear at six call sites. Comparing object identity
|
|
2797
|
+
* means a missed invalidation is not possible rather than merely unlikely, and it is why
|
|
2681
2798
|
* `SkinPaletteTexture.view()` caches: a fresh view every call never compares equal and would
|
|
2682
2799
|
* rebuild this every draw.
|
|
2683
2800
|
*/
|