@aura3d/rendering 4.0.0 → 4.0.2
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/Renderer.d.ts.map +1 -1
- package/dist/Renderer.js +15 -4
- package/dist/Renderer.js.map +1 -1
- package/dist/WebGL2Device.d.ts +1 -0
- package/dist/WebGL2Device.d.ts.map +1 -1
- package/dist/WebGL2Device.js +12 -0
- package/dist/WebGL2Device.js.map +1 -1
- package/dist/effects/ResidentGPUParticleRenderer.d.ts.map +1 -1
- package/dist/effects/ResidentGPUParticleRenderer.js +10 -5
- package/dist/effects/ResidentGPUParticleRenderer.js.map +1 -1
- package/dist/post/PostResources.d.ts.map +1 -1
- package/dist/post/PostResources.js +17 -12
- package/dist/post/PostResources.js.map +1 -1
- package/dist/post/v2Stages.js +2 -2
- package/dist/post/v2Stages.js.map +1 -1
- package/dist/production-runtime/passes/ContactShadowPass.d.ts.map +1 -1
- package/dist/production-runtime/passes/ContactShadowPass.js +14 -13
- package/dist/production-runtime/passes/ContactShadowPass.js.map +1 -1
- package/dist/reference/PostProcessPass.d.ts.map +1 -1
- package/dist/reference/PostProcessPass.js +4 -1
- package/dist/reference/PostProcessPass.js.map +1 -1
- package/dist/renderer/PostprocessExecution.d.ts.map +1 -1
- package/dist/renderer/PostprocessExecution.js +4 -0
- package/dist/renderer/PostprocessExecution.js.map +1 -1
- package/dist/resources/RenderTargetPool.d.ts.map +1 -1
- package/dist/resources/RenderTargetPool.js +13 -4
- package/dist/resources/RenderTargetPool.js.map +1 -1
- package/dist/webgl2/LegacyPost.d.ts.map +1 -1
- package/dist/webgl2/LegacyPost.js +5 -2
- package/dist/webgl2/LegacyPost.js.map +1 -1
- package/dist/webgl2/Probe.d.ts.map +1 -1
- package/dist/webgl2/Probe.js +27 -1
- package/dist/webgl2/Probe.js.map +1 -1
- package/package.json +3 -3
- package/dist/ArchitecturalMaterialCatalog.d.ts +0 -30
- package/dist/ArchitecturalMaterialCatalog.d.ts.map +0 -1
- package/dist/ArchitecturalMaterialCatalog.js +0 -90
- package/dist/ArchitecturalMaterialCatalog.js.map +0 -1
- package/dist/LeanWebGL2Device.d.ts +0 -265
- package/dist/LeanWebGL2Device.d.ts.map +0 -1
- package/dist/LeanWebGL2Device.js +0 -4001
- package/dist/LeanWebGL2Device.js.map +0 -1
- package/dist/advanced-runtime/AdvancedRenderer.d.ts +0 -23
- package/dist/advanced-runtime/AdvancedRenderer.d.ts.map +0 -1
- package/dist/advanced-runtime/AdvancedRenderer.js +0 -45
- package/dist/advanced-runtime/AdvancedRenderer.js.map +0 -1
- package/dist/animation/AnimationMaterialStyle.d.ts +0 -19
- package/dist/animation/AnimationMaterialStyle.d.ts.map +0 -1
- package/dist/animation/AnimationMaterialStyle.js +0 -13
- package/dist/animation/AnimationMaterialStyle.js.map +0 -1
- package/dist/cinematic/CinematicMaterialPresets.d.ts +0 -16
- package/dist/cinematic/CinematicMaterialPresets.d.ts.map +0 -1
- package/dist/cinematic/CinematicMaterialPresets.js +0 -114
- package/dist/cinematic/CinematicMaterialPresets.js.map +0 -1
- package/dist/lean/LeanProductRenderer.d.ts +0 -29
- package/dist/lean/LeanProductRenderer.d.ts.map +0 -1
- package/dist/lean/LeanProductRenderer.js +0 -38
- package/dist/lean/LeanProductRenderer.js.map +0 -1
- package/dist/lean/LeanProductionRenderer.d.ts +0 -38
- package/dist/lean/LeanProductionRenderer.d.ts.map +0 -1
- package/dist/lean/LeanProductionRenderer.js +0 -88
- package/dist/lean/LeanProductionRenderer.js.map +0 -1
- package/dist/lean-core-runtime.d.ts +0 -13
- package/dist/lean-core-runtime.d.ts.map +0 -1
- package/dist/lean-core-runtime.js +0 -10
- package/dist/lean-core-runtime.js.map +0 -1
- package/dist/lean-runtime.d.ts +0 -18
- package/dist/lean-runtime.d.ts.map +0 -1
- package/dist/lean-runtime.js +0 -13
- package/dist/lean-runtime.js.map +0 -1
- package/dist/materials/TransmissionPass.d.ts +0 -16
- package/dist/materials/TransmissionPass.d.ts.map +0 -1
- package/dist/materials/TransmissionPass.js +0 -30
- package/dist/materials/TransmissionPass.js.map +0 -1
- package/dist/production-runtime/ProductionEffectsPipeline.d.ts +0 -20
- package/dist/production-runtime/ProductionEffectsPipeline.d.ts.map +0 -1
- package/dist/production-runtime/ProductionEffectsPipeline.js +0 -65
- package/dist/production-runtime/ProductionEffectsPipeline.js.map +0 -1
- package/dist/production-runtime/ProductionRuntimeRenderer.d.ts +0 -44
- package/dist/production-runtime/ProductionRuntimeRenderer.d.ts.map +0 -1
- package/dist/production-runtime/ProductionRuntimeRenderer.js +0 -179
- package/dist/production-runtime/ProductionRuntimeRenderer.js.map +0 -1
- package/dist/production-runtime/ProductionWebGL2Renderer.d.ts +0 -65
- package/dist/production-runtime/ProductionWebGL2Renderer.d.ts.map +0 -1
- package/dist/production-runtime/ProductionWebGL2Renderer.js +0 -305
- package/dist/production-runtime/ProductionWebGL2Renderer.js.map +0 -1
- package/dist/threejs-example-parity/index.d.ts +0 -57
- package/dist/threejs-example-parity/index.d.ts.map +0 -1
- package/dist/threejs-example-parity/index.js +0 -139
- package/dist/threejs-example-parity/index.js.map +0 -1
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { ProductionWebGL2Renderer } from './ProductionWebGL2Renderer.js';
|
|
2
|
-
import { createDefaultShaderLibrary } from "../ShaderLibrary.js";
|
|
3
|
-
export class ProductionRuntimeRenderer {
|
|
4
|
-
renderer;
|
|
5
|
-
backend;
|
|
6
|
-
backendSelection;
|
|
7
|
-
constructor(renderer, backend, backendSelection) {
|
|
8
|
-
this.renderer = renderer;
|
|
9
|
-
this.backend = backend;
|
|
10
|
-
this.backendSelection = backendSelection;
|
|
11
|
-
}
|
|
12
|
-
/** WS-2.6 — delegate device-loss subscription to whichever backend was selected. */
|
|
13
|
-
onDeviceLost(listener) {
|
|
14
|
-
return this.renderer.onDeviceLost?.(listener) ?? (() => undefined);
|
|
15
|
-
}
|
|
16
|
-
onDeviceRestored(listener) {
|
|
17
|
-
return this.renderer.onDeviceRestored?.(listener) ?? (() => undefined);
|
|
18
|
-
}
|
|
19
|
-
deviceLost() {
|
|
20
|
-
return this.renderer.deviceLost?.() ?? false;
|
|
21
|
-
}
|
|
22
|
-
static async create(options) {
|
|
23
|
-
const selection = resolveProductionRuntimeRendererBackend(options);
|
|
24
|
-
if (selection.selectedBackend === "webgpu") {
|
|
25
|
-
// Dynamically imported so the WebGPU backend can be emitted as its own chunk: a
|
|
26
|
-
// WebGL2-only app should not download a backend it will never construct. Measured with
|
|
27
|
-
// esbuild `splitting: true` on this module, the backend and its device/shader graph move
|
|
28
|
-
// into separate chunks totalling ~85 KB unminified-gzip.
|
|
29
|
-
//
|
|
30
|
-
// Note this is not visible in `pnpm check:bundle-size`, whose harness does not enable
|
|
31
|
-
// splitting and so re-inlines the import; that report shows a ~5 KB *increase* from the
|
|
32
|
-
// added async plumbing. The win is real only for a splitting-capable consumer bundler.
|
|
33
|
-
// Kept because the static `import` also forced `instanceof` checks below to retain the
|
|
34
|
-
// class at runtime, which defeated the split unconditionally.
|
|
35
|
-
try {
|
|
36
|
-
const { ProductionWebGPURenderer } = await import("./ProductionWebGPURenderer.js");
|
|
37
|
-
return new ProductionRuntimeRenderer(await ProductionWebGPURenderer.create(options), "webgpu", selection);
|
|
38
|
-
}
|
|
39
|
-
catch (error) {
|
|
40
|
-
if (selection.requestedBackend !== "auto") {
|
|
41
|
-
throw new Error(`Explicit WebGPU renderer initialization failed and will not silently use WebGL2: ${rendererInitializationError(error)}`, { cause: error });
|
|
42
|
-
}
|
|
43
|
-
return ProductionRuntimeRenderer.createWebGL2(options, {
|
|
44
|
-
requestedBackend: "auto",
|
|
45
|
-
selectedBackend: "webgl2",
|
|
46
|
-
asyncRequired: false,
|
|
47
|
-
fallback: true,
|
|
48
|
-
reason: `backend='auto' attempted WebGPU, initialization failed, and WebGL2 was selected: ${rendererInitializationError(error)}`
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return ProductionRuntimeRenderer.createWebGL2(options, selection);
|
|
53
|
-
}
|
|
54
|
-
static async createWebGL2(options, selection) {
|
|
55
|
-
const { backend: _backend, ...webgl2Options } = options;
|
|
56
|
-
return new ProductionRuntimeRenderer(await ProductionWebGL2Renderer.create({
|
|
57
|
-
...webgl2Options,
|
|
58
|
-
shaderLibrary: webgl2Options.shaderLibrary ?? createDefaultShaderLibrary()
|
|
59
|
-
}), "webgl2", selection);
|
|
60
|
-
}
|
|
61
|
-
renderInteractiveFrame(input) {
|
|
62
|
-
const renderer = this.renderer;
|
|
63
|
-
const result = renderer.renderInteractiveFrame ? renderer.renderInteractiveFrame(input) : renderer.renderFrame(input);
|
|
64
|
-
return withoutReadbackFeatures(result);
|
|
65
|
-
}
|
|
66
|
-
renderFrame(input) {
|
|
67
|
-
return this.renderInteractiveFrame(input);
|
|
68
|
-
}
|
|
69
|
-
resize(width, height) {
|
|
70
|
-
const renderer = this.renderer;
|
|
71
|
-
if (typeof renderer.resize !== "function") {
|
|
72
|
-
throw new Error(`Renderer backend ${this.backend} does not support interactive resizing.`);
|
|
73
|
-
}
|
|
74
|
-
renderer.resize(width, height);
|
|
75
|
-
}
|
|
76
|
-
captureProof(input) {
|
|
77
|
-
const renderer = this.renderer;
|
|
78
|
-
return renderer.captureProof ? renderer.captureProof(input) : renderer.renderImportedAsset(input);
|
|
79
|
-
}
|
|
80
|
-
renderImportedAsset(input) {
|
|
81
|
-
return this.captureProof(input);
|
|
82
|
-
}
|
|
83
|
-
async renderInteractiveFrameAsync(input) {
|
|
84
|
-
const result = this.backend === "webgpu"
|
|
85
|
-
? await this.renderer.renderFrameAsync(input)
|
|
86
|
-
: await this.renderer.renderFrameAsync(input);
|
|
87
|
-
return withoutReadbackFeatures(result);
|
|
88
|
-
}
|
|
89
|
-
async renderFrameAsync(input) {
|
|
90
|
-
return this.renderInteractiveFrameAsync(input);
|
|
91
|
-
}
|
|
92
|
-
async captureProofAsync(input) {
|
|
93
|
-
if (this.backend === "webgpu") {
|
|
94
|
-
return this.renderer.renderImportedAssetAsync(input);
|
|
95
|
-
}
|
|
96
|
-
return this.captureProof(input);
|
|
97
|
-
}
|
|
98
|
-
async renderImportedAssetAsync(input) {
|
|
99
|
-
return this.captureProofAsync(input);
|
|
100
|
-
}
|
|
101
|
-
getFeatures() {
|
|
102
|
-
return this.renderer.getFeatures();
|
|
103
|
-
}
|
|
104
|
-
/** Resources actually selected by the latest submitted shadow pass. */
|
|
105
|
-
getShadowEvidence() {
|
|
106
|
-
return this.renderer.getShadowEvidence();
|
|
107
|
-
}
|
|
108
|
-
getDiagnostics() {
|
|
109
|
-
return this.renderer.getDiagnostics();
|
|
110
|
-
}
|
|
111
|
-
resetTemporalHistory(reason = "explicit-reset") {
|
|
112
|
-
this.renderer.resetTemporalHistory(reason);
|
|
113
|
-
}
|
|
114
|
-
dispose() {
|
|
115
|
-
this.renderer.dispose();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
function rendererInitializationError(error) {
|
|
119
|
-
if (error instanceof Error) {
|
|
120
|
-
const code = "code" in error && typeof error.code === "string" ? ` [${error.code}]` : "";
|
|
121
|
-
return `${error.name}${code}: ${error.message}`;
|
|
122
|
-
}
|
|
123
|
-
return String(error);
|
|
124
|
-
}
|
|
125
|
-
export function createProductionRuntimeRenderer(options) {
|
|
126
|
-
return ProductionRuntimeRenderer.create(options);
|
|
127
|
-
}
|
|
128
|
-
export function resolveProductionRuntimeRendererBackend(options) {
|
|
129
|
-
const browserWebGPU = readBrowserWebGPU();
|
|
130
|
-
const hasWebGPU = Boolean(options.webgpu ?? browserWebGPU);
|
|
131
|
-
const requestedBackend = options.backend ?? (hasWebGPU ? "auto" : "webgl2");
|
|
132
|
-
if (requestedBackend === "webgpu") {
|
|
133
|
-
return {
|
|
134
|
-
requestedBackend,
|
|
135
|
-
selectedBackend: "webgpu",
|
|
136
|
-
asyncRequired: true,
|
|
137
|
-
fallback: false,
|
|
138
|
-
reason: "Explicit backend='webgpu' uses ProductionWebGPURenderer and fails if native WebGPU capabilities are missing."
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
if (requestedBackend === "auto") {
|
|
142
|
-
if (hasWebGPU) {
|
|
143
|
-
return {
|
|
144
|
-
requestedBackend,
|
|
145
|
-
selectedBackend: "webgpu",
|
|
146
|
-
asyncRequired: true,
|
|
147
|
-
fallback: false,
|
|
148
|
-
reason: options.webgpu
|
|
149
|
-
? "backend='auto' selected WebGPU because a WebGPU runtime object was provided."
|
|
150
|
-
: "backend='auto' selected WebGPU because navigator.gpu is available in the current browser runtime."
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
return {
|
|
154
|
-
requestedBackend,
|
|
155
|
-
selectedBackend: "webgl2",
|
|
156
|
-
asyncRequired: false,
|
|
157
|
-
fallback: true,
|
|
158
|
-
reason: "backend='auto' selected WebGL2 because no WebGPU runtime object was provided to the SDK."
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
return {
|
|
162
|
-
requestedBackend,
|
|
163
|
-
selectedBackend: "webgl2",
|
|
164
|
-
asyncRequired: false,
|
|
165
|
-
fallback: false,
|
|
166
|
-
reason: "WebGL2 is selected when no WebGPU runtime is supplied, or when the app explicitly requests backend='webgl2'."
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
function readBrowserWebGPU() {
|
|
170
|
-
const navigatorWithGpu = globalThis.navigator;
|
|
171
|
-
return navigatorWithGpu?.gpu;
|
|
172
|
-
}
|
|
173
|
-
function withoutReadbackFeatures(result) {
|
|
174
|
-
return {
|
|
175
|
-
...result,
|
|
176
|
-
features: result.features.filter((feature) => feature.id !== "pixel-readback" && feature.id !== "scene-color-transmission-capture")
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
//# sourceMappingURL=ProductionRuntimeRenderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProductionRuntimeRenderer.js","sourceRoot":"","sources":["../../../../../packages/rendering/src/production-runtime/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AgB,EAAE,GAAG,CAAC;AAC/B,CAAC;AAED,SAAS,uBAAuB,CAAC,MAAsC;IACrE,OAAO;QACL,GAAG,MAAM;QACT,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,gBAAgB,IAAI,OAAO,CAAC,EAAE,KAAK,kCAAkC,CAAC;KACpI,CAAC;AACJ,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { type RendererOptions } from "../Renderer.js";
|
|
2
|
-
import type { RenderDeviceDiagnostics } from "../RenderDevice.js";
|
|
3
|
-
import { type ProductionPixelMetrics, type ProductionRenderProof, type ProductionRendererFeature, type ProductionRendererInput, type CurrentRoutesProductionRenderer, type RuntimeParityFrameRenderResult } from "./ProductionRendererTypes.js";
|
|
4
|
-
export interface ProductionWebGL2RendererOptions extends Omit<RendererOptions, "backend"> {
|
|
5
|
-
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
6
|
-
readonly width: number;
|
|
7
|
-
readonly height: number;
|
|
8
|
-
}
|
|
9
|
-
export declare class ProductionWebGL2Renderer implements CurrentRoutesProductionRenderer {
|
|
10
|
-
private readonly renderer;
|
|
11
|
-
private width;
|
|
12
|
-
private height;
|
|
13
|
-
readonly backend: "webgl2";
|
|
14
|
-
private constructor();
|
|
15
|
-
static create(options: ProductionWebGL2RendererOptions): Promise<ProductionWebGL2Renderer>;
|
|
16
|
-
/**
|
|
17
|
-
* WS-2.6 — forward context-loss events from the underlying `WebGL2Device`.
|
|
18
|
-
*
|
|
19
|
-
* The device has tracked and handled `webglcontextlost` for a long time; what was missing was any way
|
|
20
|
-
* for a consumer to observe it, which is why the parity table listed context-loss recovery as a gap
|
|
21
|
-
* while the listeners already existed. The device layer was never the gap.
|
|
22
|
-
*/
|
|
23
|
-
onDeviceLost(listener: () => void): () => void;
|
|
24
|
-
onDeviceRestored(listener: () => void): () => void;
|
|
25
|
-
deviceLost(): boolean;
|
|
26
|
-
renderInteractiveFrame(input: ProductionRendererInput): RuntimeParityFrameRenderResult;
|
|
27
|
-
renderFrameAsync(input: ProductionRendererInput): Promise<RuntimeParityFrameRenderResult>;
|
|
28
|
-
renderFrame(input: ProductionRendererInput): RuntimeParityFrameRenderResult;
|
|
29
|
-
resize(width: number, height: number): void;
|
|
30
|
-
captureProof(input: ProductionRendererInput): ProductionRenderProof;
|
|
31
|
-
renderImportedAsset(input: ProductionRendererInput): ProductionRenderProof;
|
|
32
|
-
getFeatures(diagnostics?: RenderDeviceDiagnostics, input?: ProductionRendererInput, pixels?: ProductionPixelMetrics): readonly ProductionRendererFeature[];
|
|
33
|
-
/** Resources actually selected by the latest submitted shadow pass. */
|
|
34
|
-
getShadowEvidence(): Readonly<Record<string, unknown>> | null;
|
|
35
|
-
getDiagnostics(): RenderDeviceDiagnostics;
|
|
36
|
-
resetTemporalHistory(reason?: string): void;
|
|
37
|
-
dispose(): void;
|
|
38
|
-
private validateImportedAsset;
|
|
39
|
-
private getInteractiveFeatures;
|
|
40
|
-
}
|
|
41
|
-
export declare function summarizeProductionWebGL2Proof(proof: ProductionRenderProof): {
|
|
42
|
-
pass: boolean;
|
|
43
|
-
missing: ("pixel-readback" | "real-webgl2-context" | "no-canvas2d-proof" | "no-mock-device" | "imported-gltf-render-source" | "pbr-materials" | "texture-upload-diagnostics" | "render-target-diagnostics" | "draw-call-diagnostics" | "hdr-ibl-ready")[];
|
|
44
|
-
drawCalls: number;
|
|
45
|
-
liveTextures: number;
|
|
46
|
-
textureBytes: number;
|
|
47
|
-
nonBlackPixels: number;
|
|
48
|
-
averageLuma: number;
|
|
49
|
-
maxLuma: number;
|
|
50
|
-
uniqueColorBuckets: number;
|
|
51
|
-
};
|
|
52
|
-
export declare function summarizeProductionProductionProof(proof: ProductionRenderProof): {
|
|
53
|
-
pass: boolean;
|
|
54
|
-
backend: import("./ProductionRendererTypes.js").ProductionRendererBackend;
|
|
55
|
-
missing: ("pixel-readback" | "real-webgl2-context" | "no-canvas2d-proof" | "no-mock-device" | "imported-gltf-render-source" | "pbr-materials" | "texture-upload-diagnostics" | "render-target-diagnostics" | "draw-call-diagnostics" | "hdr-ibl-ready" | "real-webgpu-context" | "native-webgpu-render-pipeline" | "native-webgpu-sampled-textures" | "native-webgpu-texture-readback" | "native-webgpu-pbr-submissions")[];
|
|
56
|
-
drawCalls: number;
|
|
57
|
-
liveTextures: number;
|
|
58
|
-
textureBytes: number;
|
|
59
|
-
nonBlackPixels: number;
|
|
60
|
-
averageLuma: number;
|
|
61
|
-
maxLuma: number;
|
|
62
|
-
uniqueColorBuckets: number;
|
|
63
|
-
};
|
|
64
|
-
export declare function analyzePixels(pixels: Uint8Array, width: number, height: number): ProductionPixelMetrics;
|
|
65
|
-
//# sourceMappingURL=ProductionWebGL2Renderer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProductionWebGL2Renderer.d.ts","sourceRoot":"","sources":["../../../../../packages/rendering/src/production-runtime/ProductionWebGL2Renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAQ/D,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EAEpC,KAAK,8BAA8B,EAEpC,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,+BAAgC,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC;IACvF,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,eAAe,CAAC;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,wBAAyB,YAAW,+BAA+B;IAG1D,OAAO,CAAC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AE,qBAAqB;;;;;;;;;;;EAoB9E;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,sBAAsB,CAkCvG"}
|
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import { Renderer } from "../Renderer.js";
|
|
2
|
-
import { Texture } from "../Texture.js";
|
|
3
|
-
import { bindTransmissionBackdropCapture, createTransmissionBackdropSource, createSceneColorMipLevels, normalizeTransmissionBackdropCapture } from "./TransmissionBackdropCapture.js";
|
|
4
|
-
import { PRODUCTION_WEBGL2_REQUIRED_FEATURES, RUNTIME_PARITY_WEBGPU_REQUIRED_FEATURES } from "./ProductionRendererTypes.js";
|
|
5
|
-
export class ProductionWebGL2Renderer {
|
|
6
|
-
renderer;
|
|
7
|
-
width;
|
|
8
|
-
height;
|
|
9
|
-
backend = "webgl2";
|
|
10
|
-
constructor(renderer, width, height) {
|
|
11
|
-
this.renderer = renderer;
|
|
12
|
-
this.width = width;
|
|
13
|
-
this.height = height;
|
|
14
|
-
}
|
|
15
|
-
static async create(options) {
|
|
16
|
-
const renderer = await Renderer.create({
|
|
17
|
-
...options,
|
|
18
|
-
backend: "webgl2",
|
|
19
|
-
requiredFeatures: ["basic-rendering", "pixel-readback", "render-targets", "hdr-image-based-lighting"]
|
|
20
|
-
});
|
|
21
|
-
if (renderer.device.kind !== "webgl2") {
|
|
22
|
-
renderer.dispose();
|
|
23
|
-
throw new Error(`Production production renderer requires a real WebGL2 device, got ${renderer.device.kind}.`);
|
|
24
|
-
}
|
|
25
|
-
return new ProductionWebGL2Renderer(renderer, options.width, options.height);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* WS-2.6 — forward context-loss events from the underlying `WebGL2Device`.
|
|
29
|
-
*
|
|
30
|
-
* The device has tracked and handled `webglcontextlost` for a long time; what was missing was any way
|
|
31
|
-
* for a consumer to observe it, which is why the parity table listed context-loss recovery as a gap
|
|
32
|
-
* while the listeners already existed. The device layer was never the gap.
|
|
33
|
-
*/
|
|
34
|
-
onDeviceLost(listener) {
|
|
35
|
-
const device = this.renderer.device;
|
|
36
|
-
return device.onDeviceLost?.(listener) ?? (() => undefined);
|
|
37
|
-
}
|
|
38
|
-
onDeviceRestored(listener) {
|
|
39
|
-
const device = this.renderer.device;
|
|
40
|
-
return device.onDeviceRestored?.(listener) ?? (() => undefined);
|
|
41
|
-
}
|
|
42
|
-
deviceLost() {
|
|
43
|
-
const device = this.renderer.device;
|
|
44
|
-
return device.isDeviceLost?.() ?? false;
|
|
45
|
-
}
|
|
46
|
-
renderInteractiveFrame(input) {
|
|
47
|
-
this.validateImportedAsset(input);
|
|
48
|
-
const timing = createCurrentRoutesTimingAccumulator();
|
|
49
|
-
const renderStart = timing.now();
|
|
50
|
-
const diagnostics = this.renderer.render(input.source, input.camera);
|
|
51
|
-
timing.addRender(renderStart);
|
|
52
|
-
return {
|
|
53
|
-
backend: "webgl2",
|
|
54
|
-
diagnostics,
|
|
55
|
-
features: this.getInteractiveFeatures(diagnostics, input),
|
|
56
|
-
timing: timing.snapshot()
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
async renderFrameAsync(input) {
|
|
60
|
-
this.validateImportedAsset(input);
|
|
61
|
-
const timing = createCurrentRoutesTimingAccumulator();
|
|
62
|
-
const renderStart = timing.now();
|
|
63
|
-
const diagnostics = await this.renderer.renderAsync(input.source, input.camera);
|
|
64
|
-
timing.addRender(renderStart);
|
|
65
|
-
return { backend: "webgl2", diagnostics, features: this.getInteractiveFeatures(diagnostics, input), timing: timing.snapshot() };
|
|
66
|
-
}
|
|
67
|
-
renderFrame(input) {
|
|
68
|
-
return this.renderInteractiveFrame(input);
|
|
69
|
-
}
|
|
70
|
-
resize(width, height) {
|
|
71
|
-
this.width = width;
|
|
72
|
-
this.height = height;
|
|
73
|
-
this.renderer.resize(width, height);
|
|
74
|
-
}
|
|
75
|
-
captureProof(input) {
|
|
76
|
-
this.validateImportedAsset(input);
|
|
77
|
-
const timing = createCurrentRoutesTimingAccumulator();
|
|
78
|
-
let transmissionBackdropCapture;
|
|
79
|
-
let transmissionBackdropTexture;
|
|
80
|
-
const captureOptions = normalizeTransmissionBackdropCapture(input.transmissionBackdropCapture);
|
|
81
|
-
if (captureOptions) {
|
|
82
|
-
const backdrop = createTransmissionBackdropSource(input.source);
|
|
83
|
-
const captureStart = timing.now();
|
|
84
|
-
const captureRenderStart = timing.now();
|
|
85
|
-
this.renderer.render(backdrop.source, input.camera);
|
|
86
|
-
timing.addRender(captureRenderStart);
|
|
87
|
-
const captureReadbackStart = timing.now();
|
|
88
|
-
const scenePixels = this.renderer.device.readPixels(0, 0, this.width, this.height);
|
|
89
|
-
timing.addReadback(captureReadbackStart);
|
|
90
|
-
const mipLevels = createSceneColorMipLevels(scenePixels, this.width, this.height);
|
|
91
|
-
transmissionBackdropTexture = new Texture({
|
|
92
|
-
width: this.width,
|
|
93
|
-
height: this.height,
|
|
94
|
-
colorSpace: "srgb",
|
|
95
|
-
mipLevels,
|
|
96
|
-
label: "a3d-renderer-owned-scene-color-transmission-backdrop"
|
|
97
|
-
});
|
|
98
|
-
const materialBindings = bindTransmissionBackdropCapture(input.source, transmissionBackdropTexture, captureOptions);
|
|
99
|
-
transmissionBackdropCapture = {
|
|
100
|
-
mode: "renderer-owned-scene-color-readback",
|
|
101
|
-
width: this.width,
|
|
102
|
-
height: this.height,
|
|
103
|
-
byteLength: scenePixels.byteLength,
|
|
104
|
-
mipCount: mipLevels.length,
|
|
105
|
-
strength: captureOptions.strength,
|
|
106
|
-
refractionScale: captureOptions.refractionScale,
|
|
107
|
-
materialBindings,
|
|
108
|
-
excludedTransmissionItems: backdrop.excludedTransmissionItems
|
|
109
|
-
};
|
|
110
|
-
timing.addTransmissionBackdropCapture(captureStart);
|
|
111
|
-
}
|
|
112
|
-
const renderStart = timing.now();
|
|
113
|
-
const diagnostics = this.renderer.render(input.source, input.camera);
|
|
114
|
-
timing.addRender(renderStart);
|
|
115
|
-
const readbackStart = timing.now();
|
|
116
|
-
const pixelBytes = this.renderer.device.readPixels(0, 0, this.width, this.height);
|
|
117
|
-
timing.addReadback(readbackStart);
|
|
118
|
-
const analysisStart = timing.now();
|
|
119
|
-
const pixels = analyzePixels(pixelBytes, this.width, this.height);
|
|
120
|
-
timing.addPixelAnalysis(analysisStart);
|
|
121
|
-
transmissionBackdropTexture?.dispose();
|
|
122
|
-
const features = this.getFeatures(diagnostics, input, pixels);
|
|
123
|
-
return {
|
|
124
|
-
backend: "webgl2",
|
|
125
|
-
realWebGL2: this.renderer.device.kind === "webgl2",
|
|
126
|
-
mockDevice: this.renderer.device.kind === "mock",
|
|
127
|
-
canvas2dProof: false,
|
|
128
|
-
importedAsset: input.metadata,
|
|
129
|
-
diagnostics,
|
|
130
|
-
features,
|
|
131
|
-
pixels,
|
|
132
|
-
timing: timing.snapshot(),
|
|
133
|
-
...(transmissionBackdropCapture ? { transmissionBackdropCapture } : {})
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
renderImportedAsset(input) {
|
|
137
|
-
return this.captureProof(input);
|
|
138
|
-
}
|
|
139
|
-
getFeatures(diagnostics = this.getDiagnostics(), input, pixels) {
|
|
140
|
-
const capabilities = new Set(this.renderer.device.info.capabilities ?? []);
|
|
141
|
-
const feature = (id, state, detail) => ({ id, state, detail });
|
|
142
|
-
return [
|
|
143
|
-
feature("real-webgl2-context", this.renderer.device.kind === "webgl2" ? "supported" : "blocked", `backend=${this.renderer.device.kind}`),
|
|
144
|
-
feature("no-canvas2d-proof", "supported", "Render proof is produced by Renderer/WebGL2 and readPixels, not Canvas 2D drawing."),
|
|
145
|
-
feature("no-mock-device", this.renderer.device.kind === "mock" ? "blocked" : "supported", "ProductionWebGL2Renderer refuses mock backend creation."),
|
|
146
|
-
feature("imported-gltf-render-source", input && input.metadata.primitiveCount > 0 ? "supported" : "partial", input ? `${input.metadata.assetId}: ${input.metadata.primitiveCount} primitives` : "Awaiting imported asset render input."),
|
|
147
|
-
feature("pbr-materials", input && input.metadata.materialCount > 0 ? "supported" : "partial", input ? `${input.metadata.materialCount} glTF materials in render metadata` : "Awaiting imported asset metadata."),
|
|
148
|
-
feature("texture-upload-diagnostics", (diagnostics.textures ?? 0) > 0 ? "supported" : "partial", `${diagnostics.textures ?? 0} live textures, ${diagnostics.textureBytes ?? 0} bytes`),
|
|
149
|
-
feature("render-target-diagnostics", diagnostics.renderTargets !== undefined ? "supported" : "partial", `${diagnostics.renderTargets ?? 0} live render targets`),
|
|
150
|
-
feature("draw-call-diagnostics", diagnostics.drawCalls > 0 ? "supported" : "partial", `${diagnostics.drawCalls} draw calls in last frame`),
|
|
151
|
-
feature("pixel-readback", pixels && pixels.nonBlackPixels > 0 ? "supported" : "partial", pixels ? `${pixels.nonBlackPixels} non-black pixels` : "Awaiting frame readback."),
|
|
152
|
-
feature("hdr-ibl-ready", capabilities.has("hdr-image-based-lighting") ? "supported" : "partial", `capabilities=${[...capabilities].join(",")}`),
|
|
153
|
-
feature("anisotropic-texture-filtering", capabilities.has("anisotropic-texture-filtering") ? "supported" : "partial", "WebGL EXT_texture_filter_anisotropic for sharper angled PBR texture sampling."),
|
|
154
|
-
feature("scene-color-transmission-capture", input?.transmissionBackdropCapture ? "supported" : "partial", input?.transmissionBackdropCapture
|
|
155
|
-
? "Renderer-owned first-pass scene-color readback is rebound as u_transmissionBackdropTexture for the final A3D transmission pass."
|
|
156
|
-
: "Transmission backdrop capture was not requested for this proof.")
|
|
157
|
-
];
|
|
158
|
-
}
|
|
159
|
-
/** Resources actually selected by the latest submitted shadow pass. */
|
|
160
|
-
getShadowEvidence() {
|
|
161
|
-
return this.renderer.getShadowEvidence();
|
|
162
|
-
}
|
|
163
|
-
getDiagnostics() {
|
|
164
|
-
return this.renderer.getDiagnostics();
|
|
165
|
-
}
|
|
166
|
-
resetTemporalHistory(reason = "explicit-reset") {
|
|
167
|
-
this.renderer.resetTemporalHistory(reason);
|
|
168
|
-
}
|
|
169
|
-
dispose() {
|
|
170
|
-
this.renderer.dispose();
|
|
171
|
-
}
|
|
172
|
-
validateImportedAsset(input) {
|
|
173
|
-
if (input.metadata.primitiveCount <= 0 || input.metadata.meshCount <= 0) {
|
|
174
|
-
throw new Error("Production render path requires at least one real mesh primitive.");
|
|
175
|
-
}
|
|
176
|
-
if (input.metadata.materialCount <= 0) {
|
|
177
|
-
throw new Error("Production render path requires at least one real material.");
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
getInteractiveFeatures(diagnostics, input) {
|
|
181
|
-
return this.getFeatures(diagnostics, input).filter((feature) => feature.id !== "pixel-readback" && feature.id !== "scene-color-transmission-capture");
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
export function summarizeProductionWebGL2Proof(proof) {
|
|
185
|
-
const missing = PRODUCTION_WEBGL2_REQUIRED_FEATURES.filter((feature) => {
|
|
186
|
-
const state = proof.features.find((item) => item.id === feature)?.state;
|
|
187
|
-
return state !== "supported";
|
|
188
|
-
});
|
|
189
|
-
return {
|
|
190
|
-
pass: missing.length === 0 && proof.realWebGL2 && !proof.mockDevice && !proof.canvas2dProof && proof.diagnostics.drawCalls > 0 && proof.pixels.nonBlackPixels > 0,
|
|
191
|
-
missing,
|
|
192
|
-
drawCalls: proof.diagnostics.drawCalls,
|
|
193
|
-
liveTextures: proof.diagnostics.textures ?? 0,
|
|
194
|
-
textureBytes: proof.diagnostics.textureBytes ?? 0,
|
|
195
|
-
nonBlackPixels: proof.pixels.nonBlackPixels,
|
|
196
|
-
averageLuma: proof.pixels.averageLuma,
|
|
197
|
-
maxLuma: proof.pixels.maxLuma,
|
|
198
|
-
uniqueColorBuckets: proof.pixels.uniqueColorBuckets
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
export function summarizeProductionProductionProof(proof) {
|
|
202
|
-
const requiredFeatures = proof.backend === "webgpu"
|
|
203
|
-
? RUNTIME_PARITY_WEBGPU_REQUIRED_FEATURES
|
|
204
|
-
: PRODUCTION_WEBGL2_REQUIRED_FEATURES;
|
|
205
|
-
const missing = requiredFeatures.filter((feature) => {
|
|
206
|
-
const state = proof.features.find((item) => item.id === feature)?.state;
|
|
207
|
-
return state !== "supported";
|
|
208
|
-
});
|
|
209
|
-
return {
|
|
210
|
-
pass: missing.length === 0 && !proof.mockDevice && !proof.canvas2dProof && proof.diagnostics.drawCalls > 0 && proof.pixels.nonBlackPixels > 0,
|
|
211
|
-
backend: proof.backend,
|
|
212
|
-
missing,
|
|
213
|
-
drawCalls: proof.diagnostics.drawCalls,
|
|
214
|
-
liveTextures: proof.diagnostics.textures ?? 0,
|
|
215
|
-
textureBytes: proof.diagnostics.textureBytes ?? 0,
|
|
216
|
-
nonBlackPixels: proof.pixels.nonBlackPixels,
|
|
217
|
-
averageLuma: proof.pixels.averageLuma,
|
|
218
|
-
maxLuma: proof.pixels.maxLuma,
|
|
219
|
-
uniqueColorBuckets: proof.pixels.uniqueColorBuckets
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
export function analyzePixels(pixels, width, height) {
|
|
223
|
-
let nonTransparentPixels = 0;
|
|
224
|
-
let nonBlackPixels = 0;
|
|
225
|
-
let lumaTotal = 0;
|
|
226
|
-
let maxLuma = 0;
|
|
227
|
-
const buckets = new Set();
|
|
228
|
-
for (let offset = 0; offset + 3 < pixels.length; offset += 4) {
|
|
229
|
-
const r = pixels[offset] ?? 0;
|
|
230
|
-
const g = pixels[offset + 1] ?? 0;
|
|
231
|
-
const b = pixels[offset + 2] ?? 0;
|
|
232
|
-
const a = pixels[offset + 3] ?? 0;
|
|
233
|
-
if (a > 0)
|
|
234
|
-
nonTransparentPixels += 1;
|
|
235
|
-
if (r + g + b > 12)
|
|
236
|
-
nonBlackPixels += 1;
|
|
237
|
-
const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
238
|
-
lumaTotal += luma;
|
|
239
|
-
maxLuma = Math.max(maxLuma, luma);
|
|
240
|
-
buckets.add(((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4));
|
|
241
|
-
}
|
|
242
|
-
const centerOffset = ((Math.floor(height / 2) * width) + Math.floor(width / 2)) * 4;
|
|
243
|
-
return {
|
|
244
|
-
width,
|
|
245
|
-
height,
|
|
246
|
-
nonTransparentPixels,
|
|
247
|
-
nonBlackPixels,
|
|
248
|
-
averageLuma: pixels.length > 0 ? lumaTotal / (pixels.length / 4) : 0,
|
|
249
|
-
maxLuma,
|
|
250
|
-
uniqueColorBuckets: buckets.size,
|
|
251
|
-
centerPixel: [
|
|
252
|
-
pixels[centerOffset] ?? 0,
|
|
253
|
-
pixels[centerOffset + 1] ?? 0,
|
|
254
|
-
pixels[centerOffset + 2] ?? 0,
|
|
255
|
-
pixels[centerOffset + 3] ?? 0
|
|
256
|
-
]
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
function createCurrentRoutesTimingAccumulator() {
|
|
260
|
-
const source = hasPerformanceNow() ? "performance-now" : "date-now";
|
|
261
|
-
const startedAt = readCurrentRoutesNow(source);
|
|
262
|
-
let renderMs = 0;
|
|
263
|
-
let readbackMs = 0;
|
|
264
|
-
let pixelAnalysisMs = 0;
|
|
265
|
-
let transmissionBackdropCaptureMs = 0;
|
|
266
|
-
let hasReadback = false;
|
|
267
|
-
let hasPixelAnalysis = false;
|
|
268
|
-
let hasTransmissionBackdropCapture = false;
|
|
269
|
-
const elapsed = (start) => Math.max(0, readCurrentRoutesNow(source) - start);
|
|
270
|
-
return {
|
|
271
|
-
now: () => readCurrentRoutesNow(source),
|
|
272
|
-
addRender(start) {
|
|
273
|
-
renderMs += elapsed(start);
|
|
274
|
-
},
|
|
275
|
-
addReadback(start) {
|
|
276
|
-
hasReadback = true;
|
|
277
|
-
readbackMs += elapsed(start);
|
|
278
|
-
},
|
|
279
|
-
addPixelAnalysis(start) {
|
|
280
|
-
hasPixelAnalysis = true;
|
|
281
|
-
pixelAnalysisMs += elapsed(start);
|
|
282
|
-
},
|
|
283
|
-
addTransmissionBackdropCapture(start) {
|
|
284
|
-
hasTransmissionBackdropCapture = true;
|
|
285
|
-
transmissionBackdropCaptureMs += elapsed(start);
|
|
286
|
-
},
|
|
287
|
-
snapshot() {
|
|
288
|
-
return {
|
|
289
|
-
source,
|
|
290
|
-
totalMs: elapsed(startedAt),
|
|
291
|
-
renderMs,
|
|
292
|
-
...(hasReadback ? { readbackMs } : {}),
|
|
293
|
-
...(hasPixelAnalysis ? { pixelAnalysisMs } : {}),
|
|
294
|
-
...(hasTransmissionBackdropCapture ? { transmissionBackdropCaptureMs } : {})
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
|
-
function hasPerformanceNow() {
|
|
300
|
-
return typeof globalThis.performance?.now === "function";
|
|
301
|
-
}
|
|
302
|
-
function readCurrentRoutesNow(source) {
|
|
303
|
-
return source === "performance-now" ? globalThis.performance.now() : Date.now();
|
|
304
|
-
}
|
|
305
|
-
//# sourceMappingURL=ProductionWebGL2Renderer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProductionWebGL2Renderer.js","sourceRoot":"","sources":["../../../../../packages/rendering/src/production-runtime/ProductionWebGL2Renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwB,MAAM,aAAa,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EACL,+BAA+B,EAC/B,gCAAgC,EAChC,yBAAyB,EACzB,oCAAoC,EACrC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,mCAAmC,EACnC,uCAAuC,EASxC,MAAM,2BAA2B,CAAC;AAQnC,MAAM,OAAO,wBAAwB;IAGE;IAA4B;IAAuB;IAF/E,OAAO,GAAG,QAAiB,CAAC;IAErC,YAAqC,QAAkB,EAAU,KAAa,EAAU,MAAc;QAAjE,aAAQ,GAAR,QAAQ,CAAU;QAAU,UAAK,GAAL,KAAK,CAAQ;QAAU,WAAM,GAAN,MAAM,CAAQ;IAAG,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AAC,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;AAClF,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { type ProductionRuntimeRendererBackendPreference, type ProductionRuntimeRendererBackendSelection } from "../production-runtime/ProductionRuntimeRenderer.js";
|
|
2
|
-
import type { ProductionRendererInput, RuntimeParityFrameRenderResult } from "../production-runtime/ProductionRendererTypes.js";
|
|
3
|
-
import type { RenderDeviceDiagnostics } from "../RenderDevice.js";
|
|
4
|
-
import type { RendererPostProcessOptions } from "../Renderer.js";
|
|
5
|
-
export interface CurrentRoutesInteractiveRendererOptions {
|
|
6
|
-
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
7
|
-
readonly width: number;
|
|
8
|
-
readonly height: number;
|
|
9
|
-
readonly backend?: ProductionRuntimeRendererBackendPreference;
|
|
10
|
-
readonly preserveDrawingBuffer?: boolean;
|
|
11
|
-
readonly errorCheckMode?: "strict" | "frame";
|
|
12
|
-
readonly clearColor?: readonly [number, number, number, number];
|
|
13
|
-
}
|
|
14
|
-
export interface CurrentRoutesRuntimeMetrics {
|
|
15
|
-
readonly frameCount: number;
|
|
16
|
-
readonly lastFrameMs: number;
|
|
17
|
-
readonly averageFrameMs: number;
|
|
18
|
-
readonly lastRenderMs: number;
|
|
19
|
-
readonly averageRenderMs: number;
|
|
20
|
-
readonly drawCalls: number;
|
|
21
|
-
readonly textures: number;
|
|
22
|
-
readonly buffers: number;
|
|
23
|
-
readonly shaders: number;
|
|
24
|
-
readonly backend: "webgl2" | "webgpu";
|
|
25
|
-
readonly stateCacheIssued?: number;
|
|
26
|
-
readonly stateCacheSkipped?: number;
|
|
27
|
-
readonly stateCacheProgramSwitches?: number;
|
|
28
|
-
readonly stateCacheTextureBinds?: number;
|
|
29
|
-
readonly stateCacheBufferBinds?: number;
|
|
30
|
-
readonly stateCacheVertexArrayBinds?: number;
|
|
31
|
-
readonly stateCacheSamplerBinds?: number;
|
|
32
|
-
}
|
|
33
|
-
export interface CurrentRoutesScreenshot {
|
|
34
|
-
readonly mimeType: "image/png";
|
|
35
|
-
readonly dataUrl: string;
|
|
36
|
-
readonly width: number;
|
|
37
|
-
readonly height: number;
|
|
38
|
-
}
|
|
39
|
-
export declare class CurrentRoutesInteractiveRenderer {
|
|
40
|
-
private readonly renderer;
|
|
41
|
-
readonly canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
42
|
-
readonly backend: "webgl2" | "webgpu";
|
|
43
|
-
readonly backendSelection: ProductionRuntimeRendererBackendSelection;
|
|
44
|
-
private readonly metrics;
|
|
45
|
-
private constructor();
|
|
46
|
-
static create(options: CurrentRoutesInteractiveRendererOptions): Promise<CurrentRoutesInteractiveRenderer>;
|
|
47
|
-
renderFrame(input: ProductionRendererInput): Promise<RuntimeParityFrameRenderResult>;
|
|
48
|
-
resize(width: number, height: number): void;
|
|
49
|
-
getDiagnostics(): RenderDeviceDiagnostics;
|
|
50
|
-
getMetrics(): CurrentRoutesRuntimeMetrics;
|
|
51
|
-
screenshot(): CurrentRoutesScreenshot;
|
|
52
|
-
dispose(): void;
|
|
53
|
-
}
|
|
54
|
-
export declare function createCurrentRoutesInteractiveRenderer(options: CurrentRoutesInteractiveRendererOptions): Promise<CurrentRoutesInteractiveRenderer>;
|
|
55
|
-
export declare function createCurrentRoutesPostprocess(exposure: number): RendererPostProcessOptions;
|
|
56
|
-
export declare function captureCurrentRoutesCanvasScreenshot(canvas: HTMLCanvasElement | OffscreenCanvas): CurrentRoutesScreenshot;
|
|
57
|
-
//# sourceMappingURL=index.d.ts.map
|