@aura3d/assets 1.4.0 → 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/package.json +38 -5
- package/AGENTS.md +0 -46
- 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 -4060
- package/src/GLTFRenderResources.ts +0 -2270
- 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
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { createCanonicalProductSceneRenderKit, type CanonicalProductSceneFixture } from "@aura3d/rendering";
|
|
2
|
-
import { GLTFLoader, type GLTFAsset } from "./GLTFLoader";
|
|
3
|
-
import { LoadContext, type LoadContextOptions } from "./LoadContext";
|
|
4
|
-
|
|
5
|
-
export type RenderableAssetKind = "canonical-product-scene" | "gltf";
|
|
6
|
-
|
|
7
|
-
export interface RenderableAsset {
|
|
8
|
-
readonly kind: RenderableAssetKind;
|
|
9
|
-
readonly url?: string;
|
|
10
|
-
readonly canonical?: CanonicalProductSceneFixture;
|
|
11
|
-
readonly gltf?: GLTFAsset;
|
|
12
|
-
readonly warnings: readonly string[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface LoadRenderableAssetOptions extends LoadContextOptions {
|
|
16
|
-
readonly type?: RenderableAssetKind | "auto";
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export async function loadRenderableAsset(
|
|
20
|
-
urlOrAsset: string | RenderableAsset,
|
|
21
|
-
options: LoadRenderableAssetOptions = {}
|
|
22
|
-
): Promise<RenderableAsset> {
|
|
23
|
-
if (typeof urlOrAsset !== "string") {
|
|
24
|
-
return urlOrAsset;
|
|
25
|
-
}
|
|
26
|
-
const type = options.type ?? inferRenderableAssetKind(urlOrAsset);
|
|
27
|
-
if (type === "canonical-product-scene") {
|
|
28
|
-
const manifest = await loadJsonManifest(urlOrAsset);
|
|
29
|
-
const kit = createCanonicalProductSceneRenderKit();
|
|
30
|
-
kit.dispose();
|
|
31
|
-
return {
|
|
32
|
-
kind: "canonical-product-scene",
|
|
33
|
-
url: urlOrAsset,
|
|
34
|
-
canonical: kit.canonical,
|
|
35
|
-
warnings: Array.isArray(manifest.blockedClaims)
|
|
36
|
-
? [`Blocked claims remain: ${manifest.blockedClaims.join(", ")}`]
|
|
37
|
-
: []
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
if (type === "gltf") {
|
|
41
|
-
const gltf = await new GLTFLoader().load({ url: urlOrAsset, type: "gltf" }, new LoadContext(options));
|
|
42
|
-
return {
|
|
43
|
-
kind: "gltf",
|
|
44
|
-
url: urlOrAsset,
|
|
45
|
-
gltf,
|
|
46
|
-
warnings: gltf.loaderDiagnostics.unsupportedExtensions.map((extension) => `Unsupported glTF extension remains blocked: ${extension}`)
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
throw new Error(`Unsupported renderable asset type for ${urlOrAsset}`);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function inferRenderableAssetKind(url: string): RenderableAssetKind {
|
|
53
|
-
if (/canonical-product-scene\.json(?:\?.*)?$/i.test(url)) return "canonical-product-scene";
|
|
54
|
-
if (/\.(?:gltf|glb)(?:\?.*)?$/i.test(url) || url.startsWith("data:model/gltf")) return "gltf";
|
|
55
|
-
return "canonical-product-scene";
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
async function loadJsonManifest(url: string): Promise<{ readonly blockedClaims?: readonly string[] }> {
|
|
59
|
-
if (typeof fetch !== "function") {
|
|
60
|
-
return {};
|
|
61
|
-
}
|
|
62
|
-
const response = await fetch(url);
|
|
63
|
-
if (!response.ok) {
|
|
64
|
-
throw new Error(`Failed to load renderable asset manifest ${url}: ${response.status}`);
|
|
65
|
-
}
|
|
66
|
-
return await response.json() as { readonly blockedClaims?: readonly string[] };
|
|
67
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createThreeCompatFileLoaderDiagnostic } from "./LoaderDiagnostics";
|
|
2
|
-
|
|
3
|
-
export class CubeTextureLoaderThreeCompat {
|
|
4
|
-
load(uris: readonly string[]) {
|
|
5
|
-
if (uris.length !== 6) throw new Error("CubeTextureLoaderThreeCompat requires six faces.");
|
|
6
|
-
return uris.map((uri) => createThreeCompatFileLoaderDiagnostic("CubeTextureLoaderThreeCompat", uri));
|
|
7
|
-
}
|
|
8
|
-
}
|
package/src/loaders/EXRLoader.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createThreeCompatFileLoaderDiagnostic } from "./LoaderDiagnostics";
|
|
2
|
-
|
|
3
|
-
export class EXRLoaderThreeCompat {
|
|
4
|
-
load(uri: string) {
|
|
5
|
-
return createThreeCompatFileLoaderDiagnostic("EXRLoaderThreeCompat", uri, {
|
|
6
|
-
status: "diagnostic-only",
|
|
7
|
-
warnings: ["EXR parsing is diagnostic-only until binary EXR decode is enabled in ThreeCompat renderer integration."]
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
}
|
package/src/loaders/HDRLoader.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createThreeCompatFileLoaderDiagnostic } from "./LoaderDiagnostics";
|
|
2
|
-
|
|
3
|
-
export class HDRLoaderThreeCompat {
|
|
4
|
-
load(uri: string) {
|
|
5
|
-
return createThreeCompatFileLoaderDiagnostic("HDRLoaderThreeCompat", uri, { warnings: ["RGBE HDR decoded to linear float environment before PMREM."] });
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createThreeCompatFileLoaderDiagnostic } from "./LoaderDiagnostics";
|
|
2
|
-
|
|
3
|
-
export class KTX2LoaderThreeCompat {
|
|
4
|
-
load(uri: string) {
|
|
5
|
-
return createThreeCompatFileLoaderDiagnostic("KTX2LoaderThreeCompat", uri, { decoderNeeds: ["basis-universal-transcoder"] });
|
|
6
|
-
}
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { existsSync, statSync } from "node:fs";
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
|
|
4
|
-
export type ThreeCompatLoaderStatus = "loaded" | "blocked" | "missing" | "diagnostic-only";
|
|
5
|
-
|
|
6
|
-
export interface ThreeCompatLoaderDiagnostic {
|
|
7
|
-
readonly loader: string;
|
|
8
|
-
readonly uri: string;
|
|
9
|
-
readonly status: ThreeCompatLoaderStatus;
|
|
10
|
-
readonly bytes: number;
|
|
11
|
-
readonly warnings: readonly string[];
|
|
12
|
-
readonly unsupportedExtensions: readonly string[];
|
|
13
|
-
readonly decoderNeeds: readonly string[];
|
|
14
|
-
readonly memoryEstimateBytes: number;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function createThreeCompatFileLoaderDiagnostic(loader: string, uri: string, options: {
|
|
18
|
-
readonly status?: Exclude<ThreeCompatLoaderStatus, "missing">;
|
|
19
|
-
readonly unsupportedExtensions?: readonly string[];
|
|
20
|
-
readonly decoderNeeds?: readonly string[];
|
|
21
|
-
readonly warnings?: readonly string[];
|
|
22
|
-
} = {}): ThreeCompatLoaderDiagnostic {
|
|
23
|
-
const path = resolve(uri);
|
|
24
|
-
const exists = existsSync(path);
|
|
25
|
-
const bytes = exists ? statSync(path).size : 0;
|
|
26
|
-
return {
|
|
27
|
-
loader,
|
|
28
|
-
uri,
|
|
29
|
-
status: exists ? options.status ?? "loaded" : "missing",
|
|
30
|
-
bytes,
|
|
31
|
-
warnings: options.warnings ?? [],
|
|
32
|
-
unsupportedExtensions: options.unsupportedExtensions ?? [],
|
|
33
|
-
decoderNeeds: options.decoderNeeds ?? [],
|
|
34
|
-
memoryEstimateBytes: bytes * 2
|
|
35
|
-
};
|
|
36
|
-
}
|
package/src/loaders/MTLLoader.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { createThreeCompatFileLoaderDiagnostic, type ThreeCompatLoaderDiagnostic } from "./LoaderDiagnostics";
|
|
4
|
-
|
|
5
|
-
export interface ThreeCompatLoadedMtlAsset {
|
|
6
|
-
readonly uri: string;
|
|
7
|
-
readonly materials: readonly string[];
|
|
8
|
-
readonly diagnostic: ThreeCompatLoaderDiagnostic;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class MTLLoaderThreeCompat {
|
|
12
|
-
load(uri: string): ThreeCompatLoadedMtlAsset {
|
|
13
|
-
const text = readFileSync(resolve(uri), "utf8");
|
|
14
|
-
return {
|
|
15
|
-
uri,
|
|
16
|
-
materials: text.split("\n").filter((line) => line.startsWith("newmtl ")).map((line) => line.slice("newmtl ".length).trim()),
|
|
17
|
-
diagnostic: createThreeCompatFileLoaderDiagnostic("MTLLoaderThreeCompat", uri)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
}
|
package/src/loaders/OBJLoader.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { createThreeCompatFileLoaderDiagnostic, type ThreeCompatLoaderDiagnostic } from "./LoaderDiagnostics";
|
|
4
|
-
|
|
5
|
-
export interface ThreeCompatLoadedObjAsset {
|
|
6
|
-
readonly uri: string;
|
|
7
|
-
readonly vertices: number;
|
|
8
|
-
readonly faces: number;
|
|
9
|
-
readonly mtllibs: readonly string[];
|
|
10
|
-
readonly diagnostic: ThreeCompatLoaderDiagnostic;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export class OBJLoaderThreeCompat {
|
|
14
|
-
load(uri: string): ThreeCompatLoadedObjAsset {
|
|
15
|
-
const text = readFileSync(resolve(uri), "utf8");
|
|
16
|
-
return {
|
|
17
|
-
uri,
|
|
18
|
-
vertices: text.split("\n").filter((line) => line.startsWith("v ")).length,
|
|
19
|
-
faces: text.split("\n").filter((line) => line.startsWith("f ")).length,
|
|
20
|
-
mtllibs: text.split("\n").filter((line) => line.startsWith("mtllib ")).map((line) => line.slice("mtllib ".length).trim()),
|
|
21
|
-
diagnostic: createThreeCompatFileLoaderDiagnostic("OBJLoaderThreeCompat", uri)
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createThreeCompatFileLoaderDiagnostic } from "./LoaderDiagnostics";
|
|
2
|
-
|
|
3
|
-
export type ThreeCompatBrowserTextureFormat = "png" | "jpg" | "jpeg" | "webp";
|
|
4
|
-
|
|
5
|
-
export class TextureLoaderThreeCompat {
|
|
6
|
-
readonly supportedFormats: readonly ThreeCompatBrowserTextureFormat[] = ["png", "jpg", "jpeg", "webp"];
|
|
7
|
-
|
|
8
|
-
load(uri: string) {
|
|
9
|
-
const extension = uri.split(".").pop()?.toLowerCase() ?? "";
|
|
10
|
-
return createThreeCompatFileLoaderDiagnostic("TextureLoaderThreeCompat", uri, {
|
|
11
|
-
warnings: this.supportedFormats.includes(extension as ThreeCompatBrowserTextureFormat) ? [] : [`Texture format ${extension || "unknown"} requires browser support check.`]
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createThreeCompatFileLoaderDiagnostic, type ThreeCompatLoaderDiagnostic } from "./LoaderDiagnostics";
|
|
2
|
-
|
|
3
|
-
export interface ThreeCompatLoadedGltfAsset {
|
|
4
|
-
readonly uri: string;
|
|
5
|
-
readonly diagnostic: ThreeCompatLoaderDiagnostic;
|
|
6
|
-
readonly capabilities: readonly string[];
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class ThreeCompatGLTFLoader {
|
|
10
|
-
load(uri: string): ThreeCompatLoadedGltfAsset {
|
|
11
|
-
return {
|
|
12
|
-
uri,
|
|
13
|
-
diagnostic: createThreeCompatFileLoaderDiagnostic("ThreeCompatGLTFLoader", uri, {
|
|
14
|
-
decoderNeeds: ["draco-if-extension-present", "meshopt-if-extension-present", "ktx2-if-extension-present"]
|
|
15
|
-
}),
|
|
16
|
-
capabilities: ["pbr", "animations", "skins", "morph-targets", "images", "textures", "extension-diagnostics"]
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
}
|
package/src/loaders/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { ThreeCompatGLTFLoader } from "./ThreeCompatGLTFLoader";
|
|
2
|
-
export type { ThreeCompatLoadedGltfAsset } from "./ThreeCompatGLTFLoader";
|
|
3
|
-
export { OBJLoaderThreeCompat } from "./OBJLoader";
|
|
4
|
-
export type { ThreeCompatLoadedObjAsset } from "./OBJLoader";
|
|
5
|
-
export { MTLLoaderThreeCompat } from "./MTLLoader";
|
|
6
|
-
export type { ThreeCompatLoadedMtlAsset } from "./MTLLoader";
|
|
7
|
-
export { HDRLoaderThreeCompat } from "./HDRLoader";
|
|
8
|
-
export { EXRLoaderThreeCompat } from "./EXRLoader";
|
|
9
|
-
export { KTX2LoaderThreeCompat } from "./KTX2Loader";
|
|
10
|
-
export { TextureLoaderThreeCompat } from "./TextureLoader";
|
|
11
|
-
export type { ThreeCompatBrowserTextureFormat } from "./TextureLoader";
|
|
12
|
-
export { CubeTextureLoaderThreeCompat } from "./CubeTextureLoader";
|
|
13
|
-
export { createThreeCompatFileLoaderDiagnostic } from "./LoaderDiagnostics";
|
|
14
|
-
export type { ThreeCompatLoaderDiagnostic, ThreeCompatLoaderStatus } from "./LoaderDiagnostics";
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export interface ThreeCompatTrackedAssetInput {
|
|
2
|
-
readonly id: string;
|
|
3
|
-
readonly class: string;
|
|
4
|
-
readonly localPath: string;
|
|
5
|
-
readonly visualEvidenceSlot?: boolean;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface ThreeCompatSourceAsset {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
readonly name: string;
|
|
11
|
-
readonly license: string;
|
|
12
|
-
readonly format: string;
|
|
13
|
-
readonly tags: readonly string[];
|
|
14
|
-
readonly source: {
|
|
15
|
-
readonly repository: string;
|
|
16
|
-
readonly revision: string;
|
|
17
|
-
readonly path: string;
|
|
18
|
-
readonly uri: string;
|
|
19
|
-
readonly sha256: string;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface ThreeCompatAssetProvenance extends ThreeCompatTrackedAssetInput {
|
|
24
|
-
readonly name: string;
|
|
25
|
-
readonly license: string;
|
|
26
|
-
readonly format: string;
|
|
27
|
-
readonly tags: readonly string[];
|
|
28
|
-
readonly repository: string;
|
|
29
|
-
readonly revision: string;
|
|
30
|
-
readonly sourcePath: string;
|
|
31
|
-
readonly uri: string;
|
|
32
|
-
readonly sha256: string;
|
|
33
|
-
readonly licenseReviewRequired: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function createThreeCompatAssetProvenance(input: ThreeCompatTrackedAssetInput, source: ThreeCompatSourceAsset): ThreeCompatAssetProvenance {
|
|
37
|
-
return {
|
|
38
|
-
...input,
|
|
39
|
-
name: source.name,
|
|
40
|
-
license: source.license,
|
|
41
|
-
format: source.format,
|
|
42
|
-
tags: source.tags,
|
|
43
|
-
repository: source.source.repository,
|
|
44
|
-
revision: source.source.revision,
|
|
45
|
-
sourcePath: source.source.path,
|
|
46
|
-
uri: source.source.uri,
|
|
47
|
-
sha256: source.source.sha256,
|
|
48
|
-
licenseReviewRequired: /review|trademark|limitations/i.test(source.license)
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { resolve } from "node:path";
|
|
3
|
-
import { createThreeCompatAssetProvenance, type ThreeCompatAssetProvenance, type ThreeCompatSourceAsset, type ThreeCompatTrackedAssetInput } from "./ThreeCompatAssetProvenance";
|
|
4
|
-
|
|
5
|
-
export interface ThreeCompatAssetManifest {
|
|
6
|
-
readonly schema: "a3d-three-compat-asset-library";
|
|
7
|
-
readonly sourceManifest: string;
|
|
8
|
-
readonly requirements: {
|
|
9
|
-
readonly minimumTrackedAssets: number;
|
|
10
|
-
readonly minimumLocalAssets: number;
|
|
11
|
-
readonly minimumVisualEvidenceSlots: number;
|
|
12
|
-
readonly everyAssetRequiresLicenseSourceShaAndLocalPath: boolean;
|
|
13
|
-
};
|
|
14
|
-
readonly claimBoundary: string;
|
|
15
|
-
readonly assets: readonly ThreeCompatTrackedAssetInput[];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface ThreeCompatAssetRegistrySummary {
|
|
19
|
-
readonly trackedAssetCount: number;
|
|
20
|
-
readonly localAssetCount: number;
|
|
21
|
-
readonly visualEvidenceSlotCount: number;
|
|
22
|
-
readonly classes: readonly string[];
|
|
23
|
-
readonly advancedMaterialAssetCount: number;
|
|
24
|
-
readonly animationSkinMorphAssetCount: number;
|
|
25
|
-
readonly textureAssetCount: number;
|
|
26
|
-
readonly licenseReviewRequiredCount: number;
|
|
27
|
-
readonly missingSourceIds: readonly string[];
|
|
28
|
-
readonly missingLocalPaths: readonly string[];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export function loadThreeCompatAssetManifest(path = "fixtures/three-compat/assets/manifest.json"): ThreeCompatAssetManifest {
|
|
32
|
-
return JSON.parse(readFileSync(resolve(path), "utf8")) as ThreeCompatAssetManifest;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function loadThreeCompatAssetRegistry(manifest = loadThreeCompatAssetManifest()): readonly ThreeCompatAssetProvenance[] {
|
|
36
|
-
const sourceManifest = JSON.parse(readFileSync(resolve(manifest.sourceManifest), "utf8")) as { readonly assets: readonly ThreeCompatSourceAsset[] };
|
|
37
|
-
const sourceById = new Map(sourceManifest.assets.map((asset) => [asset.id, asset]));
|
|
38
|
-
return manifest.assets.flatMap((asset) => {
|
|
39
|
-
const source = sourceById.get(asset.id);
|
|
40
|
-
return source ? [createThreeCompatAssetProvenance(asset, source)] : [];
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function summarizeThreeCompatAssetRegistry(manifest = loadThreeCompatAssetManifest()): ThreeCompatAssetRegistrySummary {
|
|
45
|
-
const registry = loadThreeCompatAssetRegistry(manifest);
|
|
46
|
-
const sourceIds = new Set(registry.map((asset) => asset.id));
|
|
47
|
-
const missingSourceIds = manifest.assets.map((asset) => asset.id).filter((id) => !sourceIds.has(id));
|
|
48
|
-
const missingLocalPaths = registry.filter((asset) => !existsSync(resolve(asset.localPath))).map((asset) => asset.localPath);
|
|
49
|
-
return {
|
|
50
|
-
trackedAssetCount: manifest.assets.length,
|
|
51
|
-
localAssetCount: registry.length - missingLocalPaths.length,
|
|
52
|
-
visualEvidenceSlotCount: registry.filter((asset) => asset.visualEvidenceSlot).length,
|
|
53
|
-
classes: [...new Set(registry.map((asset) => asset.class))].sort(),
|
|
54
|
-
advancedMaterialAssetCount: registry.filter((asset) => /clearcoat|specular|sheen|transmission|anisotropy|material|metal|normal|rough/i.test([...asset.tags, asset.id].join(" "))).length,
|
|
55
|
-
animationSkinMorphAssetCount: registry.filter((asset) => /animat|skin|morph/i.test([...asset.tags, asset.id].join(" "))).length,
|
|
56
|
-
textureAssetCount: registry.filter((asset) => /texture|material|pbr|normal|metal|rough/i.test([...asset.tags, asset.id].join(" "))).length,
|
|
57
|
-
licenseReviewRequiredCount: registry.filter((asset) => asset.licenseReviewRequired).length,
|
|
58
|
-
missingSourceIds,
|
|
59
|
-
missingLocalPaths
|
|
60
|
-
};
|
|
61
|
-
}
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
import { loadProductionGLTFRenderPipeline } from "../asset-corpus/ProductionGLTFRenderPipeline";
|
|
2
|
-
import type { ProductionGLTFRenderPipeline, ProductionGLTFRenderPipelineOptions } from "../asset-corpus/ProductionGLTFRenderPipeline";
|
|
3
|
-
|
|
4
|
-
export type CurrentRoutesFlagshipAssetId =
|
|
5
|
-
| "damaged-helmet"
|
|
6
|
-
| "boom-box"
|
|
7
|
-
| "avocado"
|
|
8
|
-
| "clear-coat-test"
|
|
9
|
-
| "sheen-test-grid"
|
|
10
|
-
| "product-camera"
|
|
11
|
-
| "material-spheres"
|
|
12
|
-
| "variant-product"
|
|
13
|
-
| "transmission-material-sample"
|
|
14
|
-
| "animated-colors-cube"
|
|
15
|
-
| "cesium-man"
|
|
16
|
-
| "lantern"
|
|
17
|
-
| "chronograph-watch"
|
|
18
|
-
| "car-concept"
|
|
19
|
-
| "materials-variants-shoe"
|
|
20
|
-
| "sunglasses-khronos"
|
|
21
|
-
| "toy-car"
|
|
22
|
-
| "antique-camera-interior"
|
|
23
|
-
| "lantern-interior"
|
|
24
|
-
| "robot-expressive"
|
|
25
|
-
| "soldier"
|
|
26
|
-
| "xbot"
|
|
27
|
-
| "cesium-milk-truck"
|
|
28
|
-
| "duck";
|
|
29
|
-
|
|
30
|
-
export interface CurrentRoutesFlagshipAsset {
|
|
31
|
-
readonly id: CurrentRoutesFlagshipAssetId;
|
|
32
|
-
readonly name: string;
|
|
33
|
-
readonly localPath: string;
|
|
34
|
-
readonly role: string;
|
|
35
|
-
readonly license: string;
|
|
36
|
-
readonly expectedFeatures: readonly string[];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const CURRENT_ROUTES_FLAGSHIP_ASSETS: readonly CurrentRoutesFlagshipAsset[] = [
|
|
40
|
-
{
|
|
41
|
-
id: "damaged-helmet",
|
|
42
|
-
name: "Damaged Helmet",
|
|
43
|
-
localPath: "fixtures/asset-corpus/damaged-helmet.glb",
|
|
44
|
-
role: "flagship-pbr",
|
|
45
|
-
license: "CC-BY-4.0-and-CC-BY-NC-4.0",
|
|
46
|
-
expectedFeatures: ["baseColorTexture", "metallicRoughnessTexture", "normalTexture", "occlusionTexture", "emissiveTexture", "hdrIbl"]
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
id: "boom-box",
|
|
50
|
-
name: "Boom Box",
|
|
51
|
-
localPath: "fixtures/asset-corpus/boom-box.glb",
|
|
52
|
-
role: "flagship-product",
|
|
53
|
-
license: "CC0-1.0",
|
|
54
|
-
expectedFeatures: ["baseColorTexture", "metallicRoughnessTexture", "normalTexture", "occlusionTexture", "hdrIbl"]
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: "avocado",
|
|
58
|
-
name: "Avocado",
|
|
59
|
-
localPath: "fixtures/asset-corpus/avocado.glb",
|
|
60
|
-
role: "flagship-organic-pbr",
|
|
61
|
-
license: "CC-BY-4.0",
|
|
62
|
-
expectedFeatures: ["baseColorTexture", "normalTexture", "roughnessVariation", "organicProduct", "hdrIbl"]
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
id: "clear-coat-test",
|
|
66
|
-
name: "Clear Coat Test",
|
|
67
|
-
localPath: "fixtures/asset-corpus/clear-coat-test.glb",
|
|
68
|
-
role: "flagship-clearcoat-materials",
|
|
69
|
-
license: "CC-BY-4.0",
|
|
70
|
-
expectedFeatures: ["KHR_materials_clearcoat", "baseColorTexture", "normalTexture", "materialGrid", "hdrIbl"]
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
id: "sheen-test-grid",
|
|
74
|
-
name: "Sheen Test Grid",
|
|
75
|
-
localPath: "fixtures/asset-corpus/sheen-test-grid.glb",
|
|
76
|
-
role: "flagship-sheen-materials",
|
|
77
|
-
license: "CC-BY-4.0",
|
|
78
|
-
expectedFeatures: ["KHR_materials_sheen", "baseColorTexture", "materialGrid", "fabricResponse", "hdrIbl"]
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
id: "product-camera",
|
|
82
|
-
name: "Product Camera",
|
|
83
|
-
localPath: "fixtures/workflow-assets/assets/product-camera/product-camera.glb",
|
|
84
|
-
role: "standard-product-asset",
|
|
85
|
-
license: "local-fixture-corpus",
|
|
86
|
-
expectedFeatures: ["productAsset", "pbrMaterials", "textureMaterials", "hdrIbl"]
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
id: "material-spheres",
|
|
90
|
-
name: "Material Spheres",
|
|
91
|
-
localPath: "fixtures/workflow-assets/assets/material-spheres/material-spheres.glb",
|
|
92
|
-
role: "standard-material-comparison",
|
|
93
|
-
license: "local-fixture-corpus",
|
|
94
|
-
expectedFeatures: ["materialGrid", "roughnessVariation", "metallicVariation", "hdrIbl"]
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
id: "variant-product",
|
|
98
|
-
name: "Variant Product",
|
|
99
|
-
localPath: "fixtures/workflow-assets/assets/variant-product/variant-product.glb",
|
|
100
|
-
role: "additional-product-variant",
|
|
101
|
-
license: "local-fixture-corpus",
|
|
102
|
-
expectedFeatures: ["productVariant", "multiMaterialProduct", "pbrMaterials", "hdrIbl"]
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
id: "transmission-material-sample",
|
|
106
|
-
name: "Transmission Material Sample",
|
|
107
|
-
localPath: "fixtures/threejs-parity/assets/materials/compare-transmission.glb",
|
|
108
|
-
role: "additional-transmission-material",
|
|
109
|
-
license: "local-fixture-corpus",
|
|
110
|
-
expectedFeatures: ["transmission", "glassMaterial", "materialComparison", "hdrIbl"]
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
id: "animated-colors-cube",
|
|
114
|
-
name: "Animated Colors Cube",
|
|
115
|
-
localPath: "fixtures/three-compat/assets/corpus/animated-colors-cube.glb",
|
|
116
|
-
role: "standard-animation-asset",
|
|
117
|
-
license: "local-fixture-corpus",
|
|
118
|
-
expectedFeatures: ["animationClip", "vertexColors", "starterAsset", "hdrIbl"]
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: "cesium-man",
|
|
122
|
-
name: "Cesium Man",
|
|
123
|
-
localPath: "fixtures/three-compat/assets/corpus/cesium-man.glb",
|
|
124
|
-
role: "additional-character-animation",
|
|
125
|
-
license: "local-fixture-corpus",
|
|
126
|
-
expectedFeatures: ["skinning", "animationClip", "characterAsset", "hdrIbl"]
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
id: "lantern",
|
|
130
|
-
name: "Lantern",
|
|
131
|
-
localPath: "fixtures/asset-corpus/lantern.glb",
|
|
132
|
-
role: "flagship-emissive",
|
|
133
|
-
license: "CC0-1.0",
|
|
134
|
-
expectedFeatures: ["baseColorTexture", "metallicRoughnessTexture", "normalTexture", "emissiveTexture", "hdrIbl"]
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
id: "chronograph-watch",
|
|
138
|
-
name: "Chronograph Watch",
|
|
139
|
-
localPath: "fixtures/threejs-parity/assets/product/chronograph-watch.glb",
|
|
140
|
-
role: "flagship-configurator",
|
|
141
|
-
license: "local-fixture-corpus",
|
|
142
|
-
expectedFeatures: ["KHR_materials_variants", "KHR_materials_transmission", "textureTransform", "multiMaterialProduct", "hdrIbl"]
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
id: "car-concept",
|
|
146
|
-
name: "Concept Car",
|
|
147
|
-
localPath: "fixtures/threejs-parity/assets/vehicles/car-concept.glb",
|
|
148
|
-
role: "flagship-automotive",
|
|
149
|
-
license: "local-fixture-corpus",
|
|
150
|
-
expectedFeatures: ["clearcoat", "iridescence", "transmission", "materialVariants", "highTriangleCount", "hdrIbl"]
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
id: "materials-variants-shoe",
|
|
154
|
-
name: "Materials Variants Shoe",
|
|
155
|
-
localPath: "fixtures/threejs-parity/assets/product/materials-variants-shoe.glb",
|
|
156
|
-
role: "flagship-product-variants",
|
|
157
|
-
license: "local-fixture-corpus",
|
|
158
|
-
expectedFeatures: ["materialVariants", "baseColorTexture", "normalTexture", "productConfigurator"]
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
id: "sunglasses-khronos",
|
|
162
|
-
name: "Khronos Sunglasses",
|
|
163
|
-
localPath: "fixtures/threejs-parity/assets/product/sunglasses-khronos.glb",
|
|
164
|
-
role: "flagship-glass-product",
|
|
165
|
-
license: "local-fixture-corpus",
|
|
166
|
-
expectedFeatures: ["transmission", "volume", "ior", "iridescence", "glassProduct"]
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
id: "toy-car",
|
|
170
|
-
name: "Toy Car",
|
|
171
|
-
localPath: "fixtures/threejs-parity/assets/vehicles/toy-car.glb",
|
|
172
|
-
role: "flagship-vehicle-product",
|
|
173
|
-
license: "local-fixture-corpus",
|
|
174
|
-
expectedFeatures: ["authoredVehicle", "pbrMaterials", "hdrIbl"]
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
id: "antique-camera-interior",
|
|
178
|
-
name: "Antique Camera Interior",
|
|
179
|
-
localPath: "fixtures/asset-corpus/antique-camera.glb",
|
|
180
|
-
role: "flagship-interior-prop",
|
|
181
|
-
license: "local-fixture-corpus",
|
|
182
|
-
expectedFeatures: ["interiorScene", "pbrMaterials", "largeTextureSet", "hdrIbl"]
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
id: "lantern-interior",
|
|
186
|
-
name: "Lantern Interior",
|
|
187
|
-
localPath: "fixtures/threejs-parity/assets/architecture/lantern-interior.glb",
|
|
188
|
-
role: "flagship-emissive-interior",
|
|
189
|
-
license: "local-fixture-corpus",
|
|
190
|
-
expectedFeatures: ["emissiveTexture", "interiorScene", "pbrMaterials", "hdrIbl"]
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
id: "robot-expressive",
|
|
194
|
-
name: "Robot Expressive",
|
|
195
|
-
localPath: "fixtures/threejs-parity/assets/character/robot-expressive.glb",
|
|
196
|
-
role: "flagship-character-animation",
|
|
197
|
-
license: "local-fixture-corpus",
|
|
198
|
-
expectedFeatures: ["skinning", "morphTargets", "animationClips", "characterRig"]
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
id: "soldier",
|
|
202
|
-
name: "Soldier",
|
|
203
|
-
localPath: "fixtures/threejs-parity/assets/character/soldier.glb",
|
|
204
|
-
role: "flagship-character-animation",
|
|
205
|
-
license: "local-fixture-corpus",
|
|
206
|
-
expectedFeatures: ["skinning", "textureMaterials", "animationClips", "characterRig"]
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
id: "xbot",
|
|
210
|
-
name: "XBot",
|
|
211
|
-
localPath: "fixtures/threejs-parity/assets/character/xbot.glb",
|
|
212
|
-
role: "flagship-character-animation",
|
|
213
|
-
license: "local-fixture-corpus",
|
|
214
|
-
expectedFeatures: ["skinning", "animationClips", "characterRig"]
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
id: "cesium-milk-truck",
|
|
218
|
-
name: "Cesium Milk Truck",
|
|
219
|
-
localPath: "fixtures/threejs-parity/assets/physics/cesium-milk-truck.glb",
|
|
220
|
-
role: "flagship-physics-vehicle",
|
|
221
|
-
license: "local-fixture-corpus",
|
|
222
|
-
expectedFeatures: ["authoredVehicle", "physicsProp", "pbrMaterials"]
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
id: "duck",
|
|
226
|
-
name: "Duck",
|
|
227
|
-
localPath: "fixtures/threejs-parity/assets/physics/duck.glb",
|
|
228
|
-
role: "flagship-physics-prop",
|
|
229
|
-
license: "local-fixture-corpus",
|
|
230
|
-
expectedFeatures: ["authoredProp", "physicsColliderTarget", "pbrMaterials"]
|
|
231
|
-
}
|
|
232
|
-
] as const;
|
|
233
|
-
|
|
234
|
-
export interface CurrentRoutesLoadFlagshipAssetOptions extends Omit<ProductionGLTFRenderPipelineOptions, "url" | "assetId" | "assetName"> {
|
|
235
|
-
readonly id?: CurrentRoutesFlagshipAssetId;
|
|
236
|
-
readonly origin?: string;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export function listCurrentRoutesFlagshipAssets(): readonly CurrentRoutesFlagshipAsset[] {
|
|
240
|
-
return CURRENT_ROUTES_FLAGSHIP_ASSETS;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export function resolveCurrentRoutesFlagshipAsset(id: CurrentRoutesFlagshipAssetId = "damaged-helmet"): CurrentRoutesFlagshipAsset {
|
|
244
|
-
const asset = CURRENT_ROUTES_FLAGSHIP_ASSETS.find((entry) => entry.id === id);
|
|
245
|
-
if (!asset) throw new Error(`Unknown CurrentRoutes flagship asset: ${id}`);
|
|
246
|
-
return asset;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export function currentRoutesAssetUrl(asset: CurrentRoutesFlagshipAsset, origin = ""): string {
|
|
250
|
-
const prefix = origin.endsWith("/") ? origin.slice(0, -1) : origin;
|
|
251
|
-
return `${prefix}/${asset.localPath}`;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export async function loadCurrentRoutesFlagshipAsset(options: CurrentRoutesLoadFlagshipAssetOptions = {}): Promise<ProductionGLTFRenderPipeline> {
|
|
255
|
-
const asset = resolveCurrentRoutesFlagshipAsset(options.id);
|
|
256
|
-
return loadProductionGLTFRenderPipeline({
|
|
257
|
-
...options,
|
|
258
|
-
url: currentRoutesAssetUrl(asset, options.origin),
|
|
259
|
-
assetId: asset.id,
|
|
260
|
-
assetName: asset.name
|
|
261
|
-
});
|
|
262
|
-
}
|