@aura3d/workflows 1.0.6
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/AnimationLabWorkflow.d.ts +3 -0
- package/dist/AnimationLabWorkflow.d.ts.map +1 -0
- package/dist/AnimationLabWorkflow.js +156 -0
- package/dist/AnimationLabWorkflow.js.map +1 -0
- package/dist/AssetViewerWorkflow.d.ts +3 -0
- package/dist/AssetViewerWorkflow.d.ts.map +1 -0
- package/dist/AssetViewerWorkflow.js +35 -0
- package/dist/AssetViewerWorkflow.js.map +1 -0
- package/dist/ComparisonWorkflow.d.ts +3 -0
- package/dist/ComparisonWorkflow.d.ts.map +1 -0
- package/dist/ComparisonWorkflow.js +67 -0
- package/dist/ComparisonWorkflow.js.map +1 -0
- package/dist/InteractiveSceneWorkflow.d.ts +3 -0
- package/dist/InteractiveSceneWorkflow.d.ts.map +1 -0
- package/dist/InteractiveSceneWorkflow.js +43 -0
- package/dist/InteractiveSceneWorkflow.js.map +1 -0
- package/dist/MaterialStudioWorkflow.d.ts +3 -0
- package/dist/MaterialStudioWorkflow.d.ts.map +1 -0
- package/dist/MaterialStudioWorkflow.js +47 -0
- package/dist/MaterialStudioWorkflow.js.map +1 -0
- package/dist/ProductConfiguratorWorkflow.d.ts +3 -0
- package/dist/ProductConfiguratorWorkflow.d.ts.map +1 -0
- package/dist/ProductConfiguratorWorkflow.js +25 -0
- package/dist/ProductConfiguratorWorkflow.js.map +1 -0
- package/dist/SceneShowcaseWorkflow.d.ts +3 -0
- package/dist/SceneShowcaseWorkflow.d.ts.map +1 -0
- package/dist/SceneShowcaseWorkflow.js +44 -0
- package/dist/SceneShowcaseWorkflow.js.map +1 -0
- package/dist/WorkflowDiagnostics.d.ts +11 -0
- package/dist/WorkflowDiagnostics.d.ts.map +1 -0
- package/dist/WorkflowDiagnostics.js +34 -0
- package/dist/WorkflowDiagnostics.js.map +1 -0
- package/dist/WorkflowTypes.d.ts +90 -0
- package/dist/WorkflowTypes.d.ts.map +1 -0
- package/dist/WorkflowTypes.js +2 -0
- package/dist/WorkflowTypes.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/production-runtime/ArchitectureWorkflow.d.ts +7 -0
- package/dist/production-runtime/ArchitectureWorkflow.d.ts.map +1 -0
- package/dist/production-runtime/ArchitectureWorkflow.js +2 -0
- package/dist/production-runtime/ArchitectureWorkflow.js.map +1 -0
- package/dist/production-runtime/AssetInspectionWorkflow.d.ts +7 -0
- package/dist/production-runtime/AssetInspectionWorkflow.d.ts.map +1 -0
- package/dist/production-runtime/AssetInspectionWorkflow.js +2 -0
- package/dist/production-runtime/AssetInspectionWorkflow.js.map +1 -0
- package/dist/production-runtime/CinematicWorkflow.d.ts +7 -0
- package/dist/production-runtime/CinematicWorkflow.d.ts.map +1 -0
- package/dist/production-runtime/CinematicWorkflow.js +2 -0
- package/dist/production-runtime/CinematicWorkflow.js.map +1 -0
- package/dist/production-runtime/MaterialAuthoringWorkflow.d.ts +7 -0
- package/dist/production-runtime/MaterialAuthoringWorkflow.d.ts.map +1 -0
- package/dist/production-runtime/MaterialAuthoringWorkflow.js +2 -0
- package/dist/production-runtime/MaterialAuthoringWorkflow.js.map +1 -0
- package/dist/production-runtime/ProductRenderWorkflow.d.ts +7 -0
- package/dist/production-runtime/ProductRenderWorkflow.d.ts.map +1 -0
- package/dist/production-runtime/ProductRenderWorkflow.js +2 -0
- package/dist/production-runtime/ProductRenderWorkflow.js.map +1 -0
- package/dist/production-runtime/ProductionExampleRuntime.d.ts +66 -0
- package/dist/production-runtime/ProductionExampleRuntime.d.ts.map +1 -0
- package/dist/production-runtime/ProductionExampleRuntime.js +189 -0
- package/dist/production-runtime/ProductionExampleRuntime.js.map +1 -0
- package/dist/production-runtime/ProductionWorkflows.d.ts +69 -0
- package/dist/production-runtime/ProductionWorkflows.d.ts.map +1 -0
- package/dist/production-runtime/ProductionWorkflows.js +128 -0
- package/dist/production-runtime/ProductionWorkflows.js.map +1 -0
- package/dist/production-runtime/WorkflowDiagnostics.d.ts +7 -0
- package/dist/production-runtime/WorkflowDiagnostics.d.ts.map +1 -0
- package/dist/production-runtime/WorkflowDiagnostics.js +2 -0
- package/dist/production-runtime/WorkflowDiagnostics.js.map +1 -0
- package/dist/production-runtime/index.d.ts +11 -0
- package/dist/production-runtime/index.d.ts.map +1 -0
- package/dist/production-runtime/index.js +9 -0
- package/dist/production-runtime/index.js.map +1 -0
- package/dist/workflow-foundation/index.d.ts +26 -0
- package/dist/workflow-foundation/index.d.ts.map +1 -0
- package/dist/workflow-foundation/index.js +25 -0
- package/dist/workflow-foundation/index.js.map +1 -0
- package/package.json +22 -0
- package/src/AnimationLabWorkflow.ts +165 -0
- package/src/AssetViewerWorkflow.ts +37 -0
- package/src/ComparisonWorkflow.ts +68 -0
- package/src/InteractiveSceneWorkflow.ts +44 -0
- package/src/MaterialStudioWorkflow.ts +48 -0
- package/src/ProductConfiguratorWorkflow.ts +32 -0
- package/src/SceneShowcaseWorkflow.ts +45 -0
- package/src/WorkflowDiagnostics.ts +47 -0
- package/src/WorkflowTypes.ts +113 -0
- package/src/index.ts +34 -0
- package/src/production-runtime/ArchitectureWorkflow.ts +2 -0
- package/src/production-runtime/AssetInspectionWorkflow.ts +2 -0
- package/src/production-runtime/CinematicWorkflow.ts +2 -0
- package/src/production-runtime/MaterialAuthoringWorkflow.ts +2 -0
- package/src/production-runtime/ProductRenderWorkflow.ts +2 -0
- package/src/production-runtime/ProductionExampleRuntime.ts +267 -0
- package/src/production-runtime/ProductionWorkflows.ts +203 -0
- package/src/production-runtime/WorkflowDiagnostics.ts +2 -0
- package/src/production-runtime/index.ts +32 -0
- package/src/workflow-foundation/index.ts +27 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export const PRODUCTION_WORKFLOWS = [
|
|
2
|
+
{
|
|
3
|
+
id: "product",
|
|
4
|
+
label: "Product Configurator",
|
|
5
|
+
requiredAssetClasses: ["product"],
|
|
6
|
+
requiredRendererFeatures: ["real-webgl2-context", "pbr-materials", "hdr-ibl-ready", "pixel-readback"],
|
|
7
|
+
requiredProof: ["imported-glb", "hdr-environment", "draw-calls", "texture-memory", "canvas-screenshot"],
|
|
8
|
+
differentiation: ["runtime proof bundle", "material variant workflow", "developer metrics"]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
id: "asset",
|
|
12
|
+
label: "Asset Inspector",
|
|
13
|
+
requiredAssetClasses: ["product", "character", "material"],
|
|
14
|
+
requiredRendererFeatures: ["real-webgl2-context", "imported-gltf-render-source", "pixel-readback"],
|
|
15
|
+
requiredProof: ["asset metadata", "skinning-or-morph-visibility", "corpus provenance"],
|
|
16
|
+
differentiation: ["asset preflight", "metadata and visual proof in one report"]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "material",
|
|
20
|
+
label: "Material Studio",
|
|
21
|
+
requiredAssetClasses: ["material"],
|
|
22
|
+
requiredRendererFeatures: ["pbr-materials", "hdr-ibl-ready", "texture-upload-diagnostics"],
|
|
23
|
+
requiredProof: ["material-extension-metadata", "hdr-lighting", "texture bindings"],
|
|
24
|
+
differentiation: ["extension coverage reporting", "visual QA score per material"]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "architecture",
|
|
28
|
+
label: "Architecture Viewer",
|
|
29
|
+
requiredAssetClasses: ["architecture", "product"],
|
|
30
|
+
requiredRendererFeatures: ["hdr-ibl-ready", "camera-framing", "pixel-readback"],
|
|
31
|
+
requiredProof: ["day-night-environment", "camera defaults", "visual quality metrics"],
|
|
32
|
+
differentiation: ["environment comparison", "inspection-ready camera defaults"]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "cinematic",
|
|
36
|
+
label: "Cinematic Postprocess",
|
|
37
|
+
requiredAssetClasses: ["product"],
|
|
38
|
+
requiredRendererFeatures: ["postprocess-presentation", "tone-mapping", "bloom", "fxaa"],
|
|
39
|
+
requiredProof: ["postprocess-chain", "nonblank diffable screenshot", "renderer diagnostics"],
|
|
40
|
+
differentiation: ["proof-backed postprocess presets", "gallery-ready output"]
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
export function listProductionWorkflowDefinitions() {
|
|
44
|
+
return PRODUCTION_WORKFLOWS;
|
|
45
|
+
}
|
|
46
|
+
export function createProductionAssetPreflight(input) {
|
|
47
|
+
const renderRequirements = input.renderRequirements ?? [];
|
|
48
|
+
const missing = [
|
|
49
|
+
...(!input.id ? ["id"] : []),
|
|
50
|
+
...(!input.localPath ? ["localPath"] : []),
|
|
51
|
+
...(!input.sourceUri ? ["sourceUri"] : []),
|
|
52
|
+
...(!input.sha256 ? ["sha256"] : []),
|
|
53
|
+
...(!input.license ? ["license"] : []),
|
|
54
|
+
...(!input.bytes || input.bytes <= 0 ? ["bytes"] : []),
|
|
55
|
+
...(renderRequirements.length === 0 ? ["renderRequirements"] : [])
|
|
56
|
+
];
|
|
57
|
+
const warnings = [
|
|
58
|
+
...(!input.tags?.includes("pbr") ? ["Asset is not tagged as PBR; workflow may need material fallback."] : []),
|
|
59
|
+
...(!renderRequirements.includes("hdrIbl") ? ["Asset does not declare HDR IBL as an asset-specific requirement; renderer workflow must provide fallback HDR lighting proof."] : []),
|
|
60
|
+
...((input.bytes ?? 0) < 10_000 ? ["Asset is very small for visual parity proof."] : [])
|
|
61
|
+
];
|
|
62
|
+
return {
|
|
63
|
+
assetId: input.id,
|
|
64
|
+
pass: missing.length === 0,
|
|
65
|
+
missing,
|
|
66
|
+
warnings
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export function createProductionVisualQAResult(input) {
|
|
70
|
+
const totalPixels = Math.max(1, input.width * input.height);
|
|
71
|
+
const coverage = input.nonBlackPixels / totalPixels;
|
|
72
|
+
const score = Number(Math.min(100, ((input.realRendererProof ? 22 : 0) +
|
|
73
|
+
(input.rendererBackend === "webgl2" ? 12 : 0) +
|
|
74
|
+
Math.min(24, coverage * 30) +
|
|
75
|
+
Math.min(24, input.uniqueColorBuckets / 8) +
|
|
76
|
+
Math.min(10, input.drawCalls * 1.5) +
|
|
77
|
+
Math.min(8, input.textureMemory / 4_000_000))).toFixed(3));
|
|
78
|
+
const failures = [
|
|
79
|
+
...(!input.realRendererProof ? ["missing-real-renderer-proof"] : []),
|
|
80
|
+
...(input.rendererBackend !== "webgl2" ? ["unexpected-renderer-backend"] : []),
|
|
81
|
+
...(input.width < 128 || input.height < 128 ? ["screenshot-too-small"] : []),
|
|
82
|
+
...(input.nonBlackPixels <= 1000 ? ["blank-or-nearly-blank"] : []),
|
|
83
|
+
...(input.uniqueColorBuckets <= 4 ? ["low-color-entropy"] : []),
|
|
84
|
+
...(input.drawCalls <= 0 ? ["missing-draw-calls"] : [])
|
|
85
|
+
];
|
|
86
|
+
return {
|
|
87
|
+
screenshotPath: input.screenshotPath,
|
|
88
|
+
pass: failures.length === 0 && score >= 40,
|
|
89
|
+
score,
|
|
90
|
+
failures
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export function createProductionRendererDefaults(workflowId) {
|
|
94
|
+
const cameraByWorkflow = {
|
|
95
|
+
product: { yawRadians: -0.38, pitchRadians: -0.16, paddingRatio: 0.18 },
|
|
96
|
+
asset: { yawRadians: -0.34, pitchRadians: -0.14, paddingRatio: 0.2 },
|
|
97
|
+
material: { yawRadians: -0.42, pitchRadians: -0.16, paddingRatio: 0.22 },
|
|
98
|
+
architecture: { yawRadians: -0.52, pitchRadians: -0.2, paddingRatio: 0.24 },
|
|
99
|
+
cinematic: { yawRadians: -0.36, pitchRadians: -0.14, paddingRatio: 0.18 }
|
|
100
|
+
};
|
|
101
|
+
const camera = cameraByWorkflow[workflowId];
|
|
102
|
+
return {
|
|
103
|
+
workflowId,
|
|
104
|
+
backend: "webgl2",
|
|
105
|
+
hdrEnvironmentId: "studio-small-08",
|
|
106
|
+
qualityPreset: "hdr-studio-preview",
|
|
107
|
+
camera: {
|
|
108
|
+
policy: "require",
|
|
109
|
+
paddingRatio: camera.paddingRatio,
|
|
110
|
+
yawRadians: camera.yawRadians,
|
|
111
|
+
pitchRadians: camera.pitchRadians
|
|
112
|
+
},
|
|
113
|
+
postprocess: ["tone-mapping", "color-grade", "bloom", "fxaa"],
|
|
114
|
+
runtimeMetrics: ["appId", "sceneId", "rendererBackend", "assetIds", "hdrEnvironmentId", "drawCalls", "triangleCount", "materialCount", "textureCount", "textureMemoryEstimate", "frameTime"]
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export function createProductionWorkflowPlan(workflowId) {
|
|
118
|
+
const workflow = PRODUCTION_WORKFLOWS.find((item) => item.id === workflowId);
|
|
119
|
+
if (!workflow)
|
|
120
|
+
throw new Error(`Unknown Production workflow: ${workflowId}`);
|
|
121
|
+
return {
|
|
122
|
+
workflow,
|
|
123
|
+
defaults: createProductionRendererDefaults(workflowId),
|
|
124
|
+
preflightRequired: true,
|
|
125
|
+
visualQARequired: true
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=ProductionWorkflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductionWorkflows.js","sourceRoot":"","sources":["../../../../../packages/workflows/src/production-runtime/ProductionWorkflows.ts"],"names":[],"mappings":"AAsEA,MAAM,CAAC,MAAM,oBAAoB,GAA4C;IAC3E;QACE,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,sBAAsB;QAC7B,oBAAoB,EAAE,CAAC,SAAS,CAAC;QACjC,wBAAwB,EAAE,CAAC,qBAAqB,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,CAAC;QACrG,aAAa,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,CAAC;QACvG,eAAe,EAAE,CAAC,sBAAsB,EAAE,2BAA2B,EAAE,mBAAmB,CAAC;KAC5F;IACD;QACE,EAAE,EAAE,OAAO;QACX,KA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}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface WorkflowDiagnosticsSummary {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly ready: boolean;
|
|
4
|
+
readonly workflow: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function createWorkflowDiagnosticsSummary(): WorkflowDiagnosticsSummary;
|
|
7
|
+
//# sourceMappingURL=WorkflowDiagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowDiagnostics.d.ts","sourceRoot":"","sources":["../../../../../packages/workflows/src/production-runtime/WorkflowDiagnostics.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IAAG,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAAE;AACxH,wBAAgB,gCAAgC,IAAI,0BAA0B,CAAgF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowDiagnostics.js","sourceRoot":"","sources":["../../../../../packages/workflows/src/production-runtime/WorkflowDiagnostics.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,gCAAgC,KAAiC,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,qBAAqB,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { PRODUCTION_WORKFLOWS, createProductionAssetPreflight, createProductionRendererDefaults, createProductionVisualQAResult, createProductionWorkflowPlan, listProductionWorkflowDefinitions } from "./ProductionWorkflows";
|
|
2
|
+
export type { ProductionAssetPreflightInput, ProductionAssetPreflightResult, ProductionRendererDefaults, ProductionVisualQAInput, ProductionVisualQAResult, ProductionWorkflowDefinition, ProductionWorkflowId, ProductionWorkflowPlan } from "./ProductionWorkflows";
|
|
3
|
+
export { runProductionExample } from "./ProductionExampleRuntime";
|
|
4
|
+
export type { ProductionExampleAsset, ProductionExampleDefinition, ProductionExampleEnvironment, ProductionExampleRuntime, ProductionExampleRuntimeMetrics } from "./ProductionExampleRuntime";
|
|
5
|
+
export * from './ProductRenderWorkflow';
|
|
6
|
+
export * from './AssetInspectionWorkflow';
|
|
7
|
+
export * from './MaterialAuthoringWorkflow';
|
|
8
|
+
export * from './ArchitectureWorkflow';
|
|
9
|
+
export * from './CinematicWorkflow';
|
|
10
|
+
export * from './WorkflowDiagnostics';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/workflows/src/production-runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,gCAAgC,EAChC,8BAA8B,EAC9B,4BAA4B,EAC5B,iCAAiC,EAClC,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,YAAY,EACV,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,+BAA+B,EAChC,MAAM,4BAA4B,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { PRODUCTION_WORKFLOWS, createProductionAssetPreflight, createProductionRendererDefaults, createProductionVisualQAResult, createProductionWorkflowPlan, listProductionWorkflowDefinitions } from "./ProductionWorkflows.js";
|
|
2
|
+
export { runProductionExample } from "./ProductionExampleRuntime.js";
|
|
3
|
+
export * from './ProductRenderWorkflow.js';
|
|
4
|
+
export * from './AssetInspectionWorkflow.js';
|
|
5
|
+
export * from './MaterialAuthoringWorkflow.js';
|
|
6
|
+
export * from './ArchitectureWorkflow.js';
|
|
7
|
+
export * from './CinematicWorkflow.js';
|
|
8
|
+
export * from './WorkflowDiagnostics.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/workflows/src/production-runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,8BAA8B,EAC9B,gCAAgC,EAChC,8BAA8B,EAC9B,4BAA4B,EAC5B,iCAAiC,EAClC,MAAM,uBAAuB,CAAC;AAW/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAQlE,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export { createAssetViewerWorkflow } from "../AssetViewerWorkflow";
|
|
2
|
+
export { createProductConfiguratorWorkflow } from "../ProductConfiguratorWorkflow";
|
|
3
|
+
export { createMaterialStudioWorkflow } from "../MaterialStudioWorkflow";
|
|
4
|
+
export { createSceneShowcaseWorkflow } from "../SceneShowcaseWorkflow";
|
|
5
|
+
export { createInteractiveSceneWorkflow } from "../InteractiveSceneWorkflow";
|
|
6
|
+
export { createAnimationLabWorkflow } from "../AnimationLabWorkflow";
|
|
7
|
+
export { createComparisonWorkflow } from "../ComparisonWorkflow";
|
|
8
|
+
export { createWorkflowDiagnostics } from "../WorkflowDiagnostics";
|
|
9
|
+
export type * from "../WorkflowTypes";
|
|
10
|
+
import { createAnimationLabWorkflow } from "../AnimationLabWorkflow";
|
|
11
|
+
import { createAssetViewerWorkflow } from "../AssetViewerWorkflow";
|
|
12
|
+
import { createComparisonWorkflow } from "../ComparisonWorkflow";
|
|
13
|
+
import { createInteractiveSceneWorkflow } from "../InteractiveSceneWorkflow";
|
|
14
|
+
import { createMaterialStudioWorkflow } from "../MaterialStudioWorkflow";
|
|
15
|
+
import { createProductConfiguratorWorkflow } from "../ProductConfiguratorWorkflow";
|
|
16
|
+
import { createSceneShowcaseWorkflow } from "../SceneShowcaseWorkflow";
|
|
17
|
+
export declare const workflows: {
|
|
18
|
+
readonly assetViewer: typeof createAssetViewerWorkflow;
|
|
19
|
+
readonly productConfigurator: typeof createProductConfiguratorWorkflow;
|
|
20
|
+
readonly materialStudio: typeof createMaterialStudioWorkflow;
|
|
21
|
+
readonly sceneShowcase: typeof createSceneShowcaseWorkflow;
|
|
22
|
+
readonly interactiveScene: typeof createInteractiveSceneWorkflow;
|
|
23
|
+
readonly animationLab: typeof createAnimationLabWorkflow;
|
|
24
|
+
readonly comparison: typeof createComparisonWorkflow;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/workflows/src/workflow-foundation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,mBAAmB,kBAAkB,CAAC;AAEtC,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,eAAO,MAAM,SAAS;;;;;;;;CAQZ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export { createAssetViewerWorkflow } from "../AssetViewerWorkflow.js";
|
|
2
|
+
export { createProductConfiguratorWorkflow } from "../ProductConfiguratorWorkflow.js";
|
|
3
|
+
export { createMaterialStudioWorkflow } from "../MaterialStudioWorkflow.js";
|
|
4
|
+
export { createSceneShowcaseWorkflow } from "../SceneShowcaseWorkflow.js";
|
|
5
|
+
export { createInteractiveSceneWorkflow } from "../InteractiveSceneWorkflow.js";
|
|
6
|
+
export { createAnimationLabWorkflow } from "../AnimationLabWorkflow.js";
|
|
7
|
+
export { createComparisonWorkflow } from "../ComparisonWorkflow.js";
|
|
8
|
+
export { createWorkflowDiagnostics } from "../WorkflowDiagnostics.js";
|
|
9
|
+
import { createAnimationLabWorkflow } from "../AnimationLabWorkflow.js";
|
|
10
|
+
import { createAssetViewerWorkflow } from "../AssetViewerWorkflow.js";
|
|
11
|
+
import { createComparisonWorkflow } from "../ComparisonWorkflow.js";
|
|
12
|
+
import { createInteractiveSceneWorkflow } from "../InteractiveSceneWorkflow.js";
|
|
13
|
+
import { createMaterialStudioWorkflow } from "../MaterialStudioWorkflow.js";
|
|
14
|
+
import { createProductConfiguratorWorkflow } from "../ProductConfiguratorWorkflow.js";
|
|
15
|
+
import { createSceneShowcaseWorkflow } from "../SceneShowcaseWorkflow.js";
|
|
16
|
+
export const workflows = {
|
|
17
|
+
assetViewer: createAssetViewerWorkflow,
|
|
18
|
+
productConfigurator: createProductConfiguratorWorkflow,
|
|
19
|
+
materialStudio: createMaterialStudioWorkflow,
|
|
20
|
+
sceneShowcase: createSceneShowcaseWorkflow,
|
|
21
|
+
interactiveScene: createInteractiveSceneWorkflow,
|
|
22
|
+
animationLab: createAnimationLabWorkflow,
|
|
23
|
+
comparison: createComparisonWorkflow
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/workflows/src/workflow-foundation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,WAAW,EAAE,yBAAyB;IACtC,mBAAmB,EAAE,iCAAiC;IACtD,cAAc,EAAE,4BAA4B;IAC5C,aAAa,EAAE,2BAA2B;IAC1C,gBAAgB,EAAE,8BAA8B;IAChD,YAAY,EAAE,0BAA0B;IACxC,UAAU,EAAE,wBAAwB;CAC5B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aura3d/workflows",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@aura3d/animation": "1.0.6",
|
|
15
|
+
"@aura3d/assets": "1.0.6",
|
|
16
|
+
"@aura3d/product-studio": "1.0.6",
|
|
17
|
+
"@aura3d/engine": "1.0.6",
|
|
18
|
+
"@aura3d/scene": "1.0.6",
|
|
19
|
+
"@aura3d/rendering": "1.0.6"
|
|
20
|
+
},
|
|
21
|
+
"sideEffects": false
|
|
22
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { AnimationClip, AnimationTrack } from "@aura3d/animation";
|
|
2
|
+
import { composeMat4 } from "@aura3d/scene";
|
|
3
|
+
import { Geometry, PBRMaterial, createLightingDefault } from "@aura3d/rendering";
|
|
4
|
+
import { createWorkflowDiagnostics } from "./WorkflowDiagnostics";
|
|
5
|
+
import type { AnimationLabWorkflowOptions, AnimationLabWorkflowResult } from "./WorkflowTypes";
|
|
6
|
+
|
|
7
|
+
type Vec3 = readonly [number, number, number];
|
|
8
|
+
|
|
9
|
+
export function createAnimationLabWorkflow(options: AnimationLabWorkflowOptions = {}): AnimationLabWorkflowResult {
|
|
10
|
+
const speed = Number.isFinite(options.speed) && options.speed !== undefined && options.speed > 0 ? options.speed : 1;
|
|
11
|
+
const clips = createAnimationClips();
|
|
12
|
+
const activeClip = clips.find((clip) => clip.name === (options.clip ?? "walk")) ?? clips[1]!;
|
|
13
|
+
const lighting = createLightingDefault("studioProduct");
|
|
14
|
+
const material = new PBRMaterial({ name: "animation-lab-character", baseColor: [0.72, 0.55, 0.32, 1], metallic: 0.18, roughness: 0.42 });
|
|
15
|
+
const accent = new PBRMaterial({ name: "animation-lab-accent", baseColor: [0.18, 0.3, 0.28, 1], metallic: 0.08, roughness: 0.5 });
|
|
16
|
+
|
|
17
|
+
const sample = (timeSeconds: number) => {
|
|
18
|
+
const t = wrapTime(timeSeconds * speed, activeClip.duration);
|
|
19
|
+
const root = sampleVec3(activeClip, "root.position", t);
|
|
20
|
+
const armSwing = sampleScalar(activeClip, "arms.swing", t);
|
|
21
|
+
const legSwing = sampleScalar(activeClip, "legs.swing", t);
|
|
22
|
+
const headBob = sampleScalar(activeClip, "head.bob", t);
|
|
23
|
+
const renderItems = [
|
|
24
|
+
{
|
|
25
|
+
label: "animation-lab-body",
|
|
26
|
+
geometry: Geometry.capsule({ radius: 0.34, height: 1.25, segments: 24, rings: 12, textured: true }),
|
|
27
|
+
material,
|
|
28
|
+
modelMatrix: composeMat4([root[0], 0.78 + root[1], root[2]], [0, 0, 0, 1], [1.05, 1, 0.85])
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: "animation-lab-head",
|
|
32
|
+
geometry: Geometry.uvSphere(0.28, 32, 16, { textured: true }),
|
|
33
|
+
material,
|
|
34
|
+
modelMatrix: composeMat4([root[0], 1.66 + headBob, root[2]], [0, 0, 0, 1], [1, 1, 1])
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "animation-lab-left-arm",
|
|
38
|
+
geometry: Geometry.cylinder({ radius: 0.09, height: 0.78, segments: 18, textured: true }),
|
|
39
|
+
material: accent,
|
|
40
|
+
modelMatrix: composeMat4([root[0] - 0.44, 0.9, root[2] + armSwing], [0.18, 0, 0, 0.98], [1, 1, 1])
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: "animation-lab-right-arm",
|
|
44
|
+
geometry: Geometry.cylinder({ radius: 0.09, height: 0.78, segments: 18, textured: true }),
|
|
45
|
+
material: accent,
|
|
46
|
+
modelMatrix: composeMat4([root[0] + 0.44, 0.9, root[2] - armSwing], [-0.18, 0, 0, 0.98], [1, 1, 1])
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: "animation-lab-left-leg",
|
|
50
|
+
geometry: Geometry.cylinder({ radius: 0.12, height: 0.78, segments: 18, textured: true }),
|
|
51
|
+
material: accent,
|
|
52
|
+
modelMatrix: composeMat4([root[0] - 0.18, 0.18, root[2] - legSwing], [0.12, 0, 0, 0.99], [1, 1, 1])
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: "animation-lab-right-leg",
|
|
56
|
+
geometry: Geometry.cylinder({ radius: 0.12, height: 0.78, segments: 18, textured: true }),
|
|
57
|
+
material: accent,
|
|
58
|
+
modelMatrix: composeMat4([root[0] + 0.18, 0.18, root[2] + legSwing], [-0.12, 0, 0, 0.99], [1, 1, 1])
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
return {
|
|
62
|
+
renderItems,
|
|
63
|
+
cameraPolicy: "auto-frame" as const,
|
|
64
|
+
cameraFrameOptions: { paddingRatio: 0.24, yawRadians: -0.28, pitchRadians: -0.08 },
|
|
65
|
+
environmentLighting: lighting.environmentLighting,
|
|
66
|
+
shadow: false,
|
|
67
|
+
postprocess: { ...lighting.postprocess, targetFormat: "rgba8" as const }
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const source = sample(0);
|
|
72
|
+
return {
|
|
73
|
+
kind: "animation-lab",
|
|
74
|
+
source,
|
|
75
|
+
renderItems: source.renderItems,
|
|
76
|
+
clips,
|
|
77
|
+
mixer: {
|
|
78
|
+
timeScale: speed,
|
|
79
|
+
actionCount: 1,
|
|
80
|
+
actions: [{ clipName: activeClip.name, duration: activeClip.duration, time: 0, weight: 1, timeScale: speed, playing: true, paused: false, loopMode: "repeat" }],
|
|
81
|
+
layers: [],
|
|
82
|
+
values: {
|
|
83
|
+
"root.position": [0, 0, 0],
|
|
84
|
+
"arms.swing": 0,
|
|
85
|
+
"legs.swing": 0,
|
|
86
|
+
"head.bob": 0
|
|
87
|
+
},
|
|
88
|
+
applyErrors: []
|
|
89
|
+
},
|
|
90
|
+
diagnostics: createWorkflowDiagnostics("animation-lab", {
|
|
91
|
+
featureChecklist: ["keyframe-clips", "clip-switching", "animated-transforms", "timeline-sampling", "camera-framing", "postprocess"]
|
|
92
|
+
}),
|
|
93
|
+
update: sample,
|
|
94
|
+
dispose: () => undefined
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function createAnimationClips(): readonly AnimationClip[] {
|
|
99
|
+
return [
|
|
100
|
+
createClip("idle", 1.6, [0, 0, 0], 0.05, 0.02, 0.03),
|
|
101
|
+
createClip("walk", 1.2, [0, 0, 0.1], 0.24, 0.22, 0.06),
|
|
102
|
+
createClip("run", 0.8, [0, 0, 0.16], 0.34, 0.32, 0.09)
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function createClip(name: string, duration: number, rootEnd: Vec3, arm: number, leg: number, bob: number): AnimationClip {
|
|
107
|
+
return new AnimationClip({
|
|
108
|
+
name,
|
|
109
|
+
duration,
|
|
110
|
+
tracks: [
|
|
111
|
+
new AnimationTrack<Vec3>({
|
|
112
|
+
target: "root.position",
|
|
113
|
+
valueType: "vector3",
|
|
114
|
+
keyframes: [
|
|
115
|
+
{ time: 0, value: [0, 0, 0] },
|
|
116
|
+
{ time: duration / 2, value: [rootEnd[0], bob, rootEnd[2] / 2] },
|
|
117
|
+
{ time: duration, value: rootEnd }
|
|
118
|
+
]
|
|
119
|
+
}),
|
|
120
|
+
new AnimationTrack<number>({
|
|
121
|
+
target: "arms.swing",
|
|
122
|
+
valueType: "scalar",
|
|
123
|
+
keyframes: [
|
|
124
|
+
{ time: 0, value: -arm },
|
|
125
|
+
{ time: duration / 2, value: arm },
|
|
126
|
+
{ time: duration, value: -arm }
|
|
127
|
+
]
|
|
128
|
+
}),
|
|
129
|
+
new AnimationTrack<number>({
|
|
130
|
+
target: "legs.swing",
|
|
131
|
+
valueType: "scalar",
|
|
132
|
+
keyframes: [
|
|
133
|
+
{ time: 0, value: leg },
|
|
134
|
+
{ time: duration / 2, value: -leg },
|
|
135
|
+
{ time: duration, value: leg }
|
|
136
|
+
]
|
|
137
|
+
}),
|
|
138
|
+
new AnimationTrack<number>({
|
|
139
|
+
target: "head.bob",
|
|
140
|
+
valueType: "scalar",
|
|
141
|
+
keyframes: [
|
|
142
|
+
{ time: 0, value: 0 },
|
|
143
|
+
{ time: duration / 2, value: bob },
|
|
144
|
+
{ time: duration, value: 0 }
|
|
145
|
+
]
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function sampleVec3(clip: AnimationClip, target: string, time: number): Vec3 {
|
|
152
|
+
const value = clip.tracks.find((track) => track.target === target)?.sample(time);
|
|
153
|
+
return Array.isArray(value) && value.length === 3 ? [value[0]!, value[1]!, value[2]!] : [0, 0, 0];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function sampleScalar(clip: AnimationClip, target: string, time: number): number {
|
|
157
|
+
const value = clip.tracks.find((track) => track.target === target)?.sample(time);
|
|
158
|
+
return typeof value === "number" ? value : 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function wrapTime(timeSeconds: number, duration: number): number {
|
|
162
|
+
if (duration <= 0) return 0;
|
|
163
|
+
const wrapped = timeSeconds % duration;
|
|
164
|
+
return wrapped < 0 ? wrapped + duration : wrapped;
|
|
165
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createRenderableScene, loadRenderableAsset } from "@aura3d/assets";
|
|
2
|
+
import type { LoadRenderableAssetOptions } from "@aura3d/assets";
|
|
3
|
+
import { createWorkflowDiagnostics } from "./WorkflowDiagnostics";
|
|
4
|
+
import type { AssetViewerWorkflowOptions, AssetViewerWorkflowResult } from "./WorkflowTypes";
|
|
5
|
+
|
|
6
|
+
export async function createAssetViewerWorkflow(options: AssetViewerWorkflowOptions): Promise<AssetViewerWorkflowResult> {
|
|
7
|
+
const loadOptions: LoadRenderableAssetOptions = {
|
|
8
|
+
baseUrl: options.baseUrl,
|
|
9
|
+
signal: options.signal,
|
|
10
|
+
dependencyChain: options.dependencyChain,
|
|
11
|
+
manager: options.manager,
|
|
12
|
+
type: options.type
|
|
13
|
+
};
|
|
14
|
+
const asset = await loadRenderableAsset(options.url, loadOptions);
|
|
15
|
+
const scene = await createRenderableScene(asset, {
|
|
16
|
+
camera: options.camera ?? "auto-frame",
|
|
17
|
+
lighting: options.lighting ?? "studioProduct",
|
|
18
|
+
shadows: options.shadows ?? true,
|
|
19
|
+
postprocess: options.postprocess ?? "product-default",
|
|
20
|
+
viewport: options.viewport,
|
|
21
|
+
qualityPreset: options.qualityPreset,
|
|
22
|
+
renderResources: options.renderResources
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
kind: "asset-viewer",
|
|
26
|
+
asset,
|
|
27
|
+
scene,
|
|
28
|
+
source: scene.source,
|
|
29
|
+
camera: scene.rendererInput?.camera,
|
|
30
|
+
diagnostics: createWorkflowDiagnostics("asset-viewer", {
|
|
31
|
+
asset,
|
|
32
|
+
warnings: scene.warnings,
|
|
33
|
+
featureChecklist: ["asset-loading", "render-resources", "auto-camera", "lighting", "shadows", "postprocess"]
|
|
34
|
+
}),
|
|
35
|
+
dispose: () => scene.dispose()
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { composeMat4 } from "@aura3d/scene";
|
|
2
|
+
import { Geometry, PBRMaterial, createLightingDefault } from "@aura3d/rendering";
|
|
3
|
+
import { createWorkflowDiagnostics } from "./WorkflowDiagnostics";
|
|
4
|
+
import type { ComparisonWorkflowOptions, ComparisonWorkflowResult } from "./WorkflowTypes";
|
|
5
|
+
|
|
6
|
+
export function createComparisonWorkflow(options: ComparisonWorkflowOptions = {}): ComparisonWorkflowResult {
|
|
7
|
+
const focus = options.focus ?? "setup";
|
|
8
|
+
const lighting = createLightingDefault("studioProduct");
|
|
9
|
+
const a3dMaterial = new PBRMaterial({ name: "comparison-a3d", baseColor: [0.12, 0.48, 0.82, 1], metallic: 0.1, roughness: 0.34 });
|
|
10
|
+
const threeMaterial = new PBRMaterial({ name: "comparison-three-baseline", baseColor: [0.75, 0.75, 0.75, 1], metallic: 0.05, roughness: 0.5 });
|
|
11
|
+
const migrationMaterial = new PBRMaterial({ name: "comparison-migration", baseColor: [0.88, 0.56, 0.2, 1], metallic: 0.18, roughness: 0.38 });
|
|
12
|
+
const renderItems = [
|
|
13
|
+
{
|
|
14
|
+
label: "comparison-a3d-workflow",
|
|
15
|
+
geometry: Geometry.uvSphere(0.48, 40, 20, { textured: true }),
|
|
16
|
+
material: a3dMaterial,
|
|
17
|
+
modelMatrix: composeMat4([-1.15, 0.05, 0], [0, 0, 0, 1], [1, 1, 1])
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: "comparison-threejs-reference",
|
|
21
|
+
geometry: Geometry.texturedCube(0.88),
|
|
22
|
+
material: threeMaterial,
|
|
23
|
+
modelMatrix: composeMat4([0, 0, 0], [0, 0.25, 0, 0.97], [1, 1, 1])
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: "comparison-migration-output",
|
|
27
|
+
geometry: Geometry.cylinder({ radius: 0.36, height: 1, segments: 32, textured: true }),
|
|
28
|
+
material: migrationMaterial,
|
|
29
|
+
modelMatrix: composeMat4([1.15, 0, 0], [0, 0, 0, 1], [1, 1, 1])
|
|
30
|
+
}
|
|
31
|
+
];
|
|
32
|
+
const comparison = {
|
|
33
|
+
focus,
|
|
34
|
+
a3dSteps: [
|
|
35
|
+
"create workflow render source",
|
|
36
|
+
"load optional asset/environment through public package APIs",
|
|
37
|
+
"render through Renderer.create with diagnostics"
|
|
38
|
+
],
|
|
39
|
+
threeJsSteps: [
|
|
40
|
+
"create scene, camera, renderer, lights, controls, loader, material setup, and animation loop separately",
|
|
41
|
+
"wire resource disposal and resize handling manually",
|
|
42
|
+
"add diagnostics through user-land instrumentation"
|
|
43
|
+
],
|
|
44
|
+
migrationNotes: [
|
|
45
|
+
"A3D comparison workflow renders a A3D-owned parity scene; it does not embed Three.js at runtime.",
|
|
46
|
+
"Use @aura3d/three-compat for adapter coverage and warnings when moving Three.js example code."
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
const source = {
|
|
50
|
+
renderItems,
|
|
51
|
+
cameraPolicy: "auto-frame" as const,
|
|
52
|
+
cameraFrameOptions: { paddingRatio: 0.22, yawRadians: -0.36, pitchRadians: -0.1 },
|
|
53
|
+
environmentLighting: lighting.environmentLighting,
|
|
54
|
+
shadow: false,
|
|
55
|
+
postprocess: { ...lighting.postprocess, targetFormat: "rgba8" as const }
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
kind: "comparison",
|
|
59
|
+
source,
|
|
60
|
+
renderItems,
|
|
61
|
+
comparison,
|
|
62
|
+
diagnostics: createWorkflowDiagnostics("comparison", {
|
|
63
|
+
warnings: ["Comparison workflow summarizes migration/setup parity; same-scene Three.js visual superiority still requires benchmark reports."],
|
|
64
|
+
featureChecklist: ["a3d-workflow-source", "threejs-setup-comparison", "migration-notes", "render-diagnostics", "postprocess"]
|
|
65
|
+
}),
|
|
66
|
+
dispose: () => undefined
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { composeMat4 } from "@aura3d/scene";
|
|
2
|
+
import { Geometry, PBRMaterial, createLightingDefault } from "@aura3d/rendering";
|
|
3
|
+
import { createWorkflowDiagnostics } from "./WorkflowDiagnostics";
|
|
4
|
+
import type { InteractiveSceneWorkflowOptions, InteractiveSceneWorkflowResult } from "./WorkflowTypes";
|
|
5
|
+
|
|
6
|
+
export function createInteractiveSceneWorkflow(_options: InteractiveSceneWorkflowOptions = {}): InteractiveSceneWorkflowResult {
|
|
7
|
+
const lighting = createLightingDefault("studioProduct");
|
|
8
|
+
const material = new PBRMaterial({ name: "interactive-workflow-material", baseColor: [0.95, 0.62, 0.18, 1], metallic: 0.25, roughness: 0.36 });
|
|
9
|
+
const createSource = (timeSeconds: number) => {
|
|
10
|
+
const renderItems = [
|
|
11
|
+
{
|
|
12
|
+
label: "interactive-orbit-a",
|
|
13
|
+
geometry: Geometry.uvSphere(0.42, 32, 16, { textured: true }),
|
|
14
|
+
material,
|
|
15
|
+
modelMatrix: composeMat4([Math.cos(timeSeconds) * 0.9, 0, Math.sin(timeSeconds) * 0.35], [0, 0, 0, 1], [1, 1, 1])
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: "interactive-orbit-b",
|
|
19
|
+
geometry: Geometry.texturedCube(1),
|
|
20
|
+
material: new PBRMaterial({ name: "interactive-workflow-blue", baseColor: [0.2, 0.48, 0.92, 1], metallic: 0.1, roughness: 0.44 }),
|
|
21
|
+
modelMatrix: composeMat4([Math.cos(timeSeconds + Math.PI) * 0.9, 0, Math.sin(timeSeconds + Math.PI) * 0.35], [0, 0, 0, 1], [0.62, 0.62, 0.62])
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
return {
|
|
25
|
+
renderItems,
|
|
26
|
+
cameraPolicy: "auto-frame" as const,
|
|
27
|
+
cameraFrameOptions: { paddingRatio: 0.28, yawRadians: -0.5, pitchRadians: -0.14 },
|
|
28
|
+
environmentLighting: lighting.environmentLighting,
|
|
29
|
+
shadow: false,
|
|
30
|
+
postprocess: { ...lighting.postprocess, targetFormat: "rgba8" as const }
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const source = createSource(0);
|
|
34
|
+
return {
|
|
35
|
+
kind: "interactive-scene",
|
|
36
|
+
source,
|
|
37
|
+
renderItems: source.renderItems,
|
|
38
|
+
diagnostics: createWorkflowDiagnostics("interactive-scene", {
|
|
39
|
+
featureChecklist: ["update-loop", "animated-transforms", "input-ready-scene", "camera-framing", "postprocess"]
|
|
40
|
+
}),
|
|
41
|
+
update: createSource,
|
|
42
|
+
dispose: () => undefined
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { composeMat4 } from "@aura3d/scene";
|
|
2
|
+
import { Geometry, NormalMappedPBRMaterial, PBRMaterial, TexturedPBRMaterial, Texture, createLightingDefault } from "@aura3d/rendering";
|
|
3
|
+
import { createWorkflowDiagnostics } from "./WorkflowDiagnostics";
|
|
4
|
+
import type { MaterialStudioWorkflowOptions, MaterialStudioWorkflowResult } from "./WorkflowTypes";
|
|
5
|
+
|
|
6
|
+
export function createMaterialStudioWorkflow(options: MaterialStudioWorkflowOptions = {}): MaterialStudioWorkflowResult {
|
|
7
|
+
const white = new Texture({ width: 1, height: 1, colorSpace: "srgb", data: new Uint8Array([240, 236, 220, 255]) });
|
|
8
|
+
const rough = new Texture({ width: 1, height: 1, colorSpace: "linear", data: new Uint8Array([255, 128, 255, 255]) });
|
|
9
|
+
const normal = new Texture({ width: 1, height: 1, colorSpace: "linear", data: new Uint8Array([128, 128, 255, 255]) });
|
|
10
|
+
const lighting = createLightingDefault(options.mode === "transparent" ? "interiorGallery" : "studioProduct");
|
|
11
|
+
const renderItems = [
|
|
12
|
+
{
|
|
13
|
+
label: "workflow-polished-metal",
|
|
14
|
+
geometry: Geometry.uvSphere(0.58, 48, 24, { textured: true }),
|
|
15
|
+
material: new PBRMaterial({ name: "workflow-polished-metal", baseColor: [0.86, 0.82, 0.72, 1], metallic: 1, roughness: 0.18 }),
|
|
16
|
+
modelMatrix: composeMat4([-1.25, 0, 0], [0, 0, 0, 1], [1, 1, 1])
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: "workflow-textured-pbr",
|
|
20
|
+
geometry: Geometry.uvSphere(0.58, 48, 24, { textured: true }),
|
|
21
|
+
material: new TexturedPBRMaterial({ name: "workflow-textured-pbr", baseColorTexture: white, metallicRoughnessTexture: rough, normalTexture: normal, roughness: 0.45 }),
|
|
22
|
+
modelMatrix: composeMat4([0, 0, 0], [0, 0, 0, 1], [1, 1, 1])
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "workflow-normal-material",
|
|
26
|
+
geometry: Geometry.texturedCube(1),
|
|
27
|
+
material: new NormalMappedPBRMaterial({ name: "workflow-normal-material", normalTexture: normal, baseColor: [0.28, 0.58, 0.9, 1], normalScale: 0.8 }),
|
|
28
|
+
modelMatrix: composeMat4([1.25, 0, 0], [0, 0, 0, 1], [0.85, 0.85, 0.85])
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
const source = {
|
|
32
|
+
renderItems,
|
|
33
|
+
cameraPolicy: "auto-frame" as const,
|
|
34
|
+
cameraFrameOptions: { paddingRatio: 0.18, yawRadians: -0.36, pitchRadians: -0.12 },
|
|
35
|
+
environmentLighting: lighting.environmentLighting,
|
|
36
|
+
shadow: false,
|
|
37
|
+
postprocess: { ...lighting.postprocess, targetFormat: "rgba8" as const }
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
kind: "material-studio",
|
|
41
|
+
source,
|
|
42
|
+
renderItems,
|
|
43
|
+
diagnostics: createWorkflowDiagnostics("material-studio", {
|
|
44
|
+
featureChecklist: ["pbr", "textured-pbr", "normal-mapped-pbr", "material-comparison", "postprocess"]
|
|
45
|
+
}),
|
|
46
|
+
dispose: () => undefined
|
|
47
|
+
};
|
|
48
|
+
}
|