@forgeax/engine-vfx-render 0.1.6 → 0.1.19
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/.tsbuildinfo +1 -1
- package/dist/feature/gpu-particle-feature.d.ts.map +1 -1
- package/dist/feature/particle-resources.d.ts +11 -0
- package/dist/feature/particle-resources.d.ts.map +1 -1
- package/dist/host/vfx-runtime-host.d.ts +18 -5
- package/dist/host/vfx-runtime-host.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +27 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/fog-producer.integration.test.ts +5 -3
- package/src/__tests__/gpu-host.integration.test.ts +102 -0
- package/src/__tests__/particle-resources.unit.test.ts +9 -0
- package/src/__tests__/stage-plan.integration.test.ts +7 -1
- package/src/feature/gpu-particle-feature.ts +17 -3
- package/src/feature/particle-resources.ts +18 -0
- package/src/host/vfx-runtime-host.ts +56 -16
- package/src/index.ts +1 -0
- package/src/shaders/beam.wgsl +1 -24
- package/src/shaders/billboard.wgsl +1 -24
- package/src/shaders/mesh.wgsl +1 -24
- package/src/shaders/ribbon.wgsl +1 -24
- package/src/shaders/trail.wgsl +1 -24
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpu-particle-feature.d.ts","sourceRoot":"","sources":["../../src/feature/gpu-particle-feature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,KAAK,EAAE,aAAa,EAAqB,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAO,KAAK,aAAa,EAAE,KAAK,SAAS,EAAM,MAAM,uBAAuB,CAAC;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB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derFeatureMaterialShaderBindingContract } from '@forgeax/engine-render';
|
|
1
2
|
import { type MaterialAsset, type MaterialRenderState, type MeshAsset, type Result } from '@forgeax/engine-types';
|
|
2
3
|
import type { ParticleRendererSource } from '@forgeax/engine-vfx';
|
|
3
4
|
type ParticleRendererKind = ParticleRendererSource['kind'];
|
|
@@ -58,6 +59,16 @@ export interface ParticleMaterialPass {
|
|
|
58
59
|
export declare function particleMaterialPass(kind: ParticleRendererKind, material: MaterialAsset | undefined): ParticleMaterialPass;
|
|
59
60
|
/** True when the authored particle shader consumes the standard material bind group. */
|
|
60
61
|
export declare function particleMaterialUsesBindings(material: MaterialAsset | undefined): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Return the scene-depth binding slot required by a particle material shader.
|
|
64
|
+
*
|
|
65
|
+
* Custom particle shaders historically bind only the sampled depth resource at
|
|
66
|
+
* group(0)/binding(0), while the renderer-owned billboard shader also consumes
|
|
67
|
+
* the view UBO at binding(0) and therefore uses depth at binding(1). Keep this
|
|
68
|
+
* choice derived from the renderer contract instead of assuming every
|
|
69
|
+
* billboard has the built-in layout.
|
|
70
|
+
*/
|
|
71
|
+
export declare function particleMaterialSceneDepthBinding(contract: RenderFeatureMaterialShaderBindingContract | undefined): 0 | 1 | undefined;
|
|
61
72
|
export declare function canonicalMeshVertices(mesh: MeshAsset): Float32Array;
|
|
62
73
|
export {};
|
|
63
74
|
//# sourceMappingURL=particle-resources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"particle-resources.d.ts","sourceRoot":"","sources":["../../src/feature/particle-resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EAEd,KAAK,MAAM,EACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,KAAK,oBAAoB,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC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G,SAAS,GAAG,OAAO,CAEzF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,0CAA0C,GAAG,SAAS,GAC/D,CAAC,GAAG,CAAC,GAAG,SAAS,CAInB;AAQD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,CAyBnE"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
import type { AssetRegistry as LegacyAssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
2
|
-
import type { AssetRegistry as CoreAssetRegistry } from '@forgeax/engine-assets-runtime/internal';
|
|
1
|
+
import type { AssetRegistry as LegacyAssetRegistry, RuntimeAssetRegistry } from '@forgeax/engine-assets-runtime';
|
|
3
2
|
import { type EntityHandle, type World } from '@forgeax/engine-ecs';
|
|
4
|
-
import type { AssetDecoderLease, Result } from '@forgeax/engine-types';
|
|
3
|
+
import type { Asset, AssetDecoderLease, Result } from '@forgeax/engine-types';
|
|
5
4
|
import type { VfxDataInterfaceError, VfxDataInterfaceProvider, VfxDataInterfaceRequirement, VfxDataInterfaceResolution, VfxGpuPlayerInspectSnapshot, VfxGpuRuntimeDiagnostic, VfxReplayInput, VfxValueMap } from '@forgeax/engine-vfx';
|
|
6
5
|
import type { ParticleRenderCameraSource } from '../feature/camera.js';
|
|
7
6
|
import { gpuParticleRenderFeature } from '../feature/gpu-particle-feature.js';
|
|
8
7
|
import { type VfxDataInterfaceRegistry } from './data-interface-providers.js';
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Public authoring projection accepted by the VFX host. Editor owns the
|
|
10
|
+
* projection, while the Engine App still owns bytes/decoders/cache. Keeping
|
|
11
|
+
* this small structural seam public lets the Editor pass that projection
|
|
12
|
+
* without importing the runtime registry's internal module or fabricating a
|
|
13
|
+
* second registry identity.
|
|
14
|
+
*/
|
|
15
|
+
export interface VfxAuthoringAssetRegistry {
|
|
16
|
+
readonly loaders: {
|
|
17
|
+
registerPackLoader(loader: unknown): void;
|
|
18
|
+
};
|
|
19
|
+
lookup<T extends Asset = Asset>(guid: string): T | undefined;
|
|
20
|
+
readonly load?: (guid: string, kind: string) => Promise<Result<unknown, unknown>>;
|
|
21
|
+
}
|
|
22
|
+
type AssetRegistry = LegacyAssetRegistry | RuntimeAssetRegistry | VfxAuthoringAssetRegistry;
|
|
10
23
|
export interface VfxRuntimeHostOptions {
|
|
11
24
|
readonly camera: ParticleRenderCameraSource;
|
|
12
25
|
readonly maxQueuedTicks?: number;
|
|
@@ -77,7 +90,7 @@ export interface VfxRuntimeHost {
|
|
|
77
90
|
}, VfxRuntimeHostError>>;
|
|
78
91
|
}
|
|
79
92
|
/** Install the VFX owner decoder into the core registry. */
|
|
80
|
-
export declare function installVfxRuntimeDecoder(registry:
|
|
93
|
+
export declare function installVfxRuntimeDecoder(registry: RuntimeAssetRegistry): AssetDecoderLease;
|
|
81
94
|
export interface VfxRuntimeHostInspectSnapshot {
|
|
82
95
|
readonly generation: number;
|
|
83
96
|
/** VFX GPU resource generation; distinct from host attachment generation. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vfx-runtime-host.d.ts","sourceRoot":"","sources":["../../src/host/vfx-runtime-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"vfx-runtime-host.d.ts","sourceRoot":"","sources":["../../src/host/vfx-runtime-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,IAAI,mBAAmB,EACpC,oBAAoB,EACrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,KAAK,EACV,KAAK,EACL,iBAAiB,EAGjB,MAAM,EACP,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,EAC3B,0BAA0B,EAC1B,2BAA2B,EAC3B,uBAAuB,E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MAAM,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,2BAA2B,EAAE,CAAC;IACzD,QAAQ,CAAC,WAAW,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC1D;AAsBD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAkSnF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ export type { VfxStagePlanError, VfxStagePlanObservation, VfxStageReadiness, Vfx
|
|
|
6
6
|
export { observeStagePlan, stageDispatches, stageRecoveryReadiness, validatedStagePlan, } from './feature/stage-plan.js';
|
|
7
7
|
export type { VfxDataInterfaceAvailabilitySource, VfxDataInterfaceProvider, VfxDataInterfaceRegistry, } from './host/data-interface-providers.js';
|
|
8
8
|
export { createCameraProvider, createSceneDepthProvider, createVfxDataInterfaceRegistry, } from './host/data-interface-providers.js';
|
|
9
|
-
export type { VfxRuntimeHost, VfxRuntimeHostControl, VfxRuntimeHostControlError, VfxRuntimeHostError, VfxRuntimeHostInspectSnapshot, VfxRuntimeHostOptions, } from './host/vfx-runtime-host.js';
|
|
9
|
+
export type { VfxAuthoringAssetRegistry, VfxRuntimeHost, VfxRuntimeHostControl, VfxRuntimeHostControlError, VfxRuntimeHostError, VfxRuntimeHostInspectSnapshot, VfxRuntimeHostOptions, } from './host/vfx-runtime-host.js';
|
|
10
10
|
export { createVfxRuntimeHost, installVfxRuntimeDecoder } from './host/vfx-runtime-host.js';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,uBAAuB,EACvB,qBAA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CAAC;AACzC,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,kCAAkC,EAClC,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { frustum } from '@forgeax/engine-math';
|
|
|
2
2
|
import { Transform } from '@forgeax/engine-scene';
|
|
3
3
|
import { err, ok } from '@forgeax/engine-types';
|
|
4
4
|
import { VFX_GPU_RUNTIME_RESOURCE_KEY, vfxGpuEffectContribution, vfxGpuEffectPackLoader, vfxGpuRuntimePlugin, resolveVfxDataInterfaces, ParticleEffectPlayer } from '@forgeax/engine-vfx';
|
|
5
|
-
import { getAssetRegistryResolver } from '@forgeax/engine-assets-runtime
|
|
5
|
+
import { getAssetRegistryResolver } from '@forgeax/engine-assets-runtime';
|
|
6
6
|
import { createWorldContext } from '@forgeax/engine-ecs';
|
|
7
7
|
|
|
8
8
|
// src/feature/event-resources.ts
|
|
@@ -174,6 +174,11 @@ function particleMaterialPass(kind, material) {
|
|
|
174
174
|
function particleMaterialUsesBindings(material) {
|
|
175
175
|
return (material?.parameters?.length ?? 0) > 0;
|
|
176
176
|
}
|
|
177
|
+
function particleMaterialSceneDepthBinding(contract) {
|
|
178
|
+
if (contract === "group-0-resource") return 0;
|
|
179
|
+
if (contract === "view-and-scene-depth") return 1;
|
|
180
|
+
return void 0;
|
|
181
|
+
}
|
|
177
182
|
function floatAttribute(value) {
|
|
178
183
|
if (value instanceof Float32Array) return value;
|
|
179
184
|
if (value instanceof Uint16Array) return Float32Array.from(value);
|
|
@@ -571,6 +576,11 @@ function gpuParticleRenderFeature(options) {
|
|
|
571
576
|
return {
|
|
572
577
|
identity: IDENTITY,
|
|
573
578
|
requiredCapabilities: ["compute", "indirectDrawing"],
|
|
579
|
+
// Generated emitter programs are first-use assets. They must hand a
|
|
580
|
+
// WebGPU module to the prepared feature pipeline without waiting for the
|
|
581
|
+
// diagnostic-only getCompilationInfo() round trip; pipeline creation still
|
|
582
|
+
// validates the module before the pass is submitted.
|
|
583
|
+
shaderModuleMode: "immediate",
|
|
574
584
|
requiredMaterialShaders: Object.values(PARTICLE_SHADER_IDENTIFIERS),
|
|
575
585
|
extract: (context) => {
|
|
576
586
|
const extracted = [];
|
|
@@ -749,6 +759,9 @@ function gpuParticleRenderFeature(options) {
|
|
|
749
759
|
const mesh = meshes[rendererIndex];
|
|
750
760
|
const submesh = renderer.kind === "mesh" ? mesh?.submeshes[renderer.submesh ?? 0] : void 0;
|
|
751
761
|
const indexFormat = mesh?.indices instanceof Uint32Array ? "uint32" : "uint16";
|
|
762
|
+
const sceneDepthBinding = isBillboard ? particleMaterialSceneDepthBinding(
|
|
763
|
+
context.materialShaderBindingContract?.(materialPass.shader) ?? (materialPass.shader === PARTICLE_SHADER_IDENTIFIERS.billboard ? "view-and-scene-depth" : void 0)
|
|
764
|
+
) : void 0;
|
|
752
765
|
const instances = `${rendererPrefix}.instances`;
|
|
753
766
|
const history = `${rendererPrefix}.history`;
|
|
754
767
|
const projectionRuntime = `${rendererPrefix}.runtime`;
|
|
@@ -860,9 +873,9 @@ function gpuParticleRenderFeature(options) {
|
|
|
860
873
|
group: 0,
|
|
861
874
|
runtime: projectionRuntime,
|
|
862
875
|
instances,
|
|
863
|
-
...
|
|
876
|
+
...sceneDepthBinding === void 0 ? {} : { sceneDepthBinding }
|
|
864
877
|
},
|
|
865
|
-
...
|
|
878
|
+
...sceneDepthBinding !== void 0 && depthTarget !== void 0 ? { logicalTargets: { sceneDepth: depthTarget.name } } : {}
|
|
866
879
|
},
|
|
867
880
|
{ kind: "vertex-data", name: vertexData, layout: vertexLayout, buffer: instances }
|
|
868
881
|
);
|
|
@@ -946,7 +959,7 @@ function gpuParticleRenderFeature(options) {
|
|
|
946
959
|
depthStoreOp: "store"
|
|
947
960
|
}
|
|
948
961
|
},
|
|
949
|
-
...
|
|
962
|
+
...sceneDepthBinding !== void 0 && depthTarget !== void 0 ? { sampledTargets: [depthTarget.name] } : {},
|
|
950
963
|
draws: [
|
|
951
964
|
{
|
|
952
965
|
program: graphicsProgram,
|
|
@@ -1067,7 +1080,8 @@ function createVfxRuntimeHost(options) {
|
|
|
1067
1080
|
const cached = attached.renderAssets.get(key);
|
|
1068
1081
|
if (cached?.kind === kind) return cached;
|
|
1069
1082
|
if ("lookup" in attached.assets) {
|
|
1070
|
-
const
|
|
1083
|
+
const lookup = attached.assets.lookup;
|
|
1084
|
+
const legacy = lookup.call(attached.assets, guid);
|
|
1071
1085
|
if (legacy?.kind === kind) {
|
|
1072
1086
|
attached.renderAssets.set(key, legacy);
|
|
1073
1087
|
return legacy;
|
|
@@ -1078,9 +1092,10 @@ function createVfxRuntimeHost(options) {
|
|
|
1078
1092
|
attached.renderAssets.set(key, resolved);
|
|
1079
1093
|
return resolved;
|
|
1080
1094
|
}
|
|
1081
|
-
if ("load" in attached.assets && !attached.pendingRenderAssets.has(key)) {
|
|
1095
|
+
if ("load" in attached.assets && typeof attached.assets.load === "function" && !attached.pendingRenderAssets.has(key)) {
|
|
1082
1096
|
const epoch = attached.catalogEpoch;
|
|
1083
|
-
const
|
|
1097
|
+
const load = attached.assets.load;
|
|
1098
|
+
const request = load(guid, kind).then((result) => {
|
|
1084
1099
|
if (!result.ok || worlds.get(world) !== attached || attached.catalogEpoch !== epoch)
|
|
1085
1100
|
return;
|
|
1086
1101
|
attached.renderAssets.set(key, result.value);
|
|
@@ -1210,10 +1225,12 @@ function createVfxRuntimeHost(options) {
|
|
|
1210
1225
|
if (worlds.has(world)) return ok({ state: "already-attached" });
|
|
1211
1226
|
if (!registries.has(assets)) {
|
|
1212
1227
|
try {
|
|
1213
|
-
if ("
|
|
1228
|
+
if ("loaders" in assets) {
|
|
1229
|
+
assets.loaders.registerPackLoader(vfxGpuEffectPackLoader);
|
|
1230
|
+
} else if ("installDecoder" in assets) {
|
|
1214
1231
|
assets.installDecoder(vfxGpuEffectContribution.kind, vfxGpuEffectContribution.decoder);
|
|
1215
1232
|
} else {
|
|
1216
|
-
assets
|
|
1233
|
+
throw new TypeError("VFX assets registry exposes neither loaders nor installDecoder");
|
|
1217
1234
|
}
|
|
1218
1235
|
registries.add(assets);
|
|
1219
1236
|
} catch (cause) {
|
|
@@ -1245,7 +1262,7 @@ function createVfxRuntimeHost(options) {
|
|
|
1245
1262
|
);
|
|
1246
1263
|
}
|
|
1247
1264
|
let resolver;
|
|
1248
|
-
if ("installDecoder" in assets) {
|
|
1265
|
+
if (!("loaders" in assets) && "installDecoder" in assets) {
|
|
1249
1266
|
try {
|
|
1250
1267
|
resolver = getAssetRegistryResolver(assets);
|
|
1251
1268
|
} catch {
|