@forgeax/engine-import 0.1.25 → 0.1.26
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/README.md +4 -1
- package/dist/index.mjs +6 -9
- 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/package.json +8 -8
- package/src/__tests__/scriptable-pack-output-producers.unit.test.ts +2 -2
- package/src/__tests__/scriptable-pack-production-producers.unit.test.ts +1 -1
- package/src/scriptable-pack-build.ts +2 -15
- package/src/scriptable-pack-output-producers.ts +4 -2
package/README.md
CHANGED
|
@@ -145,7 +145,10 @@ Domain producers return structured `ImportError`; the generic bridge contains no
|
|
|
145
145
|
|
|
146
146
|
`createStandardAssetOutputProducerRegistry(sceneComponents)` registers the production
|
|
147
147
|
Material, Mesh, and Scene producers. Material output derives
|
|
148
|
-
parent/texture/sampler refs
|
|
148
|
+
parent/texture/sampler refs. Material texture references serialize as
|
|
149
|
+
`{ texture: refsIndex, sampler?: refsIndex }`, including GUID string shorthand;
|
|
150
|
+
bare numeric values remain scalars in children without a local parameter schema.
|
|
151
|
+
Mesh output derives default-material refs and emits
|
|
149
152
|
the `mesh-binary/4` body; Scene output uses the definition-bound neutral schema
|
|
150
153
|
through the shared ECS externalization contract. A specialized host may instead
|
|
151
154
|
register only the admitted kinds:
|
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { createAcceptedPublication, ddcOutputDigest, DdcLifecycle, DdcGeneration
|
|
|
10
10
|
import { deriveVertexLayoutProjection, normalizeMeshPayload } from '@forgeax/engine-geometry';
|
|
11
11
|
import { BUILTIN_MESH_ASSETS } from '@forgeax/engine-pack/builtin';
|
|
12
12
|
import { NativeCookerRegistry } from '@forgeax/engine-pack/native-cooker';
|
|
13
|
-
import { isEngineMaterial
|
|
13
|
+
import { isEngineMaterial } from '@forgeax/engine-shader';
|
|
14
14
|
import { externalizeSceneAsset } from '@forgeax/engine-scene';
|
|
15
15
|
import { sha256 } from '@noble/hashes/sha2.js';
|
|
16
16
|
import { bytesToHex } from '@noble/hashes/utils.js';
|
|
@@ -786,12 +786,7 @@ function isAsset(value) {
|
|
|
786
786
|
return record(value) && typeof value.kind === "string" && isScriptablePackAssetKind(value.kind);
|
|
787
787
|
}
|
|
788
788
|
function needsMaterialCook(asset) {
|
|
789
|
-
|
|
790
|
-
return asset.passes.some((pass) => {
|
|
791
|
-
const module = pass.program.module;
|
|
792
|
-
const surface = pass.program.moduleSlots?.surface;
|
|
793
|
-
return surface !== void 0 && surface !== DEFAULT_STANDARD_SURFACE_MODULE && (module === "forgeax_material::standard" || module === "forgeax::default-standard-pbr" || module === "forgeax_material::pbr-skin" || module === "forgeax::pbr-skin" || module === "forgeax::default-standard-pbr-skin");
|
|
794
|
-
});
|
|
789
|
+
return asset.kind === "material" && Array.isArray(asset.passes) && !isEngineMaterial(asset);
|
|
795
790
|
}
|
|
796
791
|
function clone(value) {
|
|
797
792
|
return structuredClone(value);
|
|
@@ -1618,7 +1613,9 @@ function materialProduct(input) {
|
|
|
1618
1613
|
for (const fieldName of Object.keys(material.values ?? {}).sort()) {
|
|
1619
1614
|
const value = material.values?.[fieldName];
|
|
1620
1615
|
if (typeof value === "string" && textureFields.has(fieldName)) {
|
|
1621
|
-
values[fieldName] =
|
|
1616
|
+
values[fieldName] = {
|
|
1617
|
+
texture: addMaterialRef(value, { componentName: "<material>", fieldName })
|
|
1618
|
+
};
|
|
1622
1619
|
} else if (value !== null && typeof value === "object" && !Array.isArray(value) && "texture" in value) {
|
|
1623
1620
|
const texture = value;
|
|
1624
1621
|
values[fieldName] = {
|
|
@@ -1951,7 +1948,7 @@ function ordinaryPodProduct(input) {
|
|
|
1951
1948
|
}
|
|
1952
1949
|
var materialAssetOutputProducer = createSafeProducer(
|
|
1953
1950
|
"material",
|
|
1954
|
-
"material-pack/
|
|
1951
|
+
"material-pack/2",
|
|
1955
1952
|
materialProduct
|
|
1956
1953
|
);
|
|
1957
1954
|
var meshAssetOutputProducer = createSafeProducer("mesh", "mesh-binary/4", meshProduct);
|