@aura3d/assets 1.3.3 → 1.4.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/dist/GLTFLoader.js +1 -0
- package/dist/GLTFLoader.js.map +1 -1
- package/dist/GLTFRenderResources.d.ts.map +1 -1
- package/dist/GLTFRenderResources.js +1 -0
- package/dist/GLTFRenderResources.js.map +1 -1
- package/package.json +38 -5
- package/src/AdvancedAssetCorpus.ts +0 -454
- package/src/AssetBundleCacheFixtures.ts +0 -290
- package/src/AssetCache.ts +0 -76
- package/src/AssetCompatibility.ts +0 -224
- package/src/AssetCorpus.ts +0 -329
- package/src/AssetDependencyGraph.ts +0 -83
- package/src/AssetHandle.ts +0 -74
- package/src/AssetImportPreflight.ts +0 -179
- package/src/AssetInspection.ts +0 -706
- package/src/AssetLoader.ts +0 -36
- package/src/AssetManager.ts +0 -211
- package/src/AssetRegistry.ts +0 -44
- package/src/AssetRenderDefaults.ts +0 -36
- package/src/AudioLoader.ts +0 -41
- package/src/BlenderExportValidation.ts +0 -227
- package/src/CarConceptMaterialStability.ts +0 -1405
- package/src/EXRLoader.ts +0 -1
- package/src/ExternalParityGLTFCorpus.ts +0 -65
- package/src/GLTFAnimationRuntime.ts +0 -1416
- package/src/GLTFAutoFit.ts +0 -133
- package/src/GLTFCompressionDecoders.ts +0 -190
- package/src/GLTFExtensionSupport.ts +0 -138
- package/src/GLTFLoader.ts +0 -4059
- package/src/GLTFRenderResources.ts +0 -2269
- package/src/HDRLoader.ts +0 -1
- package/src/ImageLoader.ts +0 -52
- package/src/ImportPipeline.ts +0 -148
- package/src/KTX2BasisTextureTranscoder.ts +0 -225
- package/src/LoadContext.ts +0 -60
- package/src/MaterialLoader.ts +0 -166
- package/src/MeshOptimization.ts +0 -93
- package/src/OBJLoader.ts +0 -551
- package/src/SceneAnalysisFixtures.ts +0 -438
- package/src/SceneLoader.ts +0 -62
- package/src/ShaderLoader.ts +0 -30
- package/src/TextureLoader.ts +0 -30
- package/src/TexturePipeline.ts +0 -96
- package/src/TextureStreaming.ts +0 -20
- package/src/WorkerAssetJobs.ts +0 -56
- package/src/advanced-gallery/index.ts +0 -18
- package/src/asset-corpus/GLTFSceneLoader.ts +0 -9
- package/src/asset-corpus/ProductionAssetCorpus.ts +0 -230
- package/src/asset-corpus/ProductionAssetPipeline.ts +0 -5
- package/src/asset-corpus/ProductionGLTFRenderPipeline.ts +0 -182
- package/src/asset-corpus/ProductionHDRTextureLoader.ts +0 -2
- package/src/asset-corpus/ProductionKTX2TextureLoader.ts +0 -2
- package/src/asset-corpus/ProductionTextureLoader.ts +0 -2
- package/src/asset-corpus/index.ts +0 -29
- package/src/browser-index.ts +0 -229
- package/src/createRenderableScene.ts +0 -128
- package/src/index.ts +0 -325
- package/src/loadRenderableAsset.ts +0 -67
- package/src/loaders/CubeTextureLoader.ts +0 -8
- package/src/loaders/EXRLoader.ts +0 -10
- package/src/loaders/HDRLoader.ts +0 -7
- package/src/loaders/KTX2Loader.ts +0 -7
- package/src/loaders/LoaderDiagnostics.ts +0 -36
- package/src/loaders/MTLLoader.ts +0 -20
- package/src/loaders/OBJLoader.ts +0 -24
- package/src/loaders/TextureLoader.ts +0 -14
- package/src/loaders/ThreeCompatGLTFLoader.ts +0 -19
- package/src/loaders/index.ts +0 -14
- package/src/threejs-compatibility/ThreeCompatAssetProvenance.ts +0 -51
- package/src/threejs-compatibility/ThreeCompatAssetRegistry.ts +0 -61
- package/src/threejs-example-parity/index.ts +0 -262
- package/tests/assets.test.ts +0 -393
- package/tsconfig.json +0 -7
package/src/WorkerAssetJobs.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { ImportPipeline } from "./ImportPipeline";
|
|
2
|
-
|
|
3
|
-
export interface WorkerAssetJob<TInput = unknown, TOutput = unknown> {
|
|
4
|
-
readonly id: string;
|
|
5
|
-
readonly input: TInput;
|
|
6
|
-
readonly url: string;
|
|
7
|
-
readonly signal?: AbortSignal;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface WorkerAssetJobRunner {
|
|
11
|
-
run<TInput, TOutput>(job: WorkerAssetJob<TInput, TOutput>): Promise<TOutput>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export class WorkerAssetJobs {
|
|
15
|
-
constructor(
|
|
16
|
-
private readonly pipeline: ImportPipeline,
|
|
17
|
-
private readonly worker?: WorkerAssetJobRunner
|
|
18
|
-
) {}
|
|
19
|
-
|
|
20
|
-
async run<TInput, TOutput = unknown>(job: WorkerAssetJob<TInput, TOutput>): Promise<TOutput> {
|
|
21
|
-
if (job.signal?.aborted) {
|
|
22
|
-
throw new Error(`Worker asset job aborted: ${job.id}`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const runPromise = this.worker
|
|
26
|
-
? this.worker.run<TInput, TOutput>(job)
|
|
27
|
-
: (this.pipeline.run(job.input, { url: job.url, signal: job.signal }) as Promise<TOutput>);
|
|
28
|
-
|
|
29
|
-
if (!job.signal) {
|
|
30
|
-
return runPromise;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return this.withAbort(job, runPromise);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
private async withAbort<TOutput>(job: WorkerAssetJob, promise: Promise<TOutput>): Promise<TOutput> {
|
|
37
|
-
if (job.signal?.aborted) {
|
|
38
|
-
throw new Error(`Worker asset job aborted: ${job.id}`);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return new Promise<TOutput>((resolve, reject) => {
|
|
42
|
-
const abort = () => reject(new Error(`Worker asset job aborted: ${job.id}`));
|
|
43
|
-
job.signal?.addEventListener("abort", abort, { once: true });
|
|
44
|
-
promise.then(
|
|
45
|
-
(value) => {
|
|
46
|
-
job.signal?.removeEventListener("abort", abort);
|
|
47
|
-
resolve(value);
|
|
48
|
-
},
|
|
49
|
-
(error) => {
|
|
50
|
-
job.signal?.removeEventListener("abort", abort);
|
|
51
|
-
reject(error);
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
GLTFLoader,
|
|
3
|
-
createRenderableScene,
|
|
4
|
-
loadRenderableAsset,
|
|
5
|
-
inspectGLTFAsset,
|
|
6
|
-
createAssetCompatibilityReport,
|
|
7
|
-
summarizeExternalParityGLTFCorpus
|
|
8
|
-
} from "../index";
|
|
9
|
-
export type {
|
|
10
|
-
GLTFAsset,
|
|
11
|
-
GLTFAssetInspectionReport,
|
|
12
|
-
GLTFRenderResources,
|
|
13
|
-
LoadRenderableAssetOptions,
|
|
14
|
-
RenderableAsset,
|
|
15
|
-
RenderableScene,
|
|
16
|
-
AssetCompatibilityReport,
|
|
17
|
-
ExternalParityGLTFCorpusManifest
|
|
18
|
-
} from "../index";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
createProductionGLTFRenderMetadata,
|
|
3
|
-
loadProductionGLTFRenderPipeline
|
|
4
|
-
} from './ProductionGLTFRenderPipeline';
|
|
5
|
-
export type {
|
|
6
|
-
ProductionGLTFRenderMetadata,
|
|
7
|
-
ProductionGLTFRenderPipeline,
|
|
8
|
-
ProductionGLTFRenderPipelineOptions
|
|
9
|
-
} from './ProductionGLTFRenderPipeline';
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
|
-
|
|
5
|
-
const GLB_MAGIC = 0x46546c67;
|
|
6
|
-
const JSON_CHUNK_TYPE = 0x4e4f534a;
|
|
7
|
-
|
|
8
|
-
export type ProductionAssetClass = "product" | "automotive" | "character" | "materials" | "animation" | "asset";
|
|
9
|
-
|
|
10
|
-
export interface ProductionAssetCorpusRequirements {
|
|
11
|
-
readonly minimumRealGlbAssets: number;
|
|
12
|
-
readonly minimumVisualFlagshipAssets: number;
|
|
13
|
-
readonly minimumPbrTextureAssets: number;
|
|
14
|
-
readonly minimumAdvancedMaterialAssets: number;
|
|
15
|
-
readonly minimumAnimationAssets: number;
|
|
16
|
-
readonly minimumTotalBytes: number;
|
|
17
|
-
readonly everyAssetRequiresLicenseSourceShaAndLocalPath: boolean;
|
|
18
|
-
readonly mustParseGlbJsonChunk: boolean;
|
|
19
|
-
readonly mustRejectPrimitiveOnlyProof: boolean;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface ProductionAssetManifestEntry {
|
|
23
|
-
readonly id: string;
|
|
24
|
-
readonly name: string;
|
|
25
|
-
readonly class: ProductionAssetClass;
|
|
26
|
-
readonly role: string;
|
|
27
|
-
readonly localPath: string;
|
|
28
|
-
readonly license: string;
|
|
29
|
-
readonly repository: string;
|
|
30
|
-
readonly revision: string;
|
|
31
|
-
readonly sourcePath: string;
|
|
32
|
-
readonly sourceUri: string;
|
|
33
|
-
readonly sha256: string;
|
|
34
|
-
readonly bytes: number;
|
|
35
|
-
readonly tags: readonly string[];
|
|
36
|
-
readonly renderRequirements: readonly string[];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface ProductionAssetManifest {
|
|
40
|
-
readonly schema: "a3d-production-runtime-real-asset-corpus";
|
|
41
|
-
readonly sourceManifest: string;
|
|
42
|
-
readonly requirements: ProductionAssetCorpusRequirements;
|
|
43
|
-
readonly claimBoundary: string;
|
|
44
|
-
readonly assets: readonly ProductionAssetManifestEntry[];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface ProductionGlbInspection {
|
|
48
|
-
readonly validGlb: boolean;
|
|
49
|
-
readonly version: number;
|
|
50
|
-
readonly jsonChunkBytes: number;
|
|
51
|
-
readonly sceneCount: number;
|
|
52
|
-
readonly nodeCount: number;
|
|
53
|
-
readonly meshCount: number;
|
|
54
|
-
readonly primitiveCount: number;
|
|
55
|
-
readonly materialCount: number;
|
|
56
|
-
readonly textureCount: number;
|
|
57
|
-
readonly imageCount: number;
|
|
58
|
-
readonly animationCount: number;
|
|
59
|
-
readonly skinCount: number;
|
|
60
|
-
readonly morphTargetPrimitiveCount: number;
|
|
61
|
-
readonly extensionCount: number;
|
|
62
|
-
readonly extensionsUsed: readonly string[];
|
|
63
|
-
readonly pbrMaterialCount: number;
|
|
64
|
-
readonly texturedPbrMaterialCount: number;
|
|
65
|
-
readonly advancedMaterialExtensionCount: number;
|
|
66
|
-
readonly hasRealSceneComplexity: boolean;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface ProductionAssetReadinessEntry {
|
|
70
|
-
readonly id: string;
|
|
71
|
-
readonly localPath: string;
|
|
72
|
-
readonly exists: boolean;
|
|
73
|
-
readonly sha256Matches: boolean;
|
|
74
|
-
readonly bytesMatch: boolean;
|
|
75
|
-
readonly licenseReviewRequired: boolean;
|
|
76
|
-
readonly inspection: ProductionGlbInspection | null;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface ProductionAssetCorpusSummary {
|
|
80
|
-
readonly schema: "a3d-production-runtime-asset-readiness";
|
|
81
|
-
readonly pass: boolean;
|
|
82
|
-
readonly assetCount: number;
|
|
83
|
-
readonly existingAssetCount: number;
|
|
84
|
-
readonly shaVerifiedAssetCount: number;
|
|
85
|
-
readonly realGlbParsedCount: number;
|
|
86
|
-
readonly visualFlagshipAssetCount: number;
|
|
87
|
-
readonly totalBytes: number;
|
|
88
|
-
readonly pbrTextureAssetCount: number;
|
|
89
|
-
readonly advancedMaterialAssetCount: number;
|
|
90
|
-
readonly animationAssetCount: number;
|
|
91
|
-
readonly skinAssetCount: number;
|
|
92
|
-
readonly morphAssetCount: number;
|
|
93
|
-
readonly classCoverage: readonly string[];
|
|
94
|
-
readonly extensionCoverage: readonly string[];
|
|
95
|
-
readonly primitiveOnlyRejected: boolean;
|
|
96
|
-
readonly failures: readonly string[];
|
|
97
|
-
readonly entries: readonly ProductionAssetReadinessEntry[];
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function loadProductionAssetManifest(path = "fixtures/asset-corpus/manifest.json"): ProductionAssetManifest {
|
|
101
|
-
return JSON.parse(readFileSync(resolve(path), "utf8")) as ProductionAssetManifest;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function inspectProductionGlb(path: string): ProductionGlbInspection {
|
|
105
|
-
const data = readFileSync(resolve(path));
|
|
106
|
-
if (data.byteLength < 20 || data.readUInt32LE(0) !== GLB_MAGIC) {
|
|
107
|
-
throw new Error(`Not a GLB file: ${path}`);
|
|
108
|
-
}
|
|
109
|
-
const version = data.readUInt32LE(4);
|
|
110
|
-
const firstChunkLength = data.readUInt32LE(12);
|
|
111
|
-
const firstChunkType = data.readUInt32LE(16);
|
|
112
|
-
if (firstChunkType !== JSON_CHUNK_TYPE) {
|
|
113
|
-
throw new Error(`GLB missing JSON chunk: ${path}`);
|
|
114
|
-
}
|
|
115
|
-
const jsonText = data.toString("utf8", 20, 20 + firstChunkLength).trim();
|
|
116
|
-
const gltf = JSON.parse(jsonText) as {
|
|
117
|
-
scenes?: readonly unknown[];
|
|
118
|
-
nodes?: readonly unknown[];
|
|
119
|
-
meshes?: readonly { primitives?: readonly { targets?: readonly unknown[] }[] }[];
|
|
120
|
-
materials?: readonly {
|
|
121
|
-
pbrMetallicRoughness?: {
|
|
122
|
-
baseColorTexture?: unknown;
|
|
123
|
-
metallicRoughnessTexture?: unknown;
|
|
124
|
-
};
|
|
125
|
-
normalTexture?: unknown;
|
|
126
|
-
occlusionTexture?: unknown;
|
|
127
|
-
emissiveTexture?: unknown;
|
|
128
|
-
extensions?: Record<string, unknown>;
|
|
129
|
-
}[];
|
|
130
|
-
textures?: readonly unknown[];
|
|
131
|
-
images?: readonly unknown[];
|
|
132
|
-
animations?: readonly unknown[];
|
|
133
|
-
skins?: readonly unknown[];
|
|
134
|
-
extensionsUsed?: readonly string[];
|
|
135
|
-
};
|
|
136
|
-
const meshes = gltf.meshes ?? [];
|
|
137
|
-
const materials = gltf.materials ?? [];
|
|
138
|
-
const primitives = meshes.flatMap((mesh) => mesh.primitives ?? []);
|
|
139
|
-
const pbrMaterialCount = materials.filter((material) => material.pbrMetallicRoughness).length;
|
|
140
|
-
const texturedPbrMaterialCount = materials.filter((material) => {
|
|
141
|
-
const pbr = material.pbrMetallicRoughness;
|
|
142
|
-
return Boolean(pbr?.baseColorTexture || pbr?.metallicRoughnessTexture || material.normalTexture || material.occlusionTexture || material.emissiveTexture);
|
|
143
|
-
}).length;
|
|
144
|
-
const advancedMaterialExtensionCount = materials.filter((material) => {
|
|
145
|
-
const extensionNames = Object.keys(material.extensions ?? {});
|
|
146
|
-
return extensionNames.some((name) => /^KHR_materials_/.test(name));
|
|
147
|
-
}).length;
|
|
148
|
-
const extensionsUsed = [...new Set([...(gltf.extensionsUsed ?? []), ...materials.flatMap((material) => Object.keys(material.extensions ?? {}))])].sort();
|
|
149
|
-
const morphTargetPrimitiveCount = primitives.filter((primitive) => (primitive.targets?.length ?? 0) > 0).length;
|
|
150
|
-
return {
|
|
151
|
-
validGlb: true,
|
|
152
|
-
version,
|
|
153
|
-
jsonChunkBytes: firstChunkLength,
|
|
154
|
-
sceneCount: gltf.scenes?.length ?? 0,
|
|
155
|
-
nodeCount: gltf.nodes?.length ?? 0,
|
|
156
|
-
meshCount: meshes.length,
|
|
157
|
-
primitiveCount: primitives.length,
|
|
158
|
-
materialCount: materials.length,
|
|
159
|
-
textureCount: gltf.textures?.length ?? 0,
|
|
160
|
-
imageCount: gltf.images?.length ?? 0,
|
|
161
|
-
animationCount: gltf.animations?.length ?? 0,
|
|
162
|
-
skinCount: gltf.skins?.length ?? 0,
|
|
163
|
-
morphTargetPrimitiveCount,
|
|
164
|
-
extensionCount: extensionsUsed.length,
|
|
165
|
-
extensionsUsed,
|
|
166
|
-
pbrMaterialCount,
|
|
167
|
-
texturedPbrMaterialCount,
|
|
168
|
-
advancedMaterialExtensionCount,
|
|
169
|
-
hasRealSceneComplexity: primitives.length > 0 && (materials.length > 0 || (gltf.animations?.length ?? 0) > 0 || (gltf.skins?.length ?? 0) > 0)
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export function createProductionAssetCorpusSummary(manifest = loadProductionAssetManifest()): ProductionAssetCorpusSummary {
|
|
174
|
-
const entries = manifest.assets.map((asset): ProductionAssetReadinessEntry => {
|
|
175
|
-
const path = resolve(asset.localPath);
|
|
176
|
-
const exists = existsSync(path);
|
|
177
|
-
const bytesMatch = exists && statSync(path).size === asset.bytes;
|
|
178
|
-
const sha256Matches = exists && createHash("sha256").update(readFileSync(path)).digest("hex") === asset.sha256;
|
|
179
|
-
const inspection = exists ? inspectProductionGlb(path) : null;
|
|
180
|
-
return {
|
|
181
|
-
id: asset.id,
|
|
182
|
-
localPath: asset.localPath,
|
|
183
|
-
exists,
|
|
184
|
-
sha256Matches,
|
|
185
|
-
bytesMatch,
|
|
186
|
-
licenseReviewRequired: /review|non-commercial|trademark|SCEA|CC-BY-NC/i.test(asset.license),
|
|
187
|
-
inspection
|
|
188
|
-
};
|
|
189
|
-
});
|
|
190
|
-
const inspections = entries.flatMap((entry) => entry.inspection ? [entry.inspection] : []);
|
|
191
|
-
const pbrTextureAssetCount = entries.filter((entry) => (entry.inspection?.texturedPbrMaterialCount ?? 0) > 0).length;
|
|
192
|
-
const advancedMaterialAssetCount = entries.filter((entry) => (entry.inspection?.advancedMaterialExtensionCount ?? 0) > 0 || /clearcoat|sheen|specular/i.test(manifest.assets.find((asset) => asset.id === entry.id)?.tags.join(" ") ?? "")).length;
|
|
193
|
-
const animationAssetCount = entries.filter((entry) => (entry.inspection?.animationCount ?? 0) > 0 || /animation/i.test(manifest.assets.find((asset) => asset.id === entry.id)?.tags.join(" ") ?? "")).length;
|
|
194
|
-
const totalBytes = manifest.assets.reduce((total, asset) => total + asset.bytes, 0);
|
|
195
|
-
const extensionCoverage = [...new Set(inspections.flatMap((inspection) => inspection.extensionsUsed))].sort();
|
|
196
|
-
const primitiveOnlyRejected = inspections.every((inspection) => inspection.hasRealSceneComplexity);
|
|
197
|
-
const failures = [
|
|
198
|
-
...(manifest.assets.length < manifest.requirements.minimumRealGlbAssets ? [`asset count ${manifest.assets.length} is below ${manifest.requirements.minimumRealGlbAssets}`] : []),
|
|
199
|
-
...(entries.filter((entry) => entry.exists).length < manifest.requirements.minimumRealGlbAssets ? ["too few local GLB assets exist"] : []),
|
|
200
|
-
...(entries.some((entry) => !entry.sha256Matches) ? ["one or more GLB sha256 checks failed"] : []),
|
|
201
|
-
...(entries.some((entry) => !entry.bytesMatch) ? ["one or more GLB byte-size checks failed"] : []),
|
|
202
|
-
...(inspections.length < manifest.requirements.minimumRealGlbAssets ? ["too few GLB JSON chunks parsed"] : []),
|
|
203
|
-
...(manifest.assets.filter((asset) => asset.role.startsWith("flagship")).length < manifest.requirements.minimumVisualFlagshipAssets ? ["too few flagship visual assets"] : []),
|
|
204
|
-
...(pbrTextureAssetCount < manifest.requirements.minimumPbrTextureAssets ? ["too few textured PBR assets"] : []),
|
|
205
|
-
...(advancedMaterialAssetCount < manifest.requirements.minimumAdvancedMaterialAssets ? ["too few advanced material extension assets"] : []),
|
|
206
|
-
...(animationAssetCount < manifest.requirements.minimumAnimationAssets ? ["too few animation assets"] : []),
|
|
207
|
-
...(totalBytes < manifest.requirements.minimumTotalBytes ? [`total bytes ${totalBytes} is below ${manifest.requirements.minimumTotalBytes}`] : []),
|
|
208
|
-
...(manifest.requirements.mustRejectPrimitiveOnlyProof && !primitiveOnlyRejected ? ["primitive-only or uninspectable assets are present"] : [])
|
|
209
|
-
];
|
|
210
|
-
return {
|
|
211
|
-
schema: "a3d-production-runtime-asset-readiness",
|
|
212
|
-
pass: failures.length === 0,
|
|
213
|
-
assetCount: manifest.assets.length,
|
|
214
|
-
existingAssetCount: entries.filter((entry) => entry.exists).length,
|
|
215
|
-
shaVerifiedAssetCount: entries.filter((entry) => entry.sha256Matches).length,
|
|
216
|
-
realGlbParsedCount: inspections.length,
|
|
217
|
-
visualFlagshipAssetCount: manifest.assets.filter((asset) => asset.role.startsWith("flagship")).length,
|
|
218
|
-
totalBytes,
|
|
219
|
-
pbrTextureAssetCount,
|
|
220
|
-
advancedMaterialAssetCount,
|
|
221
|
-
animationAssetCount,
|
|
222
|
-
skinAssetCount: entries.filter((entry) => (entry.inspection?.skinCount ?? 0) > 0).length,
|
|
223
|
-
morphAssetCount: entries.filter((entry) => (entry.inspection?.morphTargetPrimitiveCount ?? 0) > 0).length,
|
|
224
|
-
classCoverage: [...new Set(manifest.assets.map((asset) => asset.class))].sort(),
|
|
225
|
-
extensionCoverage,
|
|
226
|
-
primitiveOnlyRejected,
|
|
227
|
-
failures,
|
|
228
|
-
entries
|
|
229
|
-
};
|
|
230
|
-
}
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import type { CameraLike, RenderSource } from "@aura3d/rendering";
|
|
2
|
-
import { GLTFLoader, type GLTFAsset, type GLTFDracoDecoder, type GLTFLoaderDiagnostics, type GLTFMeshoptDecoder } from "../GLTFLoader";
|
|
3
|
-
import { createGLTFRenderResources, type GLTFImageDecoder, type GLTFRenderResourceOptions, type GLTFRenderResources, type GLTFRendererInputOptions } from "../GLTFRenderResources";
|
|
4
|
-
import { LoadContext } from "../LoadContext";
|
|
5
|
-
|
|
6
|
-
export interface ProductionGLTFRenderPipelineOptions {
|
|
7
|
-
readonly url: string;
|
|
8
|
-
readonly assetId: string;
|
|
9
|
-
readonly assetName?: string;
|
|
10
|
-
readonly imageDecoder?: GLTFImageDecoder;
|
|
11
|
-
readonly dracoDecoder?: GLTFDracoDecoder;
|
|
12
|
-
readonly meshoptDecoder?: GLTFMeshoptDecoder;
|
|
13
|
-
readonly materialVariant?: GLTFRenderResourceOptions["materialVariant"];
|
|
14
|
-
readonly sceneIndex?: GLTFRenderResourceOptions["sceneIndex"];
|
|
15
|
-
readonly sceneName?: GLTFRenderResourceOptions["sceneName"];
|
|
16
|
-
readonly materialRenderStateOverrides?: GLTFRenderResourceOptions["materialRenderStateOverrides"];
|
|
17
|
-
readonly rendererInput?: GLTFRendererInputOptions;
|
|
18
|
-
readonly width?: number;
|
|
19
|
-
readonly height?: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface ProductionGLTFRenderMetadata {
|
|
23
|
-
readonly assetId: string;
|
|
24
|
-
readonly assetName: string;
|
|
25
|
-
readonly assetUri: string;
|
|
26
|
-
readonly meshCount: number;
|
|
27
|
-
readonly primitiveCount: number;
|
|
28
|
-
readonly materialCount: number;
|
|
29
|
-
readonly textureCount: number;
|
|
30
|
-
readonly imageCount: number;
|
|
31
|
-
readonly animationCount: number;
|
|
32
|
-
readonly skinCount: number;
|
|
33
|
-
readonly morphTargetCount: number;
|
|
34
|
-
readonly vertexCount: number;
|
|
35
|
-
readonly indexCount: number;
|
|
36
|
-
readonly textureSlots: readonly string[];
|
|
37
|
-
readonly materialFeatures: readonly string[];
|
|
38
|
-
readonly extensionsUsed: readonly string[];
|
|
39
|
-
readonly extensionsRequired: readonly string[];
|
|
40
|
-
readonly unsupportedExtensions: readonly string[];
|
|
41
|
-
readonly pbrTextureCount: number;
|
|
42
|
-
readonly normalMapCount: number;
|
|
43
|
-
readonly ormTextureCount: number;
|
|
44
|
-
readonly emissiveTextureCount: number;
|
|
45
|
-
readonly materialExtensionCoverage: readonly string[];
|
|
46
|
-
readonly warnings: readonly ProductionGLTFRenderWarning[];
|
|
47
|
-
readonly hasPbr: boolean;
|
|
48
|
-
readonly hasSkinning: boolean;
|
|
49
|
-
readonly hasMorphTargets: boolean;
|
|
50
|
-
readonly hasAnimation: boolean;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export interface ProductionGLTFRenderWarning {
|
|
54
|
-
readonly code: string;
|
|
55
|
-
readonly severity: "info" | "warning";
|
|
56
|
-
readonly message: string;
|
|
57
|
-
readonly nextAction: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface ProductionGLTFRenderPipeline {
|
|
61
|
-
readonly asset: GLTFAsset;
|
|
62
|
-
readonly resources: GLTFRenderResources;
|
|
63
|
-
readonly source: RenderSource;
|
|
64
|
-
readonly camera: CameraLike;
|
|
65
|
-
readonly metadata: ProductionGLTFRenderMetadata;
|
|
66
|
-
dispose(): void;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export async function loadProductionGLTFRenderPipeline(options: ProductionGLTFRenderPipelineOptions): Promise<ProductionGLTFRenderPipeline> {
|
|
70
|
-
const asset = await new GLTFLoader({
|
|
71
|
-
...(options.dracoDecoder ? { dracoDecoder: options.dracoDecoder } : {}),
|
|
72
|
-
...(options.meshoptDecoder ? { meshoptDecoder: options.meshoptDecoder } : {})
|
|
73
|
-
}).load({ url: options.url }, new LoadContext());
|
|
74
|
-
const resources = await createGLTFRenderResources(asset, {
|
|
75
|
-
...(options.imageDecoder ? { imageDecoder: options.imageDecoder } : {}),
|
|
76
|
-
...(options.materialVariant !== undefined ? { materialVariant: options.materialVariant } : {}),
|
|
77
|
-
...(options.sceneIndex !== undefined ? { sceneIndex: options.sceneIndex } : {}),
|
|
78
|
-
...(options.sceneName !== undefined ? { sceneName: options.sceneName } : {}),
|
|
79
|
-
...(options.materialRenderStateOverrides ? { materialRenderStateOverrides: options.materialRenderStateOverrides } : {})
|
|
80
|
-
});
|
|
81
|
-
const rendererInput = resources.toRendererInput(
|
|
82
|
-
{ width: options.width ?? 512, height: options.height ?? 512 },
|
|
83
|
-
{
|
|
84
|
-
qualityPreset: "hdr-studio-preview",
|
|
85
|
-
cameraPolicy: "require",
|
|
86
|
-
...options.rendererInput
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
return {
|
|
90
|
-
asset,
|
|
91
|
-
resources,
|
|
92
|
-
source: rendererInput.source,
|
|
93
|
-
camera: rendererInput.camera,
|
|
94
|
-
metadata: createProductionGLTFRenderMetadata(asset, options.assetId, options.assetName ?? options.assetId),
|
|
95
|
-
dispose: () => {
|
|
96
|
-
resources.dispose();
|
|
97
|
-
if ("dispose" in asset && typeof asset.dispose === "function") {
|
|
98
|
-
asset.dispose();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function createProductionGLTFRenderMetadata(asset: GLTFAsset, assetId: string, assetName: string): ProductionGLTFRenderMetadata {
|
|
105
|
-
const diagnostics: GLTFLoaderDiagnostics = asset.loaderDiagnostics;
|
|
106
|
-
const materialExtensionCoverage = [...new Set(asset.materials.flatMap((material) => [
|
|
107
|
-
...(material.clearcoat ? ["KHR_materials_clearcoat"] : []),
|
|
108
|
-
...(material.sheen ? ["KHR_materials_sheen"] : []),
|
|
109
|
-
...(material.specular ? ["KHR_materials_specular"] : []),
|
|
110
|
-
...(material.transmission ? ["KHR_materials_transmission"] : []),
|
|
111
|
-
...(material.volume ? ["KHR_materials_volume"] : []),
|
|
112
|
-
...(material.ior !== undefined ? ["KHR_materials_ior"] : []),
|
|
113
|
-
...(material.anisotropy ? ["KHR_materials_anisotropy"] : []),
|
|
114
|
-
...(material.iridescence ? ["KHR_materials_iridescence"] : []),
|
|
115
|
-
...(material.dispersion !== undefined ? ["KHR_materials_dispersion"] : [])
|
|
116
|
-
]))].sort();
|
|
117
|
-
const pbrTextureCount = asset.materials.filter((material) => material.baseColorTexture || material.metallicRoughnessTexture).length;
|
|
118
|
-
return {
|
|
119
|
-
assetId,
|
|
120
|
-
assetName,
|
|
121
|
-
assetUri: asset.url,
|
|
122
|
-
meshCount: diagnostics.meshCount,
|
|
123
|
-
primitiveCount: diagnostics.primitiveCount,
|
|
124
|
-
materialCount: diagnostics.materialCount,
|
|
125
|
-
textureCount: diagnostics.textureCount,
|
|
126
|
-
imageCount: diagnostics.imageCount,
|
|
127
|
-
animationCount: diagnostics.animationCount,
|
|
128
|
-
skinCount: diagnostics.skinCount,
|
|
129
|
-
morphTargetCount: diagnostics.morphTargetCount,
|
|
130
|
-
vertexCount: diagnostics.vertexCount,
|
|
131
|
-
indexCount: diagnostics.indexCount,
|
|
132
|
-
textureSlots: diagnostics.textureSlots,
|
|
133
|
-
materialFeatures: diagnostics.materialFeatures,
|
|
134
|
-
extensionsUsed: diagnostics.extensionsUsed,
|
|
135
|
-
extensionsRequired: diagnostics.extensionsRequired,
|
|
136
|
-
unsupportedExtensions: diagnostics.unsupportedExtensions,
|
|
137
|
-
pbrTextureCount,
|
|
138
|
-
normalMapCount: asset.materials.filter((material) => material.normalTexture).length,
|
|
139
|
-
ormTextureCount: asset.materials.filter((material) => material.metallicRoughnessTexture || material.occlusionTexture).length,
|
|
140
|
-
emissiveTextureCount: asset.materials.filter((material) => material.emissiveTexture).length,
|
|
141
|
-
materialExtensionCoverage,
|
|
142
|
-
warnings: createProductionGLTFRenderWarnings(diagnostics, materialExtensionCoverage),
|
|
143
|
-
hasPbr: asset.materials.some((material) => !material.unlit),
|
|
144
|
-
hasSkinning: diagnostics.skinCount > 0 || asset.meshes.some((mesh) => mesh.skinIndex !== undefined),
|
|
145
|
-
hasMorphTargets: diagnostics.morphTargetCount > 0,
|
|
146
|
-
hasAnimation: diagnostics.animationCount > 0
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
function createProductionGLTFRenderWarnings(
|
|
151
|
-
diagnostics: GLTFLoaderDiagnostics,
|
|
152
|
-
materialExtensionCoverage: readonly string[]
|
|
153
|
-
): readonly ProductionGLTFRenderWarning[] {
|
|
154
|
-
const warnings: ProductionGLTFRenderWarning[] = [];
|
|
155
|
-
for (const extension of diagnostics.unsupportedExtensions) {
|
|
156
|
-
warnings.push({
|
|
157
|
-
code: "unsupported-gltf-extension",
|
|
158
|
-
severity: "warning",
|
|
159
|
-
message: `Optional glTF extension ${extension} was present but is not supported by the A3D render path.`,
|
|
160
|
-
nextAction: "Keep the asset loaded if the extension is optional, but inspect the visual output and document the missing feature before claiming parity."
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
for (const extension of materialExtensionCoverage) {
|
|
164
|
-
if (extension === "KHR_materials_transmission" || extension === "KHR_materials_volume") {
|
|
165
|
-
warnings.push({
|
|
166
|
-
code: "bounded-material-extension",
|
|
167
|
-
severity: "info",
|
|
168
|
-
message: `${extension} data is imported, but current production runtime visual parity is bounded and must be checked against the product-viewer comparison output.`,
|
|
169
|
-
nextAction: "Use a focused material-extension scene before claiming full glass/transmission/volume parity."
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
if (diagnostics.animationCount > 0 || diagnostics.skinCount > 0 || diagnostics.morphTargetCount > 0) {
|
|
174
|
-
warnings.push({
|
|
175
|
-
code: "animation-skin-morph-readiness",
|
|
176
|
-
severity: "info",
|
|
177
|
-
message: "The asset contains animation, skinning, or morph data; production metadata preserves it, but the product viewer must explicitly enable the workflow before claiming interactive character parity.",
|
|
178
|
-
nextAction: "Run animation/skinning/morph browser evidence for this asset."
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
return warnings;
|
|
182
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export interface ProductionHDRTextureLoaderResult { readonly uri: string; readonly width: number; readonly height: number; readonly format: 'rgbe-hdr'; }
|
|
2
|
-
export function createProductionHDRTextureLoaderResult(uri: string, width = 1024, height = 512): ProductionHDRTextureLoaderResult { return { uri, width, height, format: 'rgbe-hdr' }; }
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export interface ProductionKTX2TextureLoaderResult { readonly uri: string; readonly transcodedFormat: string; readonly mipLevels: number; }
|
|
2
|
-
export function createProductionKTX2TextureLoaderResult(uri: string, transcodedFormat = 'rgba8unorm', mipLevels = 1): ProductionKTX2TextureLoaderResult { return { uri, transcodedFormat, mipLevels }; }
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export interface ProductionTextureLoaderResult { readonly uri: string; readonly colorSpace: 'srgb' | 'linear'; readonly byteLength?: number; }
|
|
2
|
-
export function createProductionTextureLoaderResult(uri: string, colorSpace: 'srgb' | 'linear' = 'srgb', byteLength?: number): ProductionTextureLoaderResult { return { uri, colorSpace, byteLength }; }
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
createProductionAssetCorpusSummary,
|
|
3
|
-
inspectProductionGlb,
|
|
4
|
-
loadProductionAssetManifest
|
|
5
|
-
} from "./ProductionAssetCorpus";
|
|
6
|
-
export {
|
|
7
|
-
createProductionGLTFRenderMetadata,
|
|
8
|
-
loadProductionGLTFRenderPipeline
|
|
9
|
-
} from "./ProductionGLTFRenderPipeline";
|
|
10
|
-
export type {
|
|
11
|
-
ProductionAssetClass,
|
|
12
|
-
ProductionAssetCorpusRequirements,
|
|
13
|
-
ProductionAssetCorpusSummary,
|
|
14
|
-
ProductionAssetManifest,
|
|
15
|
-
ProductionAssetManifestEntry,
|
|
16
|
-
ProductionAssetReadinessEntry,
|
|
17
|
-
ProductionGlbInspection
|
|
18
|
-
} from "./ProductionAssetCorpus";
|
|
19
|
-
export type {
|
|
20
|
-
ProductionGLTFRenderMetadata,
|
|
21
|
-
ProductionGLTFRenderWarning,
|
|
22
|
-
ProductionGLTFRenderPipeline,
|
|
23
|
-
ProductionGLTFRenderPipelineOptions
|
|
24
|
-
} from "./ProductionGLTFRenderPipeline";
|
|
25
|
-
export * from "./GLTFSceneLoader";
|
|
26
|
-
export * from "./ProductionTextureLoader";
|
|
27
|
-
export * from "./ProductionKTX2TextureLoader";
|
|
28
|
-
export * from "./ProductionHDRTextureLoader";
|
|
29
|
-
export * from "./ProductionAssetPipeline";
|