ice3 0.1.1 → 0.2.1
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/README.md +4 -0
- package/dist/_types/assets/ICEPreparedGLB.d.ts +1 -0
- package/dist/_types/assets/ICEPreviewGeometryPacket.d.ts +60 -0
- package/dist/_types/assets/index.d.ts +2 -0
- package/dist/_types/core/camera/ICEPerspectiveCamera.d.ts +3 -2
- package/dist/_types/core/geometry/ICEGeometry.d.ts +13 -0
- package/dist/_types/core/geometry/ICEIndexedGeometry.d.ts +3 -1
- package/dist/_types/core/index.d.ts +1 -1
- package/dist/_types/core/material/ICEBasicMaterial.d.ts +2 -0
- package/dist/_types/core/scene/ICENode.d.ts +6 -1
- package/dist/_types/renderer/Color.d.ts +2 -0
- package/dist/_types/renderer/FakeRendererBackend.d.ts +1 -1
- package/dist/_types/renderer/InstanceBatch.d.ts +14 -0
- package/dist/_types/renderer/RenderBatch.d.ts +17 -0
- package/dist/_types/renderer/Renderables.d.ts +9 -0
- package/dist/_types/renderer/RendererProfiler.d.ts +19 -0
- package/dist/_types/renderer/RendererSelection.d.ts +12 -0
- package/dist/_types/renderer/WebGL2GeometryBatch.d.ts +2 -9
- package/dist/_types/renderer/WebGL2GeometryCache.d.ts +16 -2
- package/dist/_types/renderer/WebGL2InstanceBatch.d.ts +3 -14
- package/dist/_types/renderer/WebGL2Program.d.ts +14 -0
- package/dist/_types/renderer/WebGL2RenderBatch.d.ts +1 -16
- package/dist/_types/renderer/WebGL2RendererBackend.d.ts +13 -2
- package/dist/_types/renderer/WebGL2ShadowMap.d.ts +26 -0
- package/dist/_types/renderer/WebGPUBundleCache.d.ts +14 -0
- package/dist/_types/renderer/WebGPUCapabilities.d.ts +23 -0
- package/dist/_types/renderer/WebGPUDrawStorage.d.ts +28 -0
- package/dist/_types/renderer/WebGPUGeometryCache.d.ts +59 -0
- package/dist/_types/renderer/WebGPUInstanceCache.d.ts +24 -0
- package/dist/_types/renderer/WebGPUInstanceStorage.d.ts +39 -0
- package/dist/_types/renderer/WebGPUPicker.d.ts +30 -0
- package/dist/_types/renderer/WebGPUProbe.d.ts +21 -0
- package/dist/_types/renderer/WebGPURenderPipeline.d.ts +22 -0
- package/dist/_types/renderer/WebGPURenderPlan.d.ts +23 -0
- package/dist/_types/renderer/WebGPURendererBackend.d.ts +113 -0
- package/dist/_types/renderer/WebGPUResources.d.ts +9 -0
- package/dist/_types/renderer/WebGPUSelectionMask.d.ts +18 -0
- package/dist/_types/renderer/WebGPUTimestampProfiler.d.ts +16 -0
- package/dist/_types/renderer/WebGPUVisibility.d.ts +27 -0
- package/dist/_types/renderer/index.d.ts +21 -7
- package/dist/_types/renderer/types.d.ts +17 -3
- package/dist/_types/runtime/ICE3.d.ts +16 -6
- package/dist/_types/runtime/asset/ICEAssetSceneBuilder.d.ts +8 -2
- package/dist/_types/runtime/asset/ICEPreviewPacketLoader.d.ts +25 -0
- package/dist/_types/runtime/asset/ICETilesetLoader.d.ts +0 -1
- package/dist/_types/runtime/index.d.ts +2 -1
- package/dist/_types/runtime/input/ICEOrbitController.d.ts +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4782 -330
- package/dist/index.js.map +4 -4
- package/package.json +2 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ICEInstanceBatch } from './InstanceBatch.js';
|
|
2
|
+
export interface WebGPUInstanceEntry {
|
|
3
|
+
readonly matrixBuffer: GPUBuffer;
|
|
4
|
+
readonly semanticBuffer: GPUBuffer;
|
|
5
|
+
instanceCount: number;
|
|
6
|
+
readonly bytes: number;
|
|
7
|
+
readonly generation: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class WebGPUInstanceCache {
|
|
10
|
+
private readonly device;
|
|
11
|
+
private readonly entries;
|
|
12
|
+
private active;
|
|
13
|
+
private bufferGeneration;
|
|
14
|
+
constructor(device: GPUDevice);
|
|
15
|
+
retain(batch: ICEInstanceBatch): WebGPUInstanceEntry;
|
|
16
|
+
beginFrame(): void;
|
|
17
|
+
endFrame(): void;
|
|
18
|
+
clear(): void;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
get totalBytes(): number;
|
|
21
|
+
get generation(): number;
|
|
22
|
+
private deleteEntry;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=WebGPUInstanceCache.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ICEGeometry } from '../core/index.js';
|
|
2
|
+
import type { ICEInstanceBatch } from './InstanceBatch.js';
|
|
3
|
+
export declare const INSTANCE_RECORD_BYTES = 96;
|
|
4
|
+
export type ICEInstanceStoragePagePlan = Readonly<{
|
|
5
|
+
firstInstance: number;
|
|
6
|
+
instanceCount: number;
|
|
7
|
+
}>;
|
|
8
|
+
export type ICEInstanceStoragePage = ICEInstanceStoragePagePlan & {
|
|
9
|
+
readonly buffer: GPUBuffer;
|
|
10
|
+
};
|
|
11
|
+
export type ICEInstanceStorageEntry = Readonly<{
|
|
12
|
+
pages: readonly ICEInstanceStoragePage[];
|
|
13
|
+
generation: number;
|
|
14
|
+
bytes: number;
|
|
15
|
+
}>;
|
|
16
|
+
export type WebGPUInstanceStorageOptions = {
|
|
17
|
+
readonly maxBindingBytes: number;
|
|
18
|
+
readonly minOffsetAlignment: number;
|
|
19
|
+
};
|
|
20
|
+
export declare class WebGPUInstanceStorage {
|
|
21
|
+
private readonly device;
|
|
22
|
+
private readonly entries;
|
|
23
|
+
private active;
|
|
24
|
+
private resourceGeneration;
|
|
25
|
+
private uploadBytes;
|
|
26
|
+
private readonly maxBindingBytes;
|
|
27
|
+
private readonly minOffsetAlignment;
|
|
28
|
+
constructor(device: GPUDevice, options?: Partial<WebGPUInstanceStorageOptions>);
|
|
29
|
+
plan(instanceCount: number, recordBytes?: number): readonly ICEInstanceStoragePagePlan[];
|
|
30
|
+
retain(batch: ICEInstanceBatch, geometry: ICEGeometry): ICEInstanceStorageEntry;
|
|
31
|
+
beginFrame(): void;
|
|
32
|
+
endFrame(): void;
|
|
33
|
+
get generation(): number;
|
|
34
|
+
get totalBytes(): number;
|
|
35
|
+
get totalUploadBytes(): number;
|
|
36
|
+
dispose(): void;
|
|
37
|
+
private delete;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=WebGPUInstanceStorage.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WebGPUGeometryCache } from './WebGPUGeometryCache.js';
|
|
2
|
+
import type { ICEFrame, ICEScreenPoint } from './types.js';
|
|
3
|
+
type ICEPickFrame = ICEFrame & {
|
|
4
|
+
readonly point: ICEScreenPoint;
|
|
5
|
+
};
|
|
6
|
+
export declare class WebGPUPicker {
|
|
7
|
+
private readonly device;
|
|
8
|
+
private readonly pipelinePromise;
|
|
9
|
+
private readonly instanceCache;
|
|
10
|
+
private readonly identityInstances;
|
|
11
|
+
private readonly zeroSemantics;
|
|
12
|
+
private readonly renderPlan;
|
|
13
|
+
private target;
|
|
14
|
+
private depth;
|
|
15
|
+
private uniformBuffer;
|
|
16
|
+
private width;
|
|
17
|
+
private height;
|
|
18
|
+
private disposed;
|
|
19
|
+
constructor(device: GPUDevice, format: GPUTextureFormat);
|
|
20
|
+
pick(frame: ICEPickFrame, geometryCache: WebGPUGeometryCache, pickIds: Readonly<Record<number, string>>): Promise<string | undefined>;
|
|
21
|
+
resize(width: number, height: number): void;
|
|
22
|
+
dispose(): void;
|
|
23
|
+
private ensureTarget;
|
|
24
|
+
private ensureUniformBuffer;
|
|
25
|
+
private uniformBufferCapacity;
|
|
26
|
+
private uniformBufferDraws;
|
|
27
|
+
}
|
|
28
|
+
export declare function collectWebGPUPickIds(frame: ICEFrame): Readonly<Record<number, string>>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=WebGPUPicker.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type ICEWebGPUProbeFailureReason = 'document-unavailable' | 'api-unavailable' | 'adapter-unavailable' | 'adapter-timeout' | 'feature-missing' | 'limit-too-low' | 'device-failed' | 'context-failed' | 'pipeline-failed' | 'device-lost';
|
|
2
|
+
export type ICEWebGPUProbeResult = {
|
|
3
|
+
readonly supported: true;
|
|
4
|
+
readonly adapter: GPUAdapter;
|
|
5
|
+
readonly device: GPUDevice;
|
|
6
|
+
readonly format: GPUTextureFormat;
|
|
7
|
+
readonly enabledFeatures: ReadonlySet<GPUFeatureName>;
|
|
8
|
+
readonly release: () => void;
|
|
9
|
+
} | {
|
|
10
|
+
readonly supported: false;
|
|
11
|
+
readonly reason: ICEWebGPUProbeFailureReason;
|
|
12
|
+
readonly detail?: string;
|
|
13
|
+
};
|
|
14
|
+
export type ICEWebGPUProbeOptions = {
|
|
15
|
+
readonly gpu?: GPU;
|
|
16
|
+
readonly timeoutMs?: number;
|
|
17
|
+
readonly createCanvas?: () => OffscreenCanvas | HTMLCanvasElement;
|
|
18
|
+
readonly optionalFeatures?: readonly GPUFeatureName[];
|
|
19
|
+
};
|
|
20
|
+
export declare function probeWebGPU(options?: ICEWebGPUProbeOptions): Promise<ICEWebGPUProbeResult>;
|
|
21
|
+
//# sourceMappingURL=WebGPUProbe.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const WEBGPU_UNIFORM_STRIDE = 256;
|
|
2
|
+
export declare const WEBGPU_UNIFORM_BYTES = 144;
|
|
3
|
+
export declare class WebGPURenderPipeline {
|
|
4
|
+
readonly device: GPUDevice;
|
|
5
|
+
readonly format: GPUTextureFormat;
|
|
6
|
+
readonly bindGroupLayout: GPUBindGroupLayout;
|
|
7
|
+
readonly pipelineLayout: GPUPipelineLayout;
|
|
8
|
+
readonly triangle: GPURenderPipeline;
|
|
9
|
+
readonly line: GPURenderPipeline;
|
|
10
|
+
readonly selectionTriangle: GPURenderPipeline;
|
|
11
|
+
readonly selectionLine: GPURenderPipeline;
|
|
12
|
+
readonly selectionMask: boolean;
|
|
13
|
+
readonly storageInstances: boolean;
|
|
14
|
+
readonly indirectInstances: boolean;
|
|
15
|
+
private constructor();
|
|
16
|
+
static create(device: GPUDevice, format: GPUTextureFormat, options?: {
|
|
17
|
+
readonly selectionMask?: boolean;
|
|
18
|
+
readonly storageInstances?: boolean;
|
|
19
|
+
readonly indirectInstances?: boolean;
|
|
20
|
+
}): Promise<WebGPURenderPipeline>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=WebGPURenderPipeline.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ICEScene } from '../core/index.js';
|
|
2
|
+
import { type ICEGeometryRenderable } from './Renderables.js';
|
|
3
|
+
import { type ICEInstanceBatch } from './InstanceBatch.js';
|
|
4
|
+
import { type ICERenderBatchDraw } from './RenderBatch.js';
|
|
5
|
+
export type WebGPURenderPlan = Readonly<{
|
|
6
|
+
scene: ICEScene;
|
|
7
|
+
revision: number;
|
|
8
|
+
renderables: readonly ICEGeometryRenderable[];
|
|
9
|
+
instances: readonly ICEInstanceBatch[];
|
|
10
|
+
batches: readonly ICERenderBatchDraw[];
|
|
11
|
+
instancedMeshIds: ReadonlySet<string>;
|
|
12
|
+
}>;
|
|
13
|
+
export declare class WebGPURenderPlanCache {
|
|
14
|
+
private scene;
|
|
15
|
+
private current;
|
|
16
|
+
private readonly renderablesScratch;
|
|
17
|
+
private readonly instancesScratch;
|
|
18
|
+
private readonly batchesScratch;
|
|
19
|
+
get(scene: ICEScene): WebGPURenderPlan;
|
|
20
|
+
invalidate(): void;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=WebGPURenderPlan.d.ts.map
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { ICEEngineError, type ICEGeometry } from '../core/index.js';
|
|
2
|
+
import type { ICERendererBackend, ICERendererCapabilities, ICEFrame, ICEViewport } from './types.js';
|
|
3
|
+
import { type ICEFrameStageProfile } from './RendererProfiler.js';
|
|
4
|
+
import { type ICEWebGPUOptimizationStats } from './WebGPUCapabilities.js';
|
|
5
|
+
import type { ICEScreenPoint } from './types.js';
|
|
6
|
+
export type WebGPUDeviceContext = Readonly<{
|
|
7
|
+
adapter: GPUAdapter;
|
|
8
|
+
device: GPUDevice;
|
|
9
|
+
format: GPUTextureFormat;
|
|
10
|
+
release?: () => void;
|
|
11
|
+
}>;
|
|
12
|
+
export type WebGPURendererBackendOptions = Readonly<{
|
|
13
|
+
readonly forceStoragePath?: boolean;
|
|
14
|
+
readonly forceGpuDriven?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export declare class WebGPURendererBackend implements ICERendererBackend {
|
|
17
|
+
capabilities: Readonly<ICERendererCapabilities>;
|
|
18
|
+
private readonly adapter;
|
|
19
|
+
private device;
|
|
20
|
+
private readonly format;
|
|
21
|
+
private pipeline;
|
|
22
|
+
private storagePipeline;
|
|
23
|
+
private gpuDrivenPipeline;
|
|
24
|
+
private visibilityEncoder;
|
|
25
|
+
private storageCache;
|
|
26
|
+
private readonly acceleration;
|
|
27
|
+
private readonly forceStoragePath;
|
|
28
|
+
private readonly forceGpuDriven;
|
|
29
|
+
private readonly releaseProbe;
|
|
30
|
+
private onContextLost;
|
|
31
|
+
private onContextRestored;
|
|
32
|
+
private onError;
|
|
33
|
+
private disposing;
|
|
34
|
+
private canvas;
|
|
35
|
+
private context;
|
|
36
|
+
private geometryCache;
|
|
37
|
+
private instanceCache;
|
|
38
|
+
private picker;
|
|
39
|
+
private selectionMaskBuffer;
|
|
40
|
+
private timestampProfiler;
|
|
41
|
+
private timestampProfilingEnabled;
|
|
42
|
+
private bundleCache;
|
|
43
|
+
private bundleActive;
|
|
44
|
+
private frameBindGroup;
|
|
45
|
+
private frameBindGroupKey;
|
|
46
|
+
private readonly storageBindGroups;
|
|
47
|
+
private uniformBufferGeneration;
|
|
48
|
+
private readonly optimizationWarnings;
|
|
49
|
+
private identityInstances;
|
|
50
|
+
private zeroSemantics;
|
|
51
|
+
private uniformBuffer;
|
|
52
|
+
private depthTexture;
|
|
53
|
+
private uniformCapacity;
|
|
54
|
+
private viewport;
|
|
55
|
+
private dpr;
|
|
56
|
+
private backgroundRgba;
|
|
57
|
+
private frameStats;
|
|
58
|
+
private lastFrame;
|
|
59
|
+
private captureRequest;
|
|
60
|
+
private readonly renderPlan;
|
|
61
|
+
private readonly drawListScratch;
|
|
62
|
+
private readonly selected;
|
|
63
|
+
private readonly drawStorage;
|
|
64
|
+
private readonly lastVisibilityEntries;
|
|
65
|
+
private readonly mvpScratch;
|
|
66
|
+
private readonly worldScratch;
|
|
67
|
+
private readonly profiler;
|
|
68
|
+
private lastFrameProfile;
|
|
69
|
+
private optimizationFailureReason;
|
|
70
|
+
private storageFailureReason;
|
|
71
|
+
private visibilityFailureReason;
|
|
72
|
+
private constructor();
|
|
73
|
+
static create(context: WebGPUDeviceContext, options?: WebGPURendererBackendOptions): Promise<WebGPURendererBackend>;
|
|
74
|
+
initialize(options: {
|
|
75
|
+
readonly canvas: HTMLCanvasElement;
|
|
76
|
+
readonly onContextLost?: () => void;
|
|
77
|
+
readonly onContextRestored?: () => void;
|
|
78
|
+
readonly onError?: (error: ICEEngineError) => void;
|
|
79
|
+
}): void;
|
|
80
|
+
resize(viewport: ICEViewport, dpr: number): void;
|
|
81
|
+
setBackgroundColor(color: string): void;
|
|
82
|
+
prepareBatchGeometry(geometry: ICEGeometry): void;
|
|
83
|
+
prepareGeometry(geometry: ICEGeometry, update?: import('../core/index.js').ICEGeometryBufferUpdate): void;
|
|
84
|
+
releaseGeometry(geometry: ICEGeometry): void;
|
|
85
|
+
releaseBatchGeometry(geometry: ICEGeometry): void;
|
|
86
|
+
render(frame: ICEFrame): void;
|
|
87
|
+
enableProfiling(enabled: boolean): void;
|
|
88
|
+
get frameProfile(): ICEFrameStageProfile | null;
|
|
89
|
+
pick(frame: ICEFrame, point: ICEScreenPoint): Promise<string | undefined>;
|
|
90
|
+
dispose(): void;
|
|
91
|
+
capture(): Promise<Blob>;
|
|
92
|
+
finish(): Promise<void>;
|
|
93
|
+
drainGpuTimings(): Promise<readonly number[]>;
|
|
94
|
+
enableTimestampProfiling(enabled: boolean): void;
|
|
95
|
+
get timestampProfilingAvailable(): boolean;
|
|
96
|
+
get timestampProfilingUnavailableReason(): string | undefined;
|
|
97
|
+
get stats(): Readonly<typeof this.frameStats>;
|
|
98
|
+
readVisibilityStats(): Promise<Readonly<{
|
|
99
|
+
visibleInstances: number;
|
|
100
|
+
culledInstances: number;
|
|
101
|
+
dispatchCount: number;
|
|
102
|
+
}> | undefined>;
|
|
103
|
+
get storageActive(): boolean;
|
|
104
|
+
private get gpuDrivenActive();
|
|
105
|
+
get optimizationStats(): ICEWebGPUOptimizationStats;
|
|
106
|
+
private storageBindGroupFor;
|
|
107
|
+
private reportOptimizationFailure;
|
|
108
|
+
private requireGeometryCache;
|
|
109
|
+
private ensureUniformCapacity;
|
|
110
|
+
private watchDevice;
|
|
111
|
+
private recoverDevice;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=WebGPURendererBackend.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const WEBGPU_BUFFER_USAGE: {
|
|
2
|
+
readonly vertex: number;
|
|
3
|
+
readonly index: number;
|
|
4
|
+
};
|
|
5
|
+
export declare function alignToFourBytes(value: number): number;
|
|
6
|
+
export declare function createGPUDataBuffer(device: GPUDevice, data: ArrayBufferView, usage: GPUBufferUsageFlags, label: string): GPUBuffer;
|
|
7
|
+
export declare function createEmptyGPUDataBuffer(device: GPUDevice, byteLength: number, usage: GPUBufferUsageFlags, label: string): GPUBuffer;
|
|
8
|
+
export declare function writeGPUData(device: GPUDevice, buffer: GPUBuffer, data: ArrayBufferView): void;
|
|
9
|
+
//# sourceMappingURL=WebGPUResources.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type ICESelectionMaskLayout = Readonly<{
|
|
2
|
+
words: Uint32Array;
|
|
3
|
+
bases: readonly number[];
|
|
4
|
+
}>;
|
|
5
|
+
export declare function buildSelectionMask(ranges: readonly (readonly string[])[], selection: readonly string[]): ICESelectionMaskLayout;
|
|
6
|
+
export declare class WebGPUSelectionMaskBuffer {
|
|
7
|
+
private readonly device;
|
|
8
|
+
private maskBuffer;
|
|
9
|
+
private previous;
|
|
10
|
+
private maskGeneration;
|
|
11
|
+
constructor(device: GPUDevice);
|
|
12
|
+
get buffer(): GPUBuffer | null;
|
|
13
|
+
get generation(): number;
|
|
14
|
+
get totalBytes(): number;
|
|
15
|
+
update(words: Uint32Array): void;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=WebGPUSelectionMask.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class WebGPUTimestampProfiler {
|
|
2
|
+
private readonly device;
|
|
3
|
+
private readonly slots;
|
|
4
|
+
private readonly pending;
|
|
5
|
+
private reason;
|
|
6
|
+
private disposed;
|
|
7
|
+
constructor(device: GPUDevice, slotCount?: number);
|
|
8
|
+
get unavailableReason(): string | undefined;
|
|
9
|
+
querySetFor(frameId: number): GPUQuerySet;
|
|
10
|
+
resolveFrame(encoder: GPUCommandEncoder, frameId: number): void;
|
|
11
|
+
drain(): Promise<readonly number[]>;
|
|
12
|
+
dispose(): void;
|
|
13
|
+
private slotFor;
|
|
14
|
+
private slotIndex;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=WebGPUTimestampProfiler.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ICEGeometryBounds } from '../core/index.js';
|
|
2
|
+
import type { ICEInstanceStoragePage } from './WebGPUInstanceStorage.js';
|
|
3
|
+
export declare function createIndirectArguments(indexCount: number, firstIndex: number, baseVertex: number): Uint32Array | undefined;
|
|
4
|
+
export declare function isAabbVisible(matrix: ArrayLike<number>, bounds: ICEGeometryBounds, viewProjection: ArrayLike<number>): boolean;
|
|
5
|
+
export type ICEVisibilityEntry = Readonly<{
|
|
6
|
+
readonly visibleBuffer: GPUBuffer;
|
|
7
|
+
readonly indirectBuffer: GPUBuffer;
|
|
8
|
+
readonly instanceCount: number;
|
|
9
|
+
}>;
|
|
10
|
+
export declare class WebGPUVisibilityEncoder {
|
|
11
|
+
private readonly device;
|
|
12
|
+
readonly bindGroupLayout: GPUBindGroupLayout;
|
|
13
|
+
readonly pipeline: GPUComputePipeline;
|
|
14
|
+
private readonly entries;
|
|
15
|
+
private constructor();
|
|
16
|
+
static create(device: GPUDevice): Promise<WebGPUVisibilityEncoder>;
|
|
17
|
+
retain(page: ICEInstanceStoragePage, indexCount: number): ICEVisibilityEntry;
|
|
18
|
+
encode(encoder: GPUCommandEncoder, entry: ICEVisibilityEntry, page: ICEInstanceStoragePage, uniformBuffer: GPUBuffer, uniformOffset: number): void;
|
|
19
|
+
readStats(entry: ICEVisibilityEntry, page: ICEInstanceStoragePage): Promise<Readonly<{
|
|
20
|
+
visibleInstances: number;
|
|
21
|
+
culledInstances: number;
|
|
22
|
+
dispatchCount: number;
|
|
23
|
+
}>>;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
private destroy;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=WebGPUVisibility.d.ts.map
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
export { FakeRendererBackend } from './FakeRendererBackend.js';
|
|
2
2
|
export { WebGL2RendererBackend, colorToRgba, } from './WebGL2RendererBackend.js';
|
|
3
|
-
export {
|
|
4
|
-
export type
|
|
5
|
-
export {
|
|
6
|
-
export type {
|
|
3
|
+
export { selectDefaultRendererBackend, selectRendererBackend, type ICERendererBackendSelection, type ICERendererFactories, } from './RendererSelection.js';
|
|
4
|
+
export { WebGPURendererBackend, type WebGPUDeviceContext, } from './WebGPURendererBackend.js';
|
|
5
|
+
export { probeWebGPU } from './WebGPUProbe.js';
|
|
6
|
+
export type { ICEWebGPUProbeFailureReason, ICEWebGPUProbeOptions, ICEWebGPUProbeResult, } from './WebGPUProbe.js';
|
|
7
|
+
export { WebGPUGeometryCache, type WebGPUGeometryCacheOptions, type WebGPUGeometryEntry, } from './WebGPUGeometryCache.js';
|
|
8
|
+
export { WebGPUInstanceCache, type WebGPUInstanceEntry, } from './WebGPUInstanceCache.js';
|
|
9
|
+
export { WebGPUDrawStorage, type ICEWebGPUDrawUniform, } from './WebGPUDrawStorage.js';
|
|
10
|
+
export { WebGPURenderPlanCache, type WebGPURenderPlan, } from './WebGPURenderPlan.js';
|
|
11
|
+
export { detectWebGPUAcceleration, WEBGPU_GPU_DRIVEN_DEFAULT, WEBGPU_INSTANCE_VISIBILITY_THRESHOLD, WEBGPU_STORAGE_DEFAULT, type ICEWebGPUAcceleration, type ICEWebGPUAccelerationTier, type ICEWebGPUOptimizationStats, } from './WebGPUCapabilities.js';
|
|
12
|
+
export { INSTANCE_RECORD_BYTES, WebGPUInstanceStorage, type ICEInstanceStorageEntry, type ICEInstanceStoragePage, type ICEInstanceStoragePagePlan, type WebGPUInstanceStorageOptions, } from './WebGPUInstanceStorage.js';
|
|
13
|
+
export { createIndirectArguments, isAabbVisible, WebGPUVisibilityEncoder, type ICEVisibilityEntry, } from './WebGPUVisibility.js';
|
|
14
|
+
export { WebGPUBundleCache } from './WebGPUBundleCache.js';
|
|
15
|
+
export { buildSelectionMask, WebGPUSelectionMaskBuffer, type ICESelectionMaskLayout, } from './WebGPUSelectionMask.js';
|
|
16
|
+
export { collectWebGPUPickIds, WebGPUPicker, } from './WebGPUPicker.js';
|
|
17
|
+
export { collectRenderables, selectionIdentity, type ICEGeometryRenderable, } from './Renderables.js';
|
|
18
|
+
export { collectInstanceBatches, type ICEInstanceBatch, } from './InstanceBatch.js';
|
|
7
19
|
export { queueBatchGeneration } from './ICEWebGL2BatchGenerationUploader.js';
|
|
20
|
+
export type { ICEFrameStageProfile, } from './RendererProfiler.js';
|
|
21
|
+
export { RendererProfiler, } from './RendererProfiler.js';
|
|
22
|
+
export { WebGPUTimestampProfiler } from './WebGPUTimestampProfiler.js';
|
|
8
23
|
export type { ICEBatchGenerationHandle, ICEBatchUploadBuffer, ICEBatchUploadOptions, } from './ICEWebGL2BatchGenerationUploader.js';
|
|
9
|
-
export { collectRenderBatches } from './
|
|
10
|
-
export type {
|
|
11
|
-
export type { ICERendererBackend, ICERendererCapabilities, ICERendererStats, ICEFrame, ICEScreenPoint, ICEViewport, } from './types.js';
|
|
24
|
+
export { collectRenderBatches, semanticSelectionId, type ICERenderBatchDraw, type ICERenderBatchNode, } from './RenderBatch.js';
|
|
25
|
+
export type { ICERendererBackend, ICERendererCapabilities, ICERendererStats, ICEFrame, ICEScreenPoint, ICEViewport, ICE3RendererPreference, ICE3RendererSelection, ICEWebGPUOptimizationFailureReason, } from './types.js';
|
|
12
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import type { ICEGeometry, ICEPerspectiveCamera, ICEScene } from '../core/index.js';
|
|
1
|
+
import type { ICEGeometry, ICEGeometryBufferUpdate, ICEEngineError, ICEPerspectiveCamera, ICEScene } from '../core/index.js';
|
|
2
2
|
export type ICEViewport = {
|
|
3
3
|
readonly x: number;
|
|
4
4
|
readonly y: number;
|
|
5
5
|
readonly width: number;
|
|
6
6
|
readonly height: number;
|
|
7
7
|
};
|
|
8
|
+
export type ICEWebGPUOptimizationFailureReason = 'limit-too-low' | 'pipeline-failed' | 'resource-failed' | 'runtime-failed' | 'threshold-not-met';
|
|
9
|
+
export type ICE3RendererPreference = 'auto' | 'webgpu' | 'webgl2';
|
|
10
|
+
export type ICE3RendererSelection = Readonly<{
|
|
11
|
+
requested: ICE3RendererPreference | 'custom';
|
|
12
|
+
selected: 'webgl2' | 'webgpu' | 'fake';
|
|
13
|
+
fallback: boolean;
|
|
14
|
+
experimental: boolean;
|
|
15
|
+
probeDurationMs?: number;
|
|
16
|
+
fallbackReason?: import('./WebGPUProbe.js').ICEWebGPUProbeFailureReason;
|
|
17
|
+
}>;
|
|
8
18
|
export type ICEScreenPoint = Readonly<{
|
|
9
19
|
x: number;
|
|
10
20
|
y: number;
|
|
@@ -18,7 +28,7 @@ export type ICEFrame = {
|
|
|
18
28
|
readonly selection: readonly string[];
|
|
19
29
|
};
|
|
20
30
|
export interface ICERendererCapabilities {
|
|
21
|
-
readonly backend: 'webgl2' | 'fake';
|
|
31
|
+
readonly backend: 'webgl2' | 'webgpu' | 'fake';
|
|
22
32
|
readonly maxTextureSize: number;
|
|
23
33
|
readonly picking: boolean;
|
|
24
34
|
}
|
|
@@ -38,13 +48,17 @@ export interface ICERendererBackend {
|
|
|
38
48
|
readonly canvas: HTMLCanvasElement;
|
|
39
49
|
readonly onContextLost?: () => void;
|
|
40
50
|
readonly onContextRestored?: () => void;
|
|
51
|
+
readonly onError?: (error: ICEEngineError) => void;
|
|
41
52
|
}): void;
|
|
42
53
|
resize(viewport: ICEViewport, dpr: number): void;
|
|
43
54
|
setBackgroundColor?(color: string): void;
|
|
44
55
|
prepareBatchGeometry?(geometry: ICEGeometry): void;
|
|
45
56
|
releaseBatchGeometry?(geometry: ICEGeometry): void;
|
|
46
|
-
|
|
57
|
+
prepareGeometry?(geometry: ICEGeometry, update?: ICEGeometryBufferUpdate): void;
|
|
58
|
+
releaseGeometry?(geometry: ICEGeometry): void;
|
|
59
|
+
pick?(frame: ICEFrame, point: ICEScreenPoint): Promise<string | undefined>;
|
|
47
60
|
render(frame: ICEFrame): void;
|
|
61
|
+
finish?(): Promise<void>;
|
|
48
62
|
capture?(): Promise<Blob>;
|
|
49
63
|
dispose(): void;
|
|
50
64
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICEEventDispatcher, ICEPerspectiveCamera, ICEScene, type ICEDiagnostic, type ICEGeometry, type ICENode } from '../core/index.js';
|
|
2
|
-
import { type ICERendererBackend, type ICEScreenPoint, type ICEViewport } from '../renderer/index.js';
|
|
2
|
+
import { type ICE3RendererPreference, type ICE3RendererSelection, type ICERendererBackend, type ICEScreenPoint, type ICEViewport } from '../renderer/index.js';
|
|
3
3
|
import { ICE2DLayer } from './layer/ICE2DLayer.js';
|
|
4
4
|
import { type ICEProjectedPoint } from './ICEProjection.js';
|
|
5
5
|
import { type ICERenderScheduler } from './ICERenderScheduler.js';
|
|
@@ -7,6 +7,7 @@ import type { ICEVector3Tuple } from '../core/index.js';
|
|
|
7
7
|
import { type ICERay, type ICESceneItem, type ICESceneQuery } from './query/ICESceneQuery.js';
|
|
8
8
|
export type ICE3Options = {
|
|
9
9
|
readonly backend?: ICERendererBackend;
|
|
10
|
+
readonly renderer?: ICE3RendererPreference;
|
|
10
11
|
readonly scheduler?: ICERenderScheduler;
|
|
11
12
|
};
|
|
12
13
|
export type ICEEngineDiagnostics = {
|
|
@@ -14,10 +15,11 @@ export type ICEEngineDiagnostics = {
|
|
|
14
15
|
readonly fps: number;
|
|
15
16
|
readonly cpuFrameTimeMs: number;
|
|
16
17
|
readonly backend: Readonly<{
|
|
17
|
-
backend: 'webgl2' | 'fake';
|
|
18
|
+
backend: 'webgl2' | 'webgpu' | 'fake';
|
|
18
19
|
maxTextureSize: number;
|
|
19
20
|
picking: boolean;
|
|
20
21
|
}>;
|
|
22
|
+
readonly rendererSelection: Readonly<ICE3RendererSelection>;
|
|
21
23
|
readonly nodeCount: number;
|
|
22
24
|
readonly layerCount: number;
|
|
23
25
|
readonly labelCount: number;
|
|
@@ -53,7 +55,9 @@ export type ICEEngineDiagnostics = {
|
|
|
53
55
|
readonly lastDiagnostic?: Readonly<ICEDiagnostic>;
|
|
54
56
|
};
|
|
55
57
|
export declare class ICE3 extends ICEEventDispatcher {
|
|
56
|
-
private
|
|
58
|
+
private backend;
|
|
59
|
+
private readonly rendererPreference;
|
|
60
|
+
private rendererSelection;
|
|
57
61
|
private readonly scheduler;
|
|
58
62
|
private readonly interaction;
|
|
59
63
|
private readonly layers;
|
|
@@ -82,15 +86,20 @@ export declare class ICE3 extends ICEEventDispatcher {
|
|
|
82
86
|
private readonly pointerGestures;
|
|
83
87
|
private lastDiagnostic;
|
|
84
88
|
private instancingFallbackReported;
|
|
89
|
+
private pickGeneration;
|
|
85
90
|
private readonly removeInputListeners;
|
|
86
91
|
private readonly handleWindowResize;
|
|
87
92
|
constructor(options?: ICE3Options);
|
|
88
93
|
init(target: string | HTMLElement): this;
|
|
94
|
+
initAsync(target: string | HTMLElement): Promise<this>;
|
|
95
|
+
private initializeWithBackend;
|
|
89
96
|
setScene(scene: ICEScene): this;
|
|
90
97
|
setCamera(camera: ICEPerspectiveCamera): this;
|
|
91
98
|
setBackgroundColor(color: string): this;
|
|
92
99
|
prepareRenderBatchGeometry(geometry: ICEGeometry): this;
|
|
93
100
|
releaseRenderBatchGeometry(geometry: ICEGeometry): this;
|
|
101
|
+
prepareGeometry(geometry: ICEGeometry, update?: import('../core/index.js').ICEGeometryBufferUpdate): this;
|
|
102
|
+
releaseGeometry(geometry: ICEGeometry): this;
|
|
94
103
|
addLayer(layer: ICE2DLayer): this;
|
|
95
104
|
removeLayer(layer: ICE2DLayer): this;
|
|
96
105
|
start(): this;
|
|
@@ -102,10 +111,11 @@ export declare class ICE3 extends ICEEventDispatcher {
|
|
|
102
111
|
findBySelectionId(selectionId: string): ICENode | undefined;
|
|
103
112
|
raycast(ray: ICERay): ICESceneItem | undefined;
|
|
104
113
|
setSelection(ids: readonly string[]): this;
|
|
105
|
-
pick(point: ICEScreenPoint): ICENode | undefined
|
|
106
|
-
pickItem(point: ICEScreenPoint): {
|
|
114
|
+
pick(point: ICEScreenPoint): Promise<ICENode | undefined>;
|
|
115
|
+
pickItem(point: ICEScreenPoint): Promise<{
|
|
107
116
|
readonly item?: ICESceneItem;
|
|
108
|
-
}
|
|
117
|
+
}>;
|
|
118
|
+
capture(): Promise<Blob>;
|
|
109
119
|
getDiagnostics(): Readonly<ICEEngineDiagnostics>;
|
|
110
120
|
destroy(): void;
|
|
111
121
|
resize(): this;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import type { ICEPreparedAssetSnapshot, ICEPreparedStats } from '../../assets/index.js';
|
|
2
|
-
import { ICEScene, type ICEGeometryBounds } from '../../core/index.js';
|
|
1
|
+
import type { ICEPreparedAssetSnapshot, ICEPreparedStats, ICEPreviewGeometryPacket } from '../../assets/index.js';
|
|
2
|
+
import { ICEIndexedGeometry, ICEScene, type ICEGeometryBounds, type ICEGeometryBufferUpdate } from '../../core/index.js';
|
|
3
3
|
export interface ICEBuiltAsset {
|
|
4
4
|
readonly scene: ICEScene;
|
|
5
5
|
readonly bounds: ICEGeometryBounds;
|
|
6
6
|
readonly stats: ICEPreparedStats;
|
|
7
7
|
}
|
|
8
|
+
export interface ICEBuiltPreviewPacket {
|
|
9
|
+
readonly scene: ICEScene;
|
|
10
|
+
readonly geometries: ReadonlyMap<string, ICEIndexedGeometry>;
|
|
11
|
+
readonly geometryUpdates: ReadonlyMap<string, ICEGeometryBufferUpdate>;
|
|
12
|
+
}
|
|
8
13
|
export declare function buildAssetScene(snapshot: ICEPreparedAssetSnapshot): ICEBuiltAsset;
|
|
14
|
+
export declare function buildPreviewPacketScene(packet: ICEPreviewGeometryPacket, previousGeometries?: ReadonlyMap<string, ICEIndexedGeometry>): ICEBuiltPreviewPacket;
|
|
9
15
|
//# sourceMappingURL=ICEAssetSceneBuilder.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ICEPreviewGeometryPacket } from '../../assets/index.js';
|
|
2
|
+
import type { ICEGeometryBufferUpdate, ICEIndexedGeometry, ICEScene } from '../../core/index.js';
|
|
3
|
+
export type ICEPreviewPacketFallbackReason = 'packet-unavailable' | 'packet-invalid' | 'packet-revision-mismatch';
|
|
4
|
+
export type ICEPreviewPacketLoadResult = {
|
|
5
|
+
readonly kind: 'packet';
|
|
6
|
+
readonly packet: ICEPreviewGeometryPacket;
|
|
7
|
+
} | {
|
|
8
|
+
readonly kind: 'fallback';
|
|
9
|
+
readonly reason: ICEPreviewPacketFallbackReason;
|
|
10
|
+
};
|
|
11
|
+
export interface ICEPreviewPacketLoaderOptions {
|
|
12
|
+
readonly fetch?: typeof fetch;
|
|
13
|
+
readonly pinGeometry?: (geometry: ICEIndexedGeometry, update?: ICEGeometryBufferUpdate) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare class ICEPreviewPacketLoader {
|
|
16
|
+
private readonly fetcher;
|
|
17
|
+
private readonly pinGeometry;
|
|
18
|
+
private geometries;
|
|
19
|
+
private publishedScene;
|
|
20
|
+
constructor(options?: ICEPreviewPacketLoaderOptions | typeof fetch);
|
|
21
|
+
get scene(): ICEScene | null;
|
|
22
|
+
get currentGeometries(): ReadonlyMap<string, ICEIndexedGeometry>;
|
|
23
|
+
load(url: string, current?: ICEPreviewGeometryPacket): Promise<ICEPreviewPacketLoadResult>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ICEPreviewPacketLoader.d.ts.map
|
|
@@ -154,7 +154,6 @@ export declare class ICETilesetHandle extends ICEEventDispatcher {
|
|
|
154
154
|
private enterCameraMotion;
|
|
155
155
|
private promoteReadyVisibleTargets;
|
|
156
156
|
private lodReadyVisibleCoverage;
|
|
157
|
-
private reconcileSelectionVisibility;
|
|
158
157
|
private rejectReadyIfVisibleSetFailed;
|
|
159
158
|
private updateBudgetWarning;
|
|
160
159
|
private residentBudgetReached;
|
|
@@ -25,10 +25,11 @@ export { ICERenderBatch, type ICERenderBatchOptions, } from './asset/ICERenderBa
|
|
|
25
25
|
export { ICEAssetLoader, type ICEAssetHandle, type ICEAssetLoaderOptions, type ICEAssetLoadOptions, } from './asset/ICEAssetLoader.js';
|
|
26
26
|
export { ICETilesetHandle, ICETilesetLoader, type ICETilesetEvent, type ICETilesetLoaderOptions, type ICETilesetOpenOptions, type ICETilesetStats, type ICETilesetTileState, } from './asset/ICETilesetLoader.js';
|
|
27
27
|
export { ICETilesetScheduler, type ICETilesetSchedulerOptions, type ICETilesetWorkSet, type ICETilesetWorkSetInput, } from './asset/ICETilesetScheduler.js';
|
|
28
|
+
export { ICEPreviewPacketLoader, type ICEPreviewPacketFallbackReason, type ICEPreviewPacketLoadResult, type ICEPreviewPacketLoaderOptions, } from './asset/ICEPreviewPacketLoader.js';
|
|
28
29
|
export { ICELodSelector, type ICELodSelection, type ICELodSelectionInput, } from './asset/ICELodSelector.js';
|
|
29
30
|
export type { ICELodStats } from './asset/ICETilesetLoader.js';
|
|
30
31
|
export { collectSceneItems, raycastSceneNode, type ICERay, type ICESceneItem, type ICESceneQuery, } from './query/ICESceneQuery.js';
|
|
31
|
-
export type { ICEPreparedContract, ICEPreparedStats, } from '../assets/index.js';
|
|
32
|
+
export type { ICEPreparedContract, ICEPreparedStats, ICEPreviewGeometryPacket, } from '../assets/index.js';
|
|
32
33
|
export { ICEAdaptiveRenderBatchController, } from './batching/ICEAdaptiveRenderBatchController.js';
|
|
33
34
|
export type { ICEAdaptiveBatchExecutionResult, ICEAdaptiveBatchRequest, ICEAdaptiveBatchRequestResult, ICERenderBatchingMode, ICERenderBatchingOptions, } from './batching/ICEAdaptiveRenderBatchController.js';
|
|
34
35
|
export { ICERenderBatchPlanner } from './batching/ICERenderBatchPlanner.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ICEBasicMaterial, ICEBoxGeometry, ICEIndexedGeometry, ICEEngineError, ICEAssetLoader, ICETilesetHandle, ICETilesetLoader, ICELabel, ICEMesh, ICENode, ICEOrbitController, ICEPerspectiveCamera, ICEScene, ICEScreenLayer, ICETypeRegistry, ICEWorldLayer, ICE3, deserializeScene, serializeScene, } from './_types/runtime/index.js';
|
|
2
|
-
export type { ICEDeserializedScene, ICEDiagnostic, ICEDiagnosticSeverity, ICEEngineDiagnostics, ICEInputEvent, ICEInputTarget, ICEKeyboardInputEvent, ICEProjectedPoint, ICEAssetHandle, ICEAssetLoaderOptions, ICEAssetLoadOptions, ICETilesetEvent, ICETilesetLoaderOptions, ICETilesetOpenOptions, ICETilesetStats, ICETilesetTileState, ICEPreparedContract, ICEPreparedStats, ICERenderBatchingOptions, ICESerializedScene, ICEGeometry, ICEGeometryBounds, ICEIndexedGeometryOptions, ICEMatrix4Tuple, ICEPickOutcome, } from './_types/runtime/index.js';
|
|
1
|
+
export { ICEBasicMaterial, ICEBoxGeometry, ICEIndexedGeometry, ICEEngineError, ICEAssetLoader, ICETilesetHandle, ICETilesetLoader, ICELabel, ICEMesh, ICENode, ICEOrbitController, ICEPreviewPacketLoader, ICEPerspectiveCamera, ICEScene, ICEScreenLayer, ICETypeRegistry, ICEWorldLayer, ICE3, collectSceneItems, deserializeScene, serializeScene, } from './_types/runtime/index.js';
|
|
2
|
+
export type { ICEDeserializedScene, ICEDiagnostic, ICEDiagnosticSeverity, ICEEngineDiagnostics, ICE3Options, ICE3RendererPreference, ICE3RendererSelection, ICEInputEvent, ICEInputTarget, ICEKeyboardInputEvent, ICEProjectedPoint, ICEAssetHandle, ICEAssetLoaderOptions, ICEAssetLoadOptions, ICETilesetEvent, ICETilesetLoaderOptions, ICETilesetOpenOptions, ICETilesetStats, ICETilesetTileState, ICEPreparedContract, ICEPreparedStats, ICERenderBatchingOptions, ICESerializedScene, ICEGeometry, ICEGeometryBounds, ICEIndexedGeometryOptions, ICEMatrix4Tuple, ICEPickOutcome, ICEPreviewPacketFallbackReason, ICEPreviewPacketLoadResult, ICEPreviewPacketLoaderOptions, ICEPreviewGeometryPacket, } from './_types/runtime/index.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|