@forgeax/engine-import 0.1.27 → 0.1.29
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/index.mjs +1161 -1092
- package/dist/index.mjs.map +1 -1
- package/dist/scriptable-pack-build.d.ts.map +1 -1
- package/dist/scriptable-pack-output-producers.d.ts.map +1 -1
- package/dist/scriptable-pack.d.ts +6 -1
- package/dist/scriptable-pack.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/scriptable-pack-build.unit.test.ts +64 -1
- package/src/__tests__/scriptable-pack-host.unit.test.ts +4 -4
- package/src/__tests__/scriptable-pack-production-producers.unit.test.ts +65 -26
- package/src/scriptable-pack-build.ts +55 -3
- package/src/scriptable-pack-output-producers.ts +24 -2
- package/src/scriptable-pack.ts +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptable-pack-build.d.ts","sourceRoot":"","sources":["../src/scriptable-pack-build.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,oCAAoC,CAAC;AAC7F,OAAO,EACL,KAAK,2BAA2B,EAIhC,KAAK,kBAAkB,EACvB,SAAS,EAIT,KAAK,kBAAkB,EAExB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAGV,wBAAwB,
|
|
1
|
+
{"version":3,"file":"scriptable-pack-build.d.ts","sourceRoot":"","sources":["../src/scriptable-pack-build.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,oCAAoC,CAAC;AAC7F,OAAO,EACL,KAAK,2BAA2B,EAIhC,KAAK,kBAAkB,EACvB,SAAS,EAIT,KAAK,kBAAkB,EAExB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAGV,wBAAwB,EAGxB,MAAM,EACP,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAO,WAAW,EAAM,MAAM,uBAAuB,CAAC;AACzE,OAAO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,CAAC;IAC/D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,QAAQ,EAAE,SAAS,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7D,QAAQ,CAAC,aAAa,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAC9D,QAAQ,CAAC,aAAa,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAC9D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AA8BD,mFAAmF;AACnF,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CACR,MAAM,CACJ,kCAAkC,EAChC,kBAAkB,GAClB,yBAAyB,GACzB,UAAU,GACV,WAAW,GACX;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B,CACJ,CACF,CA8GA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptable-pack-output-producers.d.ts","sourceRoot":"","sources":["../src/scriptable-pack-output-producers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAmChF,OAAO,EAEL,KAAK,mBAAmB,EACxB,2BAA2B,EAE5B,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"scriptable-pack-output-producers.d.ts","sourceRoot":"","sources":["../src/scriptable-pack-output-producers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAmChF,OAAO,EAEL,KAAK,mBAAmB,EACxB,2BAA2B,EAE5B,MAAM,sBAAsB,CAAC;AA2d9B,eAAO,MAAM,2BAA2B,qBAIvC,CAAC;AAEF,eAAO,MAAM,uBAAuB,qBAA2D,CAAC;AAChG,eAAO,MAAM,0BAA0B,qBAItC,CAAC;AAEF,wBAAgB,8BAA8B,CAC5C,eAAe,GAAE,SAAS,4BAA4B,EAAO,GAC5D,mBAAmB,CAKrB;AAED,wBAAgB,6CAA6C,IAAI,mBAAmB,CAEnF;AAED,wBAAgB,yCAAyC,CACvD,eAAe,GAAE,SAAS,4BAA4B,EAAO,GAC5D,2BAA2B,CA8B7B"}
|
|
@@ -21,6 +21,8 @@ export interface AssetOutputInput {
|
|
|
21
21
|
readonly guid: string;
|
|
22
22
|
readonly sourceKey: string;
|
|
23
23
|
readonly asset: Asset;
|
|
24
|
+
/** Filesystem-backed authoring host; absent for pure payload projections. */
|
|
25
|
+
readonly sourcePath?: string;
|
|
24
26
|
}
|
|
25
27
|
type MaterialPackPayload = Omit<MaterialAsset, 'parent' | 'values'> & {
|
|
26
28
|
readonly parent?: number;
|
|
@@ -89,7 +91,10 @@ export type AssetOutputPayloadByKind = {
|
|
|
89
91
|
}>;
|
|
90
92
|
};
|
|
91
93
|
export type AssetOutputPayload = AssetOutputPayloadByKind[ScriptablePackAssetKind];
|
|
92
|
-
export
|
|
94
|
+
export interface AssetOutputProduct extends ImportAssetProduct<AssetOutputPayload> {
|
|
95
|
+
readonly inputFingerprint?: string;
|
|
96
|
+
readonly sourceDependencies?: readonly string[];
|
|
97
|
+
}
|
|
93
98
|
export interface AssetOutputProducer {
|
|
94
99
|
readonly kind: string;
|
|
95
100
|
readonly version: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptable-pack.d.ts","sourceRoot":"","sources":["../src/scriptable-pack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,cAAc,EACd,K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,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACjD,QAAQ,CAAC,aAAa,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAC9D,QAAQ,CAAC,gBAAgB,EAAE,SAAS,8BAA8B,EAAE,CAAC;IACrE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,wBAAwB,CAAC;CACjD;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,4FAA4F;AAC5F,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC;AACpD,MAAM,MAAM,4BAA4B,GAAG,kBAAkB,CAAC;AAC9D,MAAM,MAAM,2BAA2B,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgeax/engine-import",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"LICENSE"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@forgeax/engine-ddc": "0.1.
|
|
31
|
-
"@forgeax/engine-ecs": "0.1.
|
|
32
|
-
"@forgeax/engine-geometry": "0.1.
|
|
33
|
-
"@forgeax/engine-pack": "0.1.
|
|
34
|
-
"@forgeax/engine-scene": "0.1.
|
|
35
|
-
"@forgeax/engine-shader": "0.1.
|
|
36
|
-
"@forgeax/engine-types": "0.1.
|
|
30
|
+
"@forgeax/engine-ddc": "0.1.29",
|
|
31
|
+
"@forgeax/engine-ecs": "0.1.29",
|
|
32
|
+
"@forgeax/engine-geometry": "0.1.29",
|
|
33
|
+
"@forgeax/engine-pack": "0.1.29",
|
|
34
|
+
"@forgeax/engine-scene": "0.1.29",
|
|
35
|
+
"@forgeax/engine-shader": "0.1.29",
|
|
36
|
+
"@forgeax/engine-types": "0.1.29",
|
|
37
37
|
"@noble/hashes": "^2.2.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -5,6 +5,7 @@ import type { ScriptablePackAssetSnapshotSource } from '../scriptable-pack.js';
|
|
|
5
5
|
import { AssetOutputProducerRegistry } from '../scriptable-pack.js';
|
|
6
6
|
import { buildScriptablePack, buildScriptablePackWorklist } from '../scriptable-pack-build.js';
|
|
7
7
|
import { produceScriptablePackProducts } from '../scriptable-pack-host.js';
|
|
8
|
+
import { materialAssetOutputProducer } from '../scriptable-pack-output-producers.js';
|
|
8
9
|
|
|
9
10
|
function id(value: string) {
|
|
10
11
|
const result = PackageId.parse(value);
|
|
@@ -13,7 +14,7 @@ function id(value: string) {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
function scene() {
|
|
16
|
-
return { kind: 'scene' as const, entities:
|
|
17
|
+
return { kind: 'scene' as const, entities: {} };
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
function producers() {
|
|
@@ -171,6 +172,68 @@ describe('ScriptablePack import bridge with optional parameters', () => {
|
|
|
171
172
|
expect(revision?.observedAt).toBe(0);
|
|
172
173
|
});
|
|
173
174
|
|
|
175
|
+
it('cooks a dynamic material once, re-projects refsIndex values, and keeps cooker-only refs', async () => {
|
|
176
|
+
const packageId = id('01900000-0000-7000-8000-000000000068');
|
|
177
|
+
const textureGuid = '11111111-1111-4111-8111-111111111111';
|
|
178
|
+
const cookerOnlyGuid = '22222222-2222-4222-8222-222222222222';
|
|
179
|
+
const material = {
|
|
180
|
+
kind: 'material' as const,
|
|
181
|
+
passes: [{ name: 'forward', program: { module: 'game::custom' } }] as const,
|
|
182
|
+
parameters: [{ name: 'baseColorTexture', type: 'texture' as const }],
|
|
183
|
+
values: { baseColorTexture: textureGuid },
|
|
184
|
+
};
|
|
185
|
+
const outputs = new AssetOutputProducerRegistry();
|
|
186
|
+
outputs.register(materialAssetOutputProducer);
|
|
187
|
+
let cookCount = 0;
|
|
188
|
+
const result = await buildScriptablePack({
|
|
189
|
+
definition: definePack({
|
|
190
|
+
schemaVersion: '2.0.0',
|
|
191
|
+
packageId,
|
|
192
|
+
build: () => ok({ 'material/main': material }),
|
|
193
|
+
}),
|
|
194
|
+
sourcePath: 'assets/dynamic-material.pack.ts',
|
|
195
|
+
outputs,
|
|
196
|
+
availableGuids: new Set([textureGuid, cookerOnlyGuid]),
|
|
197
|
+
cookers: [
|
|
198
|
+
{
|
|
199
|
+
key: 'material',
|
|
200
|
+
cook(input: {
|
|
201
|
+
readonly guid: string;
|
|
202
|
+
readonly source: typeof material;
|
|
203
|
+
readonly refs: readonly string[];
|
|
204
|
+
}) {
|
|
205
|
+
cookCount += 1;
|
|
206
|
+
expect(input.refs).toContain(textureGuid);
|
|
207
|
+
return {
|
|
208
|
+
guid: input.guid,
|
|
209
|
+
payload: {
|
|
210
|
+
...input.source,
|
|
211
|
+
values: { baseColorTexture: { texture: textureGuid } },
|
|
212
|
+
},
|
|
213
|
+
refs: [cookerOnlyGuid],
|
|
214
|
+
artifacts: {},
|
|
215
|
+
inputFingerprint: 'sha256:dynamic-material',
|
|
216
|
+
};
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
});
|
|
221
|
+
expect(result.ok).toBe(true);
|
|
222
|
+
if (!result.ok) return;
|
|
223
|
+
expect(cookCount).toBe(1);
|
|
224
|
+
const [asset] = result.value.product.assets;
|
|
225
|
+
expect(asset?.payload).toMatchObject({ values: { baseColorTexture: { texture: 0 } } });
|
|
226
|
+
expect(asset?.refs).toEqual(
|
|
227
|
+
expect.arrayContaining([
|
|
228
|
+
{
|
|
229
|
+
guid: textureGuid,
|
|
230
|
+
sourceField: { componentName: '<material>', fieldName: 'baseColorTexture' },
|
|
231
|
+
},
|
|
232
|
+
{ guid: cookerOnlyGuid },
|
|
233
|
+
]),
|
|
234
|
+
);
|
|
235
|
+
});
|
|
236
|
+
|
|
174
237
|
it('does not replace a staged read failure with a published value', async () => {
|
|
175
238
|
const packageId = id('01900000-0000-7000-8000-000000000064');
|
|
176
239
|
const dependencyGuid = AssetGuid.derive(packageId, 'scene/dependency');
|
|
@@ -105,7 +105,7 @@ describe('ScriptablePack external Meta staging', () => {
|
|
|
105
105
|
'vfx/main': {
|
|
106
106
|
kind: 'particle-effect',
|
|
107
107
|
payload: {
|
|
108
|
-
schemaVersion:
|
|
108
|
+
schemaVersion: 3,
|
|
109
109
|
emitters: [
|
|
110
110
|
{
|
|
111
111
|
id: 'main',
|
|
@@ -128,11 +128,11 @@ describe('ScriptablePack external Meta staging', () => {
|
|
|
128
128
|
guid: source.guid,
|
|
129
129
|
payload: {
|
|
130
130
|
kind: 'particle-effect',
|
|
131
|
-
schemaVersion:
|
|
131
|
+
schemaVersion: 3,
|
|
132
132
|
programFingerprint: 'sha256:cooked',
|
|
133
133
|
emitters: [],
|
|
134
134
|
program: {
|
|
135
|
-
format: 'forgeax-vfx-program-
|
|
135
|
+
format: 'forgeax-vfx-program-3',
|
|
136
136
|
fingerprint: 'sha256:cooked',
|
|
137
137
|
emitters: [],
|
|
138
138
|
},
|
|
@@ -169,7 +169,7 @@ describe('ScriptablePack external Meta staging', () => {
|
|
|
169
169
|
asset: {
|
|
170
170
|
kind: 'particle-effect',
|
|
171
171
|
programFingerprint: 'sha256:cooked',
|
|
172
|
-
program: { format: 'forgeax-vfx-program-
|
|
172
|
+
program: { format: 'forgeax-vfx-program-3' },
|
|
173
173
|
},
|
|
174
174
|
});
|
|
175
175
|
});
|
|
@@ -57,7 +57,7 @@ function canonicalAttributes(vertexCount: number): MeshAsset['attributes'] {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
const particleProgram = {
|
|
60
|
-
format: 'forgeax-vfx-program-
|
|
60
|
+
format: 'forgeax-vfx-program-3',
|
|
61
61
|
fingerprint: 'sha256:scriptable-pack-matrix',
|
|
62
62
|
emitters: [
|
|
63
63
|
{
|
|
@@ -86,7 +86,7 @@ const matrixAssets = [
|
|
|
86
86
|
materialSlots: [],
|
|
87
87
|
} satisfies MeshAsset,
|
|
88
88
|
{ kind: 'material', values: { roughness: 0.5 } } satisfies MaterialAsset,
|
|
89
|
-
{ kind: 'scene', entities:
|
|
89
|
+
{ kind: 'scene', entities: {} } satisfies SceneAsset,
|
|
90
90
|
{
|
|
91
91
|
kind: 'texture',
|
|
92
92
|
shape: { viewDimension: '2d', extent: { width: 1, height: 1 } },
|
|
@@ -158,7 +158,7 @@ const matrixAssets = [
|
|
|
158
158
|
} satisfies AudioClipAsset,
|
|
159
159
|
{
|
|
160
160
|
kind: 'particle-effect',
|
|
161
|
-
schemaVersion:
|
|
161
|
+
schemaVersion: 3,
|
|
162
162
|
programFingerprint: particleProgram.fingerprint,
|
|
163
163
|
emitters: [{ id: 'default', capacity: 16 }],
|
|
164
164
|
program: particleProgram,
|
|
@@ -166,6 +166,49 @@ const matrixAssets = [
|
|
|
166
166
|
] as const satisfies readonly Asset[];
|
|
167
167
|
|
|
168
168
|
describe('standard ScriptablePack output producers', () => {
|
|
169
|
+
it('publishes the deduplicated renderer dependency closure of a particle effect', async () => {
|
|
170
|
+
const material = AssetGuid.format(MATERIAL_GUID);
|
|
171
|
+
const mesh = AssetGuid.format(MESH_GUID);
|
|
172
|
+
const asset: ParticleEffectAsset = {
|
|
173
|
+
kind: 'particle-effect',
|
|
174
|
+
schemaVersion: 3,
|
|
175
|
+
programFingerprint: particleProgram.fingerprint,
|
|
176
|
+
emitters: [{ id: 'default', capacity: 16 }],
|
|
177
|
+
program: {
|
|
178
|
+
...particleProgram,
|
|
179
|
+
emitters: [
|
|
180
|
+
{
|
|
181
|
+
...particleProgram.emitters[0],
|
|
182
|
+
renderers: [
|
|
183
|
+
{ kind: 'billboard', material },
|
|
184
|
+
{ kind: 'mesh', material, mesh },
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
const producer = createStandardAssetOutputProducerRegistry().get('particle-effect');
|
|
191
|
+
if (producer === undefined) throw new Error('Missing particle producer');
|
|
192
|
+
const result = await producer.produce({
|
|
193
|
+
guid: AssetGuid.format(OUTPUT_GUID),
|
|
194
|
+
sourceKey: 'vfx/closure',
|
|
195
|
+
asset,
|
|
196
|
+
});
|
|
197
|
+
if (!result.ok) throw result.error;
|
|
198
|
+
expect(result.value.refs.map((ref) => ref.guid)).toEqual([material, mesh].sort());
|
|
199
|
+
expect(result.value.payload).toMatchObject({
|
|
200
|
+
program: {
|
|
201
|
+
emitters: [
|
|
202
|
+
{
|
|
203
|
+
renderers: [
|
|
204
|
+
{ kind: 'billboard', material },
|
|
205
|
+
{ kind: 'mesh', material, mesh },
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
});
|
|
169
212
|
it('registers the production producer versions for all ordinary Asset kinds', () => {
|
|
170
213
|
const registry = createStandardAssetOutputProducerRegistry();
|
|
171
214
|
expect(registry.versions()).toEqual({
|
|
@@ -177,7 +220,7 @@ describe('standard ScriptablePack output producers', () => {
|
|
|
177
220
|
'ies-profile': 'ordinary-pod/1',
|
|
178
221
|
material: 'material-pack/2',
|
|
179
222
|
mesh: 'mesh-binary/4',
|
|
180
|
-
'particle-effect': '
|
|
223
|
+
'particle-effect': 'particle-effect/2',
|
|
181
224
|
'render-pipeline': 'ordinary-pod/1',
|
|
182
225
|
sampler: 'ordinary-pod/1',
|
|
183
226
|
scene: 'scene-pack/3',
|
|
@@ -270,9 +313,8 @@ describe('standard ScriptablePack output producers', () => {
|
|
|
270
313
|
|
|
271
314
|
const scene: SceneAsset = {
|
|
272
315
|
kind: 'scene',
|
|
273
|
-
entities:
|
|
274
|
-
{
|
|
275
|
-
localId: 0 as never,
|
|
316
|
+
entities: {
|
|
317
|
+
hero: {
|
|
276
318
|
components: {
|
|
277
319
|
ScriptablePackTestMeshFilter: { assetHandle: AssetGuid.format(MESH_GUID) },
|
|
278
320
|
ScriptablePackTestMeshRenderer: {
|
|
@@ -280,7 +322,7 @@ describe('standard ScriptablePack output producers', () => {
|
|
|
280
322
|
},
|
|
281
323
|
},
|
|
282
324
|
},
|
|
283
|
-
|
|
325
|
+
},
|
|
284
326
|
};
|
|
285
327
|
const result = await producer.produce({
|
|
286
328
|
guid: '019ffa97-3000-7000-8000-000000000003',
|
|
@@ -291,15 +333,14 @@ describe('standard ScriptablePack output producers', () => {
|
|
|
291
333
|
expect(result.ok).toBe(true);
|
|
292
334
|
if (!result.ok) return;
|
|
293
335
|
expect(result.value.payload).toMatchObject({
|
|
294
|
-
entities:
|
|
295
|
-
{
|
|
296
|
-
localId: 0,
|
|
336
|
+
entities: {
|
|
337
|
+
hero: {
|
|
297
338
|
components: {
|
|
298
339
|
ScriptablePackTestMeshFilter: { assetHandle: 0 },
|
|
299
340
|
ScriptablePackTestMeshRenderer: { materials: [1] },
|
|
300
341
|
},
|
|
301
342
|
},
|
|
302
|
-
|
|
343
|
+
},
|
|
303
344
|
});
|
|
304
345
|
expect(result.value.refs).toEqual([
|
|
305
346
|
{
|
|
@@ -308,7 +349,7 @@ describe('standard ScriptablePack output producers', () => {
|
|
|
308
349
|
componentName: 'ScriptablePackTestMeshFilter',
|
|
309
350
|
fieldName: 'assetHandle',
|
|
310
351
|
},
|
|
311
|
-
|
|
352
|
+
sceneEntityKey: 'hero',
|
|
312
353
|
},
|
|
313
354
|
{
|
|
314
355
|
guid: AssetGuid.format(MATERIAL_GUID),
|
|
@@ -317,7 +358,7 @@ describe('standard ScriptablePack output producers', () => {
|
|
|
317
358
|
fieldName: 'materials',
|
|
318
359
|
arrayIndex: 0,
|
|
319
360
|
},
|
|
320
|
-
|
|
361
|
+
sceneEntityKey: 'hero',
|
|
321
362
|
},
|
|
322
363
|
]);
|
|
323
364
|
});
|
|
@@ -333,7 +374,7 @@ describe('standard ScriptablePack output producers', () => {
|
|
|
333
374
|
sourceKey: 'scene/unknown-component',
|
|
334
375
|
asset: {
|
|
335
376
|
kind: 'scene',
|
|
336
|
-
entities:
|
|
377
|
+
entities: { mystery: { components: { Mystery: { asset: 'not-a-ref' } } } },
|
|
337
378
|
},
|
|
338
379
|
});
|
|
339
380
|
|
|
@@ -361,16 +402,14 @@ describe('standard ScriptablePack output producers', () => {
|
|
|
361
402
|
sourceKey: 'scene/environment',
|
|
362
403
|
asset: {
|
|
363
404
|
kind: 'scene',
|
|
364
|
-
entities:
|
|
365
|
-
{
|
|
366
|
-
localId: 0 as never,
|
|
405
|
+
entities: {
|
|
406
|
+
skylight: {
|
|
367
407
|
components: { Skylight: { equirect: AssetGuid.format(EQUIRECT_GUID) } },
|
|
368
408
|
},
|
|
369
|
-
{
|
|
370
|
-
localId: 1 as never,
|
|
409
|
+
skybox: {
|
|
371
410
|
components: { SkyboxBackground: { equirect: AssetGuid.format(EQUIRECT_GUID) } },
|
|
372
411
|
},
|
|
373
|
-
|
|
412
|
+
},
|
|
374
413
|
},
|
|
375
414
|
});
|
|
376
415
|
|
|
@@ -379,10 +418,10 @@ describe('standard ScriptablePack output producers', () => {
|
|
|
379
418
|
expect(result.value.refs).toHaveLength(1);
|
|
380
419
|
expect(result.value.refs[0]?.guid).toBe(AssetGuid.format(EQUIRECT_GUID));
|
|
381
420
|
expect(result.value.payload).toMatchObject({
|
|
382
|
-
entities:
|
|
383
|
-
{ components: { Skylight: { equirect: 0 } } },
|
|
384
|
-
{ components: { SkyboxBackground: { equirect: 0 } } },
|
|
385
|
-
|
|
421
|
+
entities: {
|
|
422
|
+
skylight: { components: { Skylight: { equirect: 0 } } },
|
|
423
|
+
skybox: { components: { SkyboxBackground: { equirect: 0 } } },
|
|
424
|
+
},
|
|
386
425
|
});
|
|
387
426
|
});
|
|
388
427
|
|
|
@@ -471,7 +510,7 @@ describe('standard ScriptablePack output producers', () => {
|
|
|
471
510
|
{
|
|
472
511
|
guid: AssetGuid.format(guid('019ffa97-3000-7000-8000-000000000003')),
|
|
473
512
|
sourceKey: 'scene/generated',
|
|
474
|
-
asset: { kind: 'scene' as const, entities:
|
|
513
|
+
asset: { kind: 'scene' as const, entities: {} },
|
|
475
514
|
producer: scene,
|
|
476
515
|
},
|
|
477
516
|
];
|
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
Asset,
|
|
19
19
|
AssetGuid as AssetGuidType,
|
|
20
20
|
AssetPublicationEnvelope,
|
|
21
|
+
AssetRef,
|
|
21
22
|
ImportedAsset,
|
|
22
23
|
Result,
|
|
23
24
|
} from '@forgeax/engine-types';
|
|
@@ -37,6 +38,7 @@ import type {
|
|
|
37
38
|
ScriptablePackSourceClosureEntry,
|
|
38
39
|
ScriptablePackStagedOutput,
|
|
39
40
|
} from './scriptable-pack.js';
|
|
41
|
+
import { materialAssetOutputProducer } from './scriptable-pack-output-producers.js';
|
|
40
42
|
|
|
41
43
|
export interface ScriptablePackBuildOptions {
|
|
42
44
|
readonly definition: AnyScriptablePackDefinition;
|
|
@@ -472,6 +474,7 @@ export async function buildScriptablePack(
|
|
|
472
474
|
const product = produced.value as ImportAssetProduct<unknown>;
|
|
473
475
|
let payload = product.payload;
|
|
474
476
|
let artifacts = product.artifacts;
|
|
477
|
+
let refs = product.refs;
|
|
475
478
|
if (needsMaterialCook(asset) && materialCookerRegistry.get('material') !== undefined) {
|
|
476
479
|
const cooked = await materialCookerRegistry.runDraft('material', {
|
|
477
480
|
guid,
|
|
@@ -494,15 +497,64 @@ export async function buildScriptablePack(
|
|
|
494
497
|
},
|
|
495
498
|
});
|
|
496
499
|
}
|
|
497
|
-
|
|
498
|
-
|
|
500
|
+
// Native cooking owns shader/program composition, but the Pack output
|
|
501
|
+
// producer owns the serialized wire shape. Re-project the cooked
|
|
502
|
+
// material once so texture/sampler/parent values become refsIndex
|
|
503
|
+
// entries again instead of leaking authored GUID strings into JSON.
|
|
504
|
+
const cookedAsset = cooked.value.payload;
|
|
505
|
+
if (!isAsset(cookedAsset) || cookedAsset.kind !== 'material') {
|
|
506
|
+
return err({
|
|
507
|
+
code: 'pack-source-output-invalid',
|
|
508
|
+
expected: 'the authored material cooker to return a material payload',
|
|
509
|
+
hint: 'repair the native material cooker payload and rebuild the Pack',
|
|
510
|
+
detail: { sourcePath: options.sourcePath, sourceKey },
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
const projected = await materialAssetOutputProducer.produce({
|
|
514
|
+
guid,
|
|
515
|
+
sourceKey,
|
|
516
|
+
asset: cookedAsset,
|
|
517
|
+
});
|
|
518
|
+
if (!projected.ok) return err(projected.error);
|
|
519
|
+
const projectedInvalid = productError(
|
|
520
|
+
options.sourcePath,
|
|
521
|
+
sourceKey,
|
|
522
|
+
materialAssetOutputProducer,
|
|
523
|
+
projected.value,
|
|
524
|
+
);
|
|
525
|
+
if (projectedInvalid !== undefined) return err(projectedInvalid);
|
|
526
|
+
payload = projected.value.payload;
|
|
527
|
+
artifacts = {
|
|
528
|
+
...product.artifacts,
|
|
529
|
+
...cooked.value.artifacts,
|
|
530
|
+
...projected.value.artifacts,
|
|
531
|
+
};
|
|
532
|
+
const mergedRefs: AssetRef[] = [...projected.value.refs];
|
|
533
|
+
const seenRefs = new Set(mergedRefs.map((reference) => reference.guid.toLowerCase()));
|
|
534
|
+
for (const cookerRef of cooked.value.refs) {
|
|
535
|
+
const parsed = AssetGuid.parse(cookerRef);
|
|
536
|
+
if (!parsed.ok) {
|
|
537
|
+
return err({
|
|
538
|
+
code: 'pack-source-output-invalid',
|
|
539
|
+
expected: 'the authored material cooker refs to contain valid AssetGuid values',
|
|
540
|
+
hint: 'repair the native material cooker refs and rebuild the Pack',
|
|
541
|
+
detail: { sourcePath: options.sourcePath, sourceKey, ref: cookerRef },
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
const formatted = AssetGuid.format(parsed.value);
|
|
545
|
+
const normalizedRef = formatted.toLowerCase();
|
|
546
|
+
if (seenRefs.has(normalizedRef)) continue;
|
|
547
|
+
seenRefs.add(normalizedRef);
|
|
548
|
+
mergedRefs.push({ guid: formatted });
|
|
549
|
+
}
|
|
550
|
+
refs = mergedRefs;
|
|
499
551
|
nativeFingerprints.set(sourceKey, cooked.value.inputFingerprint);
|
|
500
552
|
}
|
|
501
553
|
imported.push({
|
|
502
554
|
guid,
|
|
503
555
|
kind: asset.kind,
|
|
504
556
|
payload,
|
|
505
|
-
refs
|
|
557
|
+
refs,
|
|
506
558
|
artifacts,
|
|
507
559
|
});
|
|
508
560
|
stagedOutputs.push({
|
|
@@ -466,9 +466,24 @@ function ordinaryPodProduct(input: AssetOutputInput): AssetOutputProduct {
|
|
|
466
466
|
case 'particle-effect': {
|
|
467
467
|
const effect = asset as ParticleEffectAsset;
|
|
468
468
|
const cooked = particleProgramArtifact(effect);
|
|
469
|
+
const refs = new Set<string>();
|
|
470
|
+
for (const emitter of cooked.program.emitters) {
|
|
471
|
+
for (const renderer of emitter.renderers) {
|
|
472
|
+
if (!('material' in renderer) || typeof renderer.material !== 'string') {
|
|
473
|
+
throw new Error(`Particle emitter '${emitter.id}' requires a renderer Material GUID`);
|
|
474
|
+
}
|
|
475
|
+
refs.add(formatGuid(renderer.material));
|
|
476
|
+
if ('kind' in renderer && renderer.kind === 'mesh') {
|
|
477
|
+
if (!('mesh' in renderer) || typeof renderer.mesh !== 'string') {
|
|
478
|
+
throw new Error(`Particle emitter '${emitter.id}' requires a renderer Mesh GUID`);
|
|
479
|
+
}
|
|
480
|
+
refs.add(formatGuid(renderer.mesh));
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
469
484
|
return {
|
|
470
485
|
payload: { ...effect, programFingerprint: cooked.fingerprint, program: cooked.program },
|
|
471
|
-
refs: [],
|
|
486
|
+
refs: [...refs].sort().map((guid) => ({ guid })),
|
|
472
487
|
artifacts: {
|
|
473
488
|
'particle-effect/program.json': {
|
|
474
489
|
mediaType: 'application/json',
|
|
@@ -504,6 +519,7 @@ export const materialAssetOutputProducer = createSafeProducer(
|
|
|
504
519
|
'material-pack/2',
|
|
505
520
|
materialProduct,
|
|
506
521
|
);
|
|
522
|
+
|
|
507
523
|
export const meshAssetOutputProducer = createSafeProducer('mesh', 'mesh-binary/4', meshProduct);
|
|
508
524
|
export const textureAssetOutputProducer = createSafeProducer(
|
|
509
525
|
'texture',
|
|
@@ -547,7 +563,13 @@ export function createStandardAssetOutputProducerRegistry(
|
|
|
547
563
|
'particle-effect',
|
|
548
564
|
'ies-profile',
|
|
549
565
|
] as const) {
|
|
550
|
-
registry.register(
|
|
566
|
+
registry.register(
|
|
567
|
+
createSafeProducer(
|
|
568
|
+
kind,
|
|
569
|
+
kind === 'particle-effect' ? 'particle-effect/2' : 'ordinary-pod/1',
|
|
570
|
+
ordinaryPodProduct,
|
|
571
|
+
),
|
|
572
|
+
);
|
|
551
573
|
}
|
|
552
574
|
return registry;
|
|
553
575
|
}
|
package/src/scriptable-pack.ts
CHANGED
|
@@ -44,6 +44,8 @@ export interface AssetOutputInput {
|
|
|
44
44
|
readonly guid: string;
|
|
45
45
|
readonly sourceKey: string;
|
|
46
46
|
readonly asset: Asset;
|
|
47
|
+
/** Filesystem-backed authoring host; absent for pure payload projections. */
|
|
48
|
+
readonly sourcePath?: string;
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
type MaterialPackPayload = Omit<MaterialAsset, 'parent' | 'values'> & {
|
|
@@ -91,7 +93,10 @@ export type AssetOutputPayloadByKind = {
|
|
|
91
93
|
};
|
|
92
94
|
|
|
93
95
|
export type AssetOutputPayload = AssetOutputPayloadByKind[ScriptablePackAssetKind];
|
|
94
|
-
export
|
|
96
|
+
export interface AssetOutputProduct extends ImportAssetProduct<AssetOutputPayload> {
|
|
97
|
+
readonly inputFingerprint?: string;
|
|
98
|
+
readonly sourceDependencies?: readonly string[];
|
|
99
|
+
}
|
|
95
100
|
|
|
96
101
|
export interface AssetOutputProducer {
|
|
97
102
|
readonly kind: string;
|