ugly-game 0.15.36 → 0.15.38
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/dist/assets/crowdRecord.d.ts +15 -0
- package/dist/assets/crowdRecord.js +34 -0
- package/dist/assets/gpuCrowd.d.ts +9 -19
- package/dist/assets/gpuCrowd.js +12 -45
- package/dist/character.d.ts +152 -0
- package/dist/character.js +410 -0
- package/dist/cube.d.ts +42 -0
- package/dist/cube.js +49 -0
- package/dist/gpuGI.js +1 -1
- package/dist/gpuGraph.js +1 -1
- package/dist/gpuSpot.d.ts +2 -2
- package/dist/gpuSpot.js +1 -1
- package/dist/gpuTaa.d.ts +2 -2
- package/dist/gpuTaa.js +1 -1
- package/dist/gpuWorld.d.ts +1 -1
- package/dist/gpuWorld.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -3
- package/dist/flightTestFixture.d.mts +0 -2
- package/dist/flightTestFixture.mjs +0 -57
- package/dist/gpuShadow.d.ts +0 -1133
- package/dist/gpuShadow.js +0 -4463
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Floats per crowd instance: mat4 + tint + layer/palette/pool/material ids. */
|
|
2
|
+
export declare const CROWD_RECORD_FLOATS = 24;
|
|
3
|
+
export declare const CROWD_REC_MODEL = 0;
|
|
4
|
+
export declare const CROWD_REC_TINT = 16;
|
|
5
|
+
export declare const CROWD_REC_LAYER = 20;
|
|
6
|
+
export declare const CROWD_REC_PALETTE_SLOT = 21;
|
|
7
|
+
export declare const CROWD_REC_POOL_SLOT = 22;
|
|
8
|
+
export declare const CROWD_REC_MATERIAL = 23;
|
|
9
|
+
/** Rows in the crowd draw shader's material table. */
|
|
10
|
+
export declare const CROWD_MATERIAL_COUNT = 5;
|
|
11
|
+
/**
|
|
12
|
+
* Write one instance record. This is the single CPU-side statement of the WGSL `Rec` layout.
|
|
13
|
+
* `paletteSlot` is a compact character ordinal; `poolSlot` is a vertex-pool offset.
|
|
14
|
+
*/
|
|
15
|
+
export declare function writeCrowdRecord(out: Float32Array, at: number, model: ArrayLike<number>, tint: ArrayLike<number>, layer: number, paletteSlot: number, poolSlot: number, material?: number): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Floats per crowd instance: mat4 + tint + layer/palette/pool/material ids. */
|
|
2
|
+
export const CROWD_RECORD_FLOATS = 24;
|
|
3
|
+
export const CROWD_REC_MODEL = 0;
|
|
4
|
+
export const CROWD_REC_TINT = 16;
|
|
5
|
+
export const CROWD_REC_LAYER = 20;
|
|
6
|
+
export const CROWD_REC_PALETTE_SLOT = 21;
|
|
7
|
+
export const CROWD_REC_POOL_SLOT = 22;
|
|
8
|
+
export const CROWD_REC_MATERIAL = 23;
|
|
9
|
+
/** Rows in the crowd draw shader's material table. */
|
|
10
|
+
export const CROWD_MATERIAL_COUNT = 5;
|
|
11
|
+
/**
|
|
12
|
+
* Write one instance record. This is the single CPU-side statement of the WGSL `Rec` layout.
|
|
13
|
+
* `paletteSlot` is a compact character ordinal; `poolSlot` is a vertex-pool offset.
|
|
14
|
+
*/
|
|
15
|
+
export function writeCrowdRecord(out, at, model, tint, layer, paletteSlot, poolSlot, material = 0) {
|
|
16
|
+
if (model.length !== 16)
|
|
17
|
+
throw new Error(`writeCrowdRecord: model has ${model.length} floats, expected a column-major 16`);
|
|
18
|
+
if (tint.length !== 4)
|
|
19
|
+
throw new Error(`writeCrowdRecord: tint has ${tint.length} floats, expected rgba`);
|
|
20
|
+
if (at < 0 || at % CROWD_RECORD_FLOATS !== 0)
|
|
21
|
+
throw new Error(`writeCrowdRecord: offset ${at} is not a whole record (multiple of ${CROWD_RECORD_FLOATS})`);
|
|
22
|
+
if (at + CROWD_RECORD_FLOATS > out.length)
|
|
23
|
+
throw new Error(`writeCrowdRecord: record at ${at} overruns a ${out.length}-float array`);
|
|
24
|
+
out.set(model, at + CROWD_REC_MODEL);
|
|
25
|
+
out.set(tint, at + CROWD_REC_TINT);
|
|
26
|
+
out[at + CROWD_REC_LAYER] = layer;
|
|
27
|
+
out[at + CROWD_REC_PALETTE_SLOT] = paletteSlot;
|
|
28
|
+
out[at + CROWD_REC_POOL_SLOT] = poolSlot;
|
|
29
|
+
if (!Number.isInteger(material) ||
|
|
30
|
+
material < 0 ||
|
|
31
|
+
material >= CROWD_MATERIAL_COUNT)
|
|
32
|
+
throw new Error(`writeCrowdRecord: material ${material} is not one of the ${CROWD_MATERIAL_COUNT} rows in the shader's table`);
|
|
33
|
+
out[at + CROWD_REC_MATERIAL] = material;
|
|
34
|
+
}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export declare const CROWD_MATERIAL_COUNT = 5;
|
|
2
|
+
export declare const CROWD_RECORD_FLOATS = 24;
|
|
3
|
+
export declare const CROWD_REC_LAYER = 20;
|
|
4
|
+
export declare const CROWD_REC_MATERIAL = 23;
|
|
5
|
+
export declare const CROWD_REC_MODEL = 0;
|
|
6
|
+
export declare const CROWD_REC_PALETTE_SLOT = 21;
|
|
7
|
+
export declare const CROWD_REC_POOL_SLOT = 22;
|
|
8
|
+
export declare const CROWD_REC_TINT = 16;
|
|
9
|
+
export declare function writeCrowdRecord(out: Float32Array, off: number, model: Float32Array, tint: Float32Array, layer: number, paletteSlot: number, poolSlot: number, material?: number): void;
|
|
1
10
|
/**
|
|
2
11
|
* One rung of the shared body mesh, as cooked into a .ugm.
|
|
3
12
|
*
|
|
@@ -122,13 +131,6 @@ export interface CrowdAssets {
|
|
|
122
131
|
* Write records through `writeCrowdRecord` so this layout lives in exactly one place; the WGSL
|
|
123
132
|
* `Rec` struct below is its only other statement of the same thing.
|
|
124
133
|
*/
|
|
125
|
-
export declare const CROWD_RECORD_FLOATS = 24;
|
|
126
|
-
/** Float offsets inside one record. `writeCrowdRecord` and the WGSL `Rec` struct must agree. */
|
|
127
|
-
export declare const CROWD_REC_MODEL = 0;
|
|
128
|
-
export declare const CROWD_REC_TINT = 16;
|
|
129
|
-
export declare const CROWD_REC_LAYER = 20;
|
|
130
|
-
export declare const CROWD_REC_PALETTE_SLOT = 21;
|
|
131
|
-
export declare const CROWD_REC_POOL_SLOT = 22;
|
|
132
134
|
/**
|
|
133
135
|
* The row of the DRAW shader's material table this instance draws with — `ids.w`, which the layout
|
|
134
136
|
* was already carrying as pad.
|
|
@@ -138,7 +140,6 @@ export declare const CROWD_REC_POOL_SLOT = 22;
|
|
|
138
140
|
* doing nothing. It sits one place past `CROWD_REC_POOL_SLOT`, which is a VERTEX OFFSET — see the
|
|
139
141
|
* warning there about what confusing the two looks like.
|
|
140
142
|
*/
|
|
141
|
-
export declare const CROWD_REC_MATERIAL = 23;
|
|
142
143
|
/**
|
|
143
144
|
* Rows of the DRAW shader's material table, by name.
|
|
144
145
|
*
|
|
@@ -157,8 +158,6 @@ export declare const CROWD_MATERIALS: {
|
|
|
157
158
|
readonly glass: 3;
|
|
158
159
|
readonly wood: 4;
|
|
159
160
|
};
|
|
160
|
-
/** Rows in the WGSL `MATS` table — the bound `writeCrowdRecord` checks a material against. */
|
|
161
|
-
export declare const CROWD_MATERIAL_COUNT = 5;
|
|
162
161
|
/**
|
|
163
162
|
* Materials whose shader row has a non-zero REFRACTION strength (`c.y` in `MATS`).
|
|
164
163
|
*
|
|
@@ -362,15 +361,6 @@ export declare function morphParams(slot: number, vertCount: number, entryCount:
|
|
|
362
361
|
* the same people twice with the wrong topology, which reads as flickering rather than as an error.
|
|
363
362
|
*/
|
|
364
363
|
export declare function validateBuckets(records: Float32Array, byLod: CrowdBucket[], lodCount: number): number;
|
|
365
|
-
/**
|
|
366
|
-
* Write ONE instance record. The single CPU-side statement of the layout the WGSL `Rec` struct
|
|
367
|
-
* mirrors — a caller that packs 24 floats by hand has a second one, and the two drift.
|
|
368
|
-
*
|
|
369
|
-
* `model` is column-major, as everything else in this engine. `tint`'s W IS THE OPACITY: it is what
|
|
370
|
-
* `splitByAlpha` reads to route an instance to the blended pipeline, so an alpha below 1 needs
|
|
371
|
-
* nothing else set anywhere.
|
|
372
|
-
*/
|
|
373
|
-
export declare function writeCrowdRecord(out: Float32Array, at: number, model: ArrayLike<number>, tint: ArrayLike<number>, layer: number, paletteSlot: number, poolSlot: number, material?: number): void;
|
|
374
364
|
/** One `drawIndexed` — a maximal run of records at one LOD that are all opaque or all blended. */
|
|
375
365
|
export interface CrowdDraw {
|
|
376
366
|
lod: number;
|
package/dist/assets/gpuCrowd.js
CHANGED
|
@@ -24,6 +24,18 @@
|
|
|
24
24
|
// "must match" comment, and a crowd that disagreed would light its characters out of a different
|
|
25
25
|
// number of cascades than the ground they stand on.
|
|
26
26
|
import { MAX_CASCADES } from './gpuSkin';
|
|
27
|
+
import { CROWD_MATERIAL_COUNT as CROWD_MATERIAL_COUNT_VALUE, CROWD_RECORD_FLOATS as CROWD_RECORD_FLOATS_VALUE, CROWD_REC_LAYER as CROWD_REC_LAYER_VALUE, CROWD_REC_MATERIAL as CROWD_REC_MATERIAL_VALUE, CROWD_REC_MODEL as CROWD_REC_MODEL_VALUE, CROWD_REC_PALETTE_SLOT as CROWD_REC_PALETTE_SLOT_VALUE, CROWD_REC_POOL_SLOT as CROWD_REC_POOL_SLOT_VALUE, CROWD_REC_TINT as CROWD_REC_TINT_VALUE, writeCrowdRecord as writeCrowdRecordValue, } from './crowdRecord';
|
|
28
|
+
export const CROWD_MATERIAL_COUNT = CROWD_MATERIAL_COUNT_VALUE;
|
|
29
|
+
export const CROWD_RECORD_FLOATS = CROWD_RECORD_FLOATS_VALUE;
|
|
30
|
+
export const CROWD_REC_LAYER = CROWD_REC_LAYER_VALUE;
|
|
31
|
+
export const CROWD_REC_MATERIAL = CROWD_REC_MATERIAL_VALUE;
|
|
32
|
+
export const CROWD_REC_MODEL = CROWD_REC_MODEL_VALUE;
|
|
33
|
+
export const CROWD_REC_PALETTE_SLOT = CROWD_REC_PALETTE_SLOT_VALUE;
|
|
34
|
+
export const CROWD_REC_POOL_SLOT = CROWD_REC_POOL_SLOT_VALUE;
|
|
35
|
+
export const CROWD_REC_TINT = CROWD_REC_TINT_VALUE;
|
|
36
|
+
export function writeCrowdRecord(out, off, model, tint, layer, paletteSlot, poolSlot, material = 0) {
|
|
37
|
+
writeCrowdRecordValue(out, off, model, tint, layer, paletteSlot, poolSlot, material);
|
|
38
|
+
}
|
|
27
39
|
/**
|
|
28
40
|
* Floats per instance record: mat4 (16) + tint (4) + layer/paletteSlot/poolSlot/material (4).
|
|
29
41
|
*
|
|
@@ -35,13 +47,6 @@ import { MAX_CASCADES } from './gpuSkin';
|
|
|
35
47
|
* Write records through `writeCrowdRecord` so this layout lives in exactly one place; the WGSL
|
|
36
48
|
* `Rec` struct below is its only other statement of the same thing.
|
|
37
49
|
*/
|
|
38
|
-
export const CROWD_RECORD_FLOATS = 24;
|
|
39
|
-
/** Float offsets inside one record. `writeCrowdRecord` and the WGSL `Rec` struct must agree. */
|
|
40
|
-
export const CROWD_REC_MODEL = 0;
|
|
41
|
-
export const CROWD_REC_TINT = 16;
|
|
42
|
-
export const CROWD_REC_LAYER = 20;
|
|
43
|
-
export const CROWD_REC_PALETTE_SLOT = 21;
|
|
44
|
-
export const CROWD_REC_POOL_SLOT = 22;
|
|
45
50
|
/**
|
|
46
51
|
* The row of the DRAW shader's material table this instance draws with — `ids.w`, which the layout
|
|
47
52
|
* was already carrying as pad.
|
|
@@ -51,7 +56,6 @@ export const CROWD_REC_POOL_SLOT = 22;
|
|
|
51
56
|
* doing nothing. It sits one place past `CROWD_REC_POOL_SLOT`, which is a VERTEX OFFSET — see the
|
|
52
57
|
* warning there about what confusing the two looks like.
|
|
53
58
|
*/
|
|
54
|
-
export const CROWD_REC_MATERIAL = 23;
|
|
55
59
|
/**
|
|
56
60
|
* Rows of the DRAW shader's material table, by name.
|
|
57
61
|
*
|
|
@@ -70,8 +74,6 @@ export const CROWD_MATERIALS = {
|
|
|
70
74
|
glass: 3,
|
|
71
75
|
wood: 4,
|
|
72
76
|
};
|
|
73
|
-
/** Rows in the WGSL `MATS` table — the bound `writeCrowdRecord` checks a material against. */
|
|
74
|
-
export const CROWD_MATERIAL_COUNT = 5;
|
|
75
77
|
/**
|
|
76
78
|
* Materials whose shader row has a non-zero REFRACTION strength (`c.y` in `MATS`).
|
|
77
79
|
*
|
|
@@ -511,41 +513,6 @@ export function validateBuckets(records, byLod, lodCount) {
|
|
|
511
513
|
}
|
|
512
514
|
return total;
|
|
513
515
|
}
|
|
514
|
-
/**
|
|
515
|
-
* Write ONE instance record. The single CPU-side statement of the layout the WGSL `Rec` struct
|
|
516
|
-
* mirrors — a caller that packs 24 floats by hand has a second one, and the two drift.
|
|
517
|
-
*
|
|
518
|
-
* `model` is column-major, as everything else in this engine. `tint`'s W IS THE OPACITY: it is what
|
|
519
|
-
* `splitByAlpha` reads to route an instance to the blended pipeline, so an alpha below 1 needs
|
|
520
|
-
* nothing else set anywhere.
|
|
521
|
-
*/
|
|
522
|
-
export function writeCrowdRecord(out, at, model, tint, layer, paletteSlot, poolSlot,
|
|
523
|
-
// ⚠️ OPTIONAL AND LAST, so every call site written before materials existed keeps both its
|
|
524
|
-
// meaning and its output. 0 is `skin`, whose table row is the all-zero one.
|
|
525
|
-
material = 0) {
|
|
526
|
-
if (model.length !== 16)
|
|
527
|
-
throw new Error(`writeCrowdRecord: model has ${model.length} floats, expected a column-major 16`);
|
|
528
|
-
if (tint.length !== 4)
|
|
529
|
-
throw new Error(`writeCrowdRecord: tint has ${tint.length} floats, expected rgba`);
|
|
530
|
-
if (at < 0 || at % CROWD_RECORD_FLOATS !== 0)
|
|
531
|
-
throw new Error(`writeCrowdRecord: offset ${at} is not a whole record (multiple of ${CROWD_RECORD_FLOATS})`);
|
|
532
|
-
if (at + CROWD_RECORD_FLOATS > out.length)
|
|
533
|
-
throw new Error(`writeCrowdRecord: record at ${at} overruns a ${out.length}-float array`);
|
|
534
|
-
out.set(model, at + CROWD_REC_MODEL);
|
|
535
|
-
out.set(tint, at + CROWD_REC_TINT);
|
|
536
|
-
out[at + CROWD_REC_LAYER] = layer;
|
|
537
|
-
out[at + CROWD_REC_PALETTE_SLOT] = paletteSlot;
|
|
538
|
-
out[at + CROWD_REC_POOL_SLOT] = poolSlot;
|
|
539
|
-
// ⚠️ Checked, not clamped. The shader indexes `MATS` with `u32(ids.w)` and WGSL does not
|
|
540
|
-
// bounds-check a constant array, so an out-of-range row reads whatever follows the table — which
|
|
541
|
-
// draws SOMETHING, plausibly, and is untraceable from the picture. A fraction is just as bad:
|
|
542
|
-
// u32(1.5) is a row nobody chose.
|
|
543
|
-
if (!Number.isInteger(material) ||
|
|
544
|
-
material < 0 ||
|
|
545
|
-
material >= CROWD_MATERIAL_COUNT)
|
|
546
|
-
throw new Error(`writeCrowdRecord: material ${material} is not one of the ${CROWD_MATERIAL_COUNT} rows in the shader's table`);
|
|
547
|
-
out[at + CROWD_REC_MATERIAL] = material;
|
|
548
|
-
}
|
|
549
516
|
/**
|
|
550
517
|
* Split each bucket into maximal runs of the same blend class, preserving order.
|
|
551
518
|
*
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { CrowdBucket, GpuCrowdRenderer } from './assets/gpuCrowd';
|
|
2
|
+
export declare const GPU_CHARACTER_FACE_CHANNELS = 47;
|
|
3
|
+
export declare const GPU_CHARACTER_VISIBLE = 1;
|
|
4
|
+
export interface GpuCharacterTiers {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
body: number;
|
|
7
|
+
face: number;
|
|
8
|
+
animation: number;
|
|
9
|
+
hair: number;
|
|
10
|
+
cloth: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function packGpuCharacterFlags(tiers: GpuCharacterTiers): number;
|
|
13
|
+
export declare function unpackGpuCharacterFlags(flags: number): GpuCharacterTiers;
|
|
14
|
+
export interface GpuCharactersOptions {
|
|
15
|
+
maxCharacters: number;
|
|
16
|
+
boneCount: number;
|
|
17
|
+
faceChannels?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface GpuCharacterIdentity {
|
|
20
|
+
revision: number;
|
|
21
|
+
morphWeights: Float32Array;
|
|
22
|
+
material: number;
|
|
23
|
+
skinLayer: number;
|
|
24
|
+
eyeLayer: number;
|
|
25
|
+
hairAsset: number;
|
|
26
|
+
garmentAssets: readonly number[];
|
|
27
|
+
}
|
|
28
|
+
export interface GpuCharacterIdentityUpdate extends GpuCharacterIdentity {
|
|
29
|
+
slot: number;
|
|
30
|
+
}
|
|
31
|
+
export interface GpuCharacterFrame {
|
|
32
|
+
count: number;
|
|
33
|
+
slots: Uint32Array;
|
|
34
|
+
/** count × 16, column-major model matrices. */
|
|
35
|
+
transforms: Float32Array;
|
|
36
|
+
/** count × boneCount × 16, column-major skin palettes. */
|
|
37
|
+
palettes: Float32Array;
|
|
38
|
+
/** count × faceChannels. */
|
|
39
|
+
faceWeights: Float32Array;
|
|
40
|
+
/** count × xyzr, in world space. */
|
|
41
|
+
bounds: Float32Array;
|
|
42
|
+
/** count packed visibility/tier flags. */
|
|
43
|
+
flags: Uint32Array;
|
|
44
|
+
}
|
|
45
|
+
export interface GpuCharactersBatch {
|
|
46
|
+
/** Cold changes since the preceding submitted frame. */
|
|
47
|
+
identityUpdates: readonly GpuCharacterIdentityUpdate[];
|
|
48
|
+
/** Slots removed since the preceding submitted frame. */
|
|
49
|
+
removedSlots: Uint32Array;
|
|
50
|
+
/** Hot arrays are passed through without an object-per-character conversion. */
|
|
51
|
+
frame: GpuCharacterFrame;
|
|
52
|
+
}
|
|
53
|
+
export interface GpuCharactersBackend {
|
|
54
|
+
submit(batch: GpuCharactersBatch): void;
|
|
55
|
+
dispose?(): void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The crowd renderer allocates vertex-pool offsets, while {@link GpuCharacters} allocates stable
|
|
59
|
+
* actor ordinals. A binding is the explicit bridge between those two address spaces.
|
|
60
|
+
*
|
|
61
|
+
* `poolSlots[lod]` and `facePoolSlots[lod]` are vertex offsets returned by the caller's crowd pool
|
|
62
|
+
* allocator, not actor ids. The optional face slot is a second allocation seeded and driven by
|
|
63
|
+
* `GpuCrowdRenderer.enableFaceRig`.
|
|
64
|
+
*/
|
|
65
|
+
export interface GpuCrowdCharacterBinding {
|
|
66
|
+
poolSlots: readonly number[];
|
|
67
|
+
facePoolSlots?: readonly (number | null)[];
|
|
68
|
+
tint?: Float32Array;
|
|
69
|
+
layer?: number;
|
|
70
|
+
}
|
|
71
|
+
/** The narrow renderer surface used by the concrete crowd backend (and by its CPU-only tests). */
|
|
72
|
+
export type GpuCrowdCharacterRenderer = Pick<GpuCrowdRenderer, 'morph' | 'enableFaceRig' | 'disableFaceRig' | 'setFaceWeights' | 'faceFrame' | 'setInstances' | 'setPalettes'>;
|
|
73
|
+
export interface GpuCrowdCharactersBackendOptions {
|
|
74
|
+
renderer: GpuCrowdCharacterRenderer;
|
|
75
|
+
boneCount: number;
|
|
76
|
+
faceChannels?: number;
|
|
77
|
+
/** Resolve/release vertex-pool allocations outside the hot frame path. */
|
|
78
|
+
resolveBinding: (identity: Readonly<GpuCharacterIdentityUpdate>) => GpuCrowdCharacterBinding;
|
|
79
|
+
releaseBinding?: (binding: GpuCrowdCharacterBinding, identity: Readonly<GpuCharacterIdentityUpdate>) => void;
|
|
80
|
+
/** Highest face quality tier that receives the per-frame face rig. Defaults to 1. */
|
|
81
|
+
maxRiggedFaceTier?: number;
|
|
82
|
+
}
|
|
83
|
+
export interface GpuCrowdCharactersPreparedFrame {
|
|
84
|
+
renderedCount: number;
|
|
85
|
+
/** Actor slots in the exact order of the crowd instance records and compact palette rows. */
|
|
86
|
+
actorSlots: Uint32Array;
|
|
87
|
+
records: Float32Array;
|
|
88
|
+
palettes: Float32Array;
|
|
89
|
+
buckets: readonly CrowdBucket[];
|
|
90
|
+
}
|
|
91
|
+
export interface GpuCharactersReport {
|
|
92
|
+
capacity: number;
|
|
93
|
+
live: number;
|
|
94
|
+
free: number;
|
|
95
|
+
submittedFrames: number;
|
|
96
|
+
lastCount: number;
|
|
97
|
+
coldUpdates: number;
|
|
98
|
+
removals: number;
|
|
99
|
+
/** Counts by tier for visible actors in the most recently submitted hot frame. */
|
|
100
|
+
lastTierCounts: Record<'body' | 'face' | 'animation' | 'hair' | 'cloth', number[]>;
|
|
101
|
+
}
|
|
102
|
+
/** Validate a hot frame without allocating or converting it. */
|
|
103
|
+
export declare function validateGpuCharacterFrame(frame: GpuCharacterFrame, options: Required<GpuCharactersOptions>): void;
|
|
104
|
+
export declare class GpuCharacters {
|
|
105
|
+
readonly options: Required<GpuCharactersOptions>;
|
|
106
|
+
private readonly backend;
|
|
107
|
+
private readonly identities;
|
|
108
|
+
private readonly freeSlots;
|
|
109
|
+
private readonly pendingUpdates;
|
|
110
|
+
private readonly pendingRemovals;
|
|
111
|
+
private submittedFrames;
|
|
112
|
+
private lastCount;
|
|
113
|
+
private coldUpdates;
|
|
114
|
+
private removals;
|
|
115
|
+
private lastTierCounts;
|
|
116
|
+
constructor(options: GpuCharactersOptions, backend?: GpuCharactersBackend);
|
|
117
|
+
spawn(identity: GpuCharacterIdentity): number;
|
|
118
|
+
updateIdentity(slot: number, identity: GpuCharacterIdentity): void;
|
|
119
|
+
remove(slot: number): void;
|
|
120
|
+
has(slot: number): boolean;
|
|
121
|
+
identity(slot: number): Readonly<GpuCharacterIdentityUpdate> | null;
|
|
122
|
+
submit(frame: GpuCharacterFrame): GpuCharactersBatch;
|
|
123
|
+
report(): GpuCharactersReport;
|
|
124
|
+
dispose(): void;
|
|
125
|
+
}
|
|
126
|
+
export declare function createGpuCharacters(options: GpuCharactersOptions, backend?: GpuCharactersBackend): GpuCharacters;
|
|
127
|
+
/**
|
|
128
|
+
* Concrete adapter from the retained character batch to {@link GpuCrowdRenderer}.
|
|
129
|
+
*
|
|
130
|
+
* It performs no render-pass encoding: `submit` uploads/morphs/rigs the crowd renderer, after
|
|
131
|
+
* which the game calls `GpuCrowdRenderer.frame` in its normal shared scene render pass. Keeping
|
|
132
|
+
* that final draw with the game is required because only the game owns the camera, depth target,
|
|
133
|
+
* shadows, fog and command encoder.
|
|
134
|
+
*/
|
|
135
|
+
export declare class GpuCrowdCharactersBackend implements GpuCharactersBackend {
|
|
136
|
+
private readonly renderer;
|
|
137
|
+
private readonly boneCount;
|
|
138
|
+
private readonly faceChannels;
|
|
139
|
+
private readonly maxRiggedFaceTier;
|
|
140
|
+
private readonly resolveBinding;
|
|
141
|
+
private readonly releaseBinding;
|
|
142
|
+
private readonly states;
|
|
143
|
+
private prepared;
|
|
144
|
+
constructor(options: GpuCrowdCharactersBackendOptions);
|
|
145
|
+
submit(batch: GpuCharactersBatch): void;
|
|
146
|
+
lastPreparedFrame(): GpuCrowdCharactersPreparedFrame;
|
|
147
|
+
dispose(): void;
|
|
148
|
+
private applyRemovals;
|
|
149
|
+
private applyIdentityUpdates;
|
|
150
|
+
private releaseState;
|
|
151
|
+
}
|
|
152
|
+
export declare function createGpuCrowdCharactersBackend(options: GpuCrowdCharactersBackendOptions): GpuCrowdCharactersBackend;
|