@forgeax/engine-vfx-render 0.1.3 → 0.1.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/README.md +6 -12
- package/dist/.tsbuildinfo +1 -1
- package/dist/feature/gpu-particle-feature.d.ts +20 -26
- package/dist/feature/gpu-particle-feature.d.ts.map +1 -1
- package/dist/feature/particle-resources.d.ts +0 -3
- package/dist/feature/particle-resources.d.ts.map +1 -1
- package/dist/feature/stage-plan.d.ts +1 -1
- package/dist/feature/stage-plan.d.ts.map +1 -1
- package/dist/host/vfx-runtime-host.d.ts +6 -3
- package/dist/host/vfx-runtime-host.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +452 -720
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/billboard-advanced.integration.test.ts +0 -23
- package/src/__tests__/fog-producer.integration.test.ts +4 -3
- package/src/__tests__/gpu-host.integration.test.ts +54 -120
- package/src/__tests__/particle-resources.unit.test.ts +0 -9
- package/src/__tests__/stage-plan.integration.test.ts +132 -0
- package/src/feature/gpu-particle-feature.ts +482 -888
- package/src/feature/particle-resources.ts +0 -8
- package/src/feature/stage-plan.ts +4 -1
- package/src/host/vfx-runtime-host.ts +34 -17
- package/src/index.ts +0 -1
package/README.md
CHANGED
|
@@ -18,7 +18,9 @@ const vfx = createVfxRuntimeHost({
|
|
|
18
18
|
const attached = await vfx.attachWorld({ world, assets });
|
|
19
19
|
if (!attached.ok) return attached;
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const created = await createRenderer(canvas, { features: [vfx.feature] });
|
|
22
|
+
if (!created.ok) throw created.error;
|
|
23
|
+
const renderer = created.value;
|
|
22
24
|
```
|
|
23
25
|
|
|
24
26
|
Create the host before the Renderer and pass `host.feature` at Renderer
|
|
@@ -27,19 +29,13 @@ FixedUpdate producer. `detachWorld` removes both the system and runtime
|
|
|
27
29
|
resource. Material and mesh GUIDs resolve through the attached World's
|
|
28
30
|
`AssetRegistry`.
|
|
29
31
|
|
|
30
|
-
When the Registry comes from `createApp`, select
|
|
31
|
-
`vfxGpuEffectContribution` in the App's `assetDecoders` option. The App and
|
|
32
|
-
host share that exact GPU decoder lease; a different `particle-effect`
|
|
33
|
-
decoder remains a closed owner conflict. A manually created Registry can use
|
|
34
|
-
`installVfxRuntimeDecoder` before `attachWorld`.
|
|
35
|
-
|
|
36
32
|
## Frame path
|
|
37
33
|
|
|
38
34
|
| Stage | Work |
|
|
39
35
|
|:--|:--|
|
|
40
36
|
| Extract | Read camera and ordered GPU tick intents from each attached World |
|
|
41
|
-
|
|
|
42
|
-
|
|
|
37
|
+
| Plan | Declare program, particle, scan, indirect, per-tick uniform, per-renderer projection, mesh, and graphics resources |
|
|
38
|
+
| Record | Compile the plan into spawn/update/scan/compact dispatches, then dependent indirect draws |
|
|
43
39
|
| Recover | Drop generation-owned GPU state and restart affected runtime players |
|
|
44
40
|
| Dispose | Release feature-owned state; the Renderer resolver destroys RHI resources exactly once |
|
|
45
41
|
|
|
@@ -73,9 +69,7 @@ use the same owner path.
|
|
|
73
69
|
- A material pass named `particle-billboard` or `particle-mesh` selects that renderer's authored
|
|
74
70
|
shader module and render state. Ordinary `Forward` passes are ignored because their vertex layout
|
|
75
71
|
is not a particle projection contract; absence of a matching particle pass uses the package-owned
|
|
76
|
-
built-in shader.
|
|
77
|
-
scene-depth texture from its binding contract, so authored shaders retain their own group-0
|
|
78
|
-
layout and are not given an unrelated depth binding.
|
|
72
|
+
built-in shader.
|
|
79
73
|
- A custom particle material with a non-empty `parameters` schema receives the standard material
|
|
80
74
|
bind group at group 1. Numeric parameters are uploaded through the shader-schema UBO layout;
|
|
81
75
|
texture parameters resolve their authored TextureAsset and optional SamplerAsset through the
|