sparcoon 0.7.3 → 0.9.1
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 +124 -76
- package/dist/artifact/FXArtifact.d.ts +120 -0
- package/dist/artifact/FXArtifact.js +1 -0
- package/dist/coreLayout.d.ts +22 -0
- package/dist/coreLayout.js +32 -0
- package/dist/editor/index.d.ts +8 -0
- package/dist/editor/index.js +17 -0
- package/dist/effect/FXEffect.d.ts +77 -0
- package/dist/effect/FXEffect.js +454 -0
- package/dist/effect/FXEffectSampling.Internal.d.ts +24 -0
- package/dist/effect/FXEffectSampling.Internal.js +165 -0
- package/dist/effect/FXEffectSpec.d.ts +115 -0
- package/dist/effect/FXEffectSpec.js +1 -0
- package/dist/emitter/FXEmitter.Internal.d.ts +23 -58
- package/dist/emitter/FXEmitter.Internal.js +13 -29
- package/dist/emitter/FXEmitter.d.ts +54 -46
- package/dist/emitter/FXEmitter.js +357 -186
- package/dist/emitter/FXFromArtifactsOptions.d.ts +13 -0
- package/dist/emitter/FXFromArtifactsOptions.js +1 -0
- package/dist/emitter/FXObjectMotion.Internal.d.ts +33 -0
- package/dist/emitter/FXObjectMotion.Internal.js +87 -0
- package/dist/emitter/FXSimulationHolder.d.ts +1 -0
- package/dist/emitter/FXSimulationHolder.js +43 -0
- package/dist/index.d.ts +11 -39
- package/dist/index.js +13 -36
- package/dist/instancedParticle/FXInstancedParticle.d.ts +1 -22
- package/dist/instancedParticle/FXInstancedParticle.js +145 -85
- package/dist/instancedParticle/glTypeInfo.d.ts +5 -0
- package/dist/instancedParticle/glTypeInfo.js +3 -0
- package/dist/instancedParticle/primitiveGeometry.d.ts +10 -0
- package/dist/instancedParticle/primitiveGeometry.js +30 -0
- package/dist/miscellaneous/asserts.d.ts +1 -18
- package/dist/miscellaneous/asserts.js +21 -28
- package/dist/miscellaneous/fxMath.d.ts +26 -0
- package/dist/miscellaneous/fxMath.js +261 -0
- package/dist/miscellaneous/math.d.ts +2 -7
- package/dist/miscellaneous/math.js +8 -9
- package/dist/miscellaneous/texture/fxDataTexture.d.ts +26 -0
- package/dist/miscellaneous/texture/fxDataTexture.js +20 -0
- package/dist/render/FXArtifactMaterial.Internal.d.ts +16 -0
- package/dist/render/FXArtifactMaterial.Internal.js +944 -0
- package/dist/render/FXArtifactMaterial.d.ts +1 -0
- package/dist/render/FXArtifactMaterial.js +79 -0
- package/dist/render/FXMaterialOptions.d.ts +27 -0
- package/dist/render/FXMaterialOptions.js +5 -0
- package/dist/render/FXMesh.d.ts +47 -0
- package/dist/render/FXMesh.js +99 -0
- package/dist/render/FXMeshMaterial.d.ts +40 -0
- package/dist/render/FXMeshMaterial.js +77 -0
- package/dist/world/FXWorld.d.ts +52 -0
- package/dist/world/FXWorld.js +104 -0
- package/package.json +49 -29
- package/dist/_virtual/2d.js +0 -3
- package/dist/_virtual/3d.js +0 -3
- package/dist/_virtual/4d.js +0 -3
- package/dist/_virtual/mod.js +0 -5
- package/dist/_virtual/mod2.js +0 -3
- package/dist/emitter/behavior/FXBehavior.d.ts +0 -24
- package/dist/emitter/behavior/FXBehavior.js +0 -10
- package/dist/emitter/behavior/FXBehaviorDirectionalForce.d.ts +0 -23
- package/dist/emitter/behavior/FXBehaviorDirectionalForce.js +0 -72
- package/dist/emitter/behavior/FXBehaviorPointForce.d.ts +0 -36
- package/dist/emitter/behavior/FXBehaviorPointForce.js +0 -94
- package/dist/emitter/behavior/FXBehaviorScaleOverLife.d.ts +0 -24
- package/dist/emitter/behavior/FXBehaviorScaleOverLife.js +0 -55
- package/dist/emitter/behavior/FXBehaviorTorqueDamping.d.ts +0 -20
- package/dist/emitter/behavior/FXBehaviorTorqueDamping.js +0 -48
- package/dist/emitter/behavior/FXBehaviorTorqueNoise.d.ts +0 -25
- package/dist/emitter/behavior/FXBehaviorTorqueNoise.js +0 -67
- package/dist/emitter/behavior/FXBehaviorTorqueOverLife.d.ts +0 -19
- package/dist/emitter/behavior/FXBehaviorTorqueOverLife.js +0 -41
- package/dist/emitter/behavior/FXBehaviorVelocityDamping.d.ts +0 -20
- package/dist/emitter/behavior/FXBehaviorVelocityDamping.js +0 -50
- package/dist/emitter/behavior/FXBehaviorVelocityNoise.d.ts +0 -25
- package/dist/emitter/behavior/FXBehaviorVelocityNoise.js +0 -76
- package/dist/emitter/behavior/FXBehaviorVelocityOverLife.d.ts +0 -22
- package/dist/emitter/behavior/FXBehaviorVelocityOverLife.js +0 -55
- package/dist/emitter/spawn/FXSpawn.d.ts +0 -11
- package/dist/emitter/spawn/FXSpawn.js +0 -10
- package/dist/emitter/spawn/FXSpawnBox.d.ts +0 -18
- package/dist/emitter/spawn/FXSpawnBox.js +0 -50
- package/dist/emitter/spawn/FXSpawnLifetime.d.ts +0 -17
- package/dist/emitter/spawn/FXSpawnLifetime.js +0 -44
- package/dist/emitter/spawn/FXSpawnOffset.d.ts +0 -21
- package/dist/emitter/spawn/FXSpawnOffset.js +0 -49
- package/dist/emitter/spawn/FXSpawnPoint.d.ts +0 -18
- package/dist/emitter/spawn/FXSpawnPoint.js +0 -46
- package/dist/emitter/spawn/FXSpawnRotation.d.ts +0 -17
- package/dist/emitter/spawn/FXSpawnRotation.js +0 -42
- package/dist/emitter/spawn/FXSpawnScale.d.ts +0 -22
- package/dist/emitter/spawn/FXSpawnScale.js +0 -56
- package/dist/emitter/spawn/FXSpawnSphere.d.ts +0 -36
- package/dist/emitter/spawn/FXSpawnSphere.js +0 -87
- package/dist/emitter/spawn/FXSpawnTorque.d.ts +0 -17
- package/dist/emitter/spawn/FXSpawnTorque.js +0 -42
- package/dist/emitter/spawn/FXSpawnVelocity.d.ts +0 -29
- package/dist/emitter/spawn/FXSpawnVelocity.js +0 -91
- package/dist/instancedParticle/FXInstancedParticle.Internal.d.ts +0 -2
- package/dist/instancedParticle/shared.d.ts +0 -19
- package/dist/instancedParticle/shared.js +0 -116
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.Internal.d.ts +0 -24
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.Internal.js +0 -275
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.d.ts +0 -75
- package/dist/materials/FXDiffuseMaterial/FXDiffuseMaterial.js +0 -63
- package/dist/materials/FXMaterial/FXBlending.Internal.d.ts +0 -24
- package/dist/materials/FXMaterial/FXBlending.Internal.js +0 -64
- package/dist/materials/FXMaterial/FXDepthMaterial.Internal.d.ts +0 -4
- package/dist/materials/FXMaterial/FXDepthMaterial.Internal.js +0 -144
- package/dist/materials/FXMaterial/FXDistanceMaterial.Internal.d.ts +0 -4
- package/dist/materials/FXMaterial/FXDistanceMaterial.Internal.js +0 -175
- package/dist/materials/FXMaterial/FXMaterial.d.ts +0 -70
- package/dist/materials/FXMaterial/FXMaterial.js +0 -51
- package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.Internal.d.ts +0 -7
- package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.Internal.js +0 -103
- package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.d.ts +0 -7
- package/dist/materials/FXUnlitMaterial/FXUnlitMaterial.js +0 -21
- package/dist/miscellaneous/color/FXColor.Internal.d.ts +0 -7
- package/dist/miscellaneous/color/FXColor.Internal.js +0 -42
- package/dist/miscellaneous/color/FXColor.d.ts +0 -234
- package/dist/miscellaneous/color/FXColor.js +0 -636
- package/dist/miscellaneous/curve/FXCurve1D.Internal.d.ts +0 -20
- package/dist/miscellaneous/curve/FXCurve1D.d.ts +0 -17
- package/dist/miscellaneous/curve/FXCurve1D.js +0 -94
- package/dist/miscellaneous/miscellaneous.d.ts +0 -34
- package/dist/miscellaneous/miscellaneous.js +0 -85
- package/dist/miscellaneous/texture/FXTextureView.Internal.d.ts +0 -49
- package/dist/miscellaneous/texture/FXTextureView.Internal.js +0 -6
- package/dist/miscellaneous/texture/FXTextureView.d.ts +0 -72
- package/dist/miscellaneous/texture/FXTextureView.js +0 -234
- package/dist/miscellaneous/webglCapabilities.d.ts +0 -1
- package/dist/miscellaneous/webglCapabilities.js +0 -45
- package/dist/node_modules/fast-simplex-noise/lib/2d.js +0 -93
- package/dist/node_modules/fast-simplex-noise/lib/3d.js +0 -142
- package/dist/node_modules/fast-simplex-noise/lib/4d.js +0 -196
- package/dist/node_modules/fast-simplex-noise/lib/mod.js +0 -24
- package/dist/nodes/FXNode.d.ts +0 -5
- package/dist/nodes/FXNode.js +0 -10
- package/dist/nodes/blending/FXNodeBlending.d.ts +0 -6
- package/dist/nodes/blending/FXNodeBlending.js +0 -9
- package/dist/nodes/blending/FXNodeLightnessBlendingMask.d.ts +0 -19
- package/dist/nodes/blending/FXNodeLightnessBlendingMask.js +0 -65
- package/dist/nodes/color/FXNodeColor.d.ts +0 -6
- package/dist/nodes/color/FXNodeColor.js +0 -9
- package/dist/nodes/color/FXNodeColorOverLife.d.ts +0 -22
- package/dist/nodes/color/FXNodeColorOverLife.js +0 -64
- package/dist/nodes/color/FXNodeSphericalClip.d.ts +0 -21
- package/dist/nodes/color/FXNodeSphericalClip.js +0 -54
- package/dist/nodes/normal/FXNodeFlatNormal.d.ts +0 -6
- package/dist/nodes/normal/FXNodeFlatNormal.js +0 -16
- package/dist/nodes/normal/FXNodeNormal.d.ts +0 -6
- package/dist/nodes/normal/FXNodeNormal.js +0 -9
- package/dist/nodes/normal/FXNodeSphericalNormal.d.ts +0 -6
- package/dist/nodes/normal/FXNodeSphericalNormal.js +0 -23
- package/dist/nodes/texture/FXNodeAnimatedTexture.d.ts +0 -52
- package/dist/nodes/texture/FXNodeAnimatedTexture.js +0 -151
- package/dist/nodes/texture/FXNodeStaticTexture.d.ts +0 -20
- package/dist/nodes/texture/FXNodeStaticTexture.js +0 -67
- package/dist/nodes/texture/FXNodeTexture.d.ts +0 -6
- package/dist/nodes/texture/FXNodeTexture.js +0 -9
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BufferGeometry, Texture } from "three";
|
|
2
|
+
import type { FXEmitterOptions } from "./FXEmitter.Internal.js";
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link FXEmitter.fromArtifacts}: the emitter options plus external textures by slot -
|
|
5
|
+
* a uniform declared `{ type: "sampler2D", external: "<slot>" }` binds from `textures[<slot>]` -
|
|
6
|
+
* and custom geometries by name, resolving a `{ type: "custom", external: "<name>" }` geometry
|
|
7
|
+
* source from `geometries[<name>]`. The app owns both maps' lifecycle; the runtime never disposes
|
|
8
|
+
* them.
|
|
9
|
+
*/
|
|
10
|
+
export interface FXFromArtifactsOptions extends Partial<FXEmitterOptions> {
|
|
11
|
+
readonly textures?: Record<string, Texture>;
|
|
12
|
+
readonly geometries?: Record<string, BufferGeometry>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure world-space motion tracking shared by {@link FXEmitter} and `FXEffect`'s VFX-mesh
|
|
3
|
+
* driving: given an object's current world position/quaternion (from a decomposed
|
|
4
|
+
* `matrixWorld`) and the real per-frame `dt`, derives its linear and angular velocity - both
|
|
5
|
+
* already normalized to units/radians per second, never a raw "delta this frame". Three-free
|
|
6
|
+
* (like `FXEffectSampling.Internal`) so the math unit-tests as plain arithmetic.
|
|
7
|
+
*/
|
|
8
|
+
export type FXObjectVec3 = readonly [number, number, number];
|
|
9
|
+
/** A rotation quaternion in `[x, y, z, w]` order (three's component order). */
|
|
10
|
+
export type FXObjectQuat = readonly [number, number, number, number];
|
|
11
|
+
/** An object's world-space pose at one instant: position + rotation: scale is not tracked. */
|
|
12
|
+
export interface FXObjectPose {
|
|
13
|
+
readonly position: FXObjectVec3;
|
|
14
|
+
readonly quaternion: FXObjectQuat;
|
|
15
|
+
}
|
|
16
|
+
/** World-space linear + angular velocity, both already per-second. */
|
|
17
|
+
export interface FXObjectMotion {
|
|
18
|
+
readonly velocity: FXObjectVec3;
|
|
19
|
+
readonly angularVelocity: FXObjectVec3;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Tracks one object's pose across ticks to derive its world velocity/angular velocity. The
|
|
23
|
+
* first `sample()` call (and the one right after `reset()`) has no prior pose to diff against,
|
|
24
|
+
* so it reports zero motion and just records the baseline - a restarted effect never reports a
|
|
25
|
+
* teleport spike from wherever the object was last posed.
|
|
26
|
+
*/
|
|
27
|
+
export declare class FXObjectMotionTracker {
|
|
28
|
+
private previous;
|
|
29
|
+
/** The motion arriving at `pose` over the last `deltaTime` seconds; `deltaTime <= 0` (paused) reports zero. */
|
|
30
|
+
sample(pose: FXObjectPose, deltaTime: number): FXObjectMotion;
|
|
31
|
+
/** Drops the stored baseline, so the next `sample()` reports zero motion instead of a restart spike. */
|
|
32
|
+
reset(): void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure world-space motion tracking shared by {@link FXEmitter} and `FXEffect`'s VFX-mesh
|
|
3
|
+
* driving: given an object's current world position/quaternion (from a decomposed
|
|
4
|
+
* `matrixWorld`) and the real per-frame `dt`, derives its linear and angular velocity - both
|
|
5
|
+
* already normalized to units/radians per second, never a raw "delta this frame". Three-free
|
|
6
|
+
* (like `FXEffectSampling.Internal`) so the math unit-tests as plain arithmetic.
|
|
7
|
+
*/
|
|
8
|
+
const ZERO_VEC3 = [0, 0, 0];
|
|
9
|
+
const ZERO_MOTION = { velocity: ZERO_VEC3, angularVelocity: ZERO_VEC3 };
|
|
10
|
+
/** Below this rotation angle (radians) the axis is numerically undefined - report no spin. */
|
|
11
|
+
const MIN_ANGLE = 1e-6;
|
|
12
|
+
function clamp(value, min, max) {
|
|
13
|
+
return Math.min(Math.max(value, min), max);
|
|
14
|
+
}
|
|
15
|
+
/** Hamilton product `a * b` (applies `b`'s rotation first, then `a`'s - three's convention). */
|
|
16
|
+
function multiplyQuat(a, b) {
|
|
17
|
+
const [ax, ay, az, aw] = a;
|
|
18
|
+
const [bx, by, bz, bw] = b;
|
|
19
|
+
return [
|
|
20
|
+
aw * bx + ax * bw + ay * bz - az * by,
|
|
21
|
+
aw * by - ax * bz + ay * bw + az * bx,
|
|
22
|
+
aw * bz + ax * by - ay * bx + az * bw,
|
|
23
|
+
aw * bw - ax * bx - ay * by - az * bz,
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
/** Inverse of a *unit* quaternion (conjugate) - `Matrix4.decompose` always yields one. */
|
|
27
|
+
function invertUnitQuat(q) {
|
|
28
|
+
return [-q[0], -q[1], -q[2], q[3]];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* World-space angular velocity (axis * rad/s) for the rotation from `previous` to `current`.
|
|
32
|
+
* Composed in world order (`current * previous^-1`: undo `previous`, then apply `current`), so
|
|
33
|
+
* it reads directly in world axes - matching the linear `velocity` this module also derives.
|
|
34
|
+
*/
|
|
35
|
+
function angularVelocityBetween(current, previous, deltaTime) {
|
|
36
|
+
const delta = multiplyQuat(current, invertUnitQuat(previous));
|
|
37
|
+
// `q` and `-q` represent the same rotation; without this flip a small rotation can land on
|
|
38
|
+
// the "long way around" (w < 0), reporting an angle near 2*pi instead of near 0.
|
|
39
|
+
const w = delta[3] < 0 ? -delta[3] : delta[3];
|
|
40
|
+
const sign = delta[3] < 0 ? -1 : 1;
|
|
41
|
+
const angle = 2 * Math.acos(clamp(w, -1, 1));
|
|
42
|
+
if (angle < MIN_ANGLE) {
|
|
43
|
+
return ZERO_VEC3;
|
|
44
|
+
}
|
|
45
|
+
const x = delta[0] * sign;
|
|
46
|
+
const y = delta[1] * sign;
|
|
47
|
+
const z = delta[2] * sign;
|
|
48
|
+
const axisLength = Math.hypot(x, y, z);
|
|
49
|
+
if (axisLength < MIN_ANGLE) {
|
|
50
|
+
return ZERO_VEC3;
|
|
51
|
+
}
|
|
52
|
+
const rate = angle / deltaTime;
|
|
53
|
+
return [(x / axisLength) * rate, (y / axisLength) * rate, (z / axisLength) * rate];
|
|
54
|
+
}
|
|
55
|
+
/** `current`'s world velocity/angular velocity relative to `previous`, `deltaTime` seconds apart. */
|
|
56
|
+
function diffPose(current, previous, deltaTime) {
|
|
57
|
+
const velocity = [
|
|
58
|
+
(current.position[0] - previous.position[0]) / deltaTime,
|
|
59
|
+
(current.position[1] - previous.position[1]) / deltaTime,
|
|
60
|
+
(current.position[2] - previous.position[2]) / deltaTime,
|
|
61
|
+
];
|
|
62
|
+
const angularVelocity = angularVelocityBetween(current.quaternion, previous.quaternion, deltaTime);
|
|
63
|
+
return { velocity, angularVelocity };
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Tracks one object's pose across ticks to derive its world velocity/angular velocity. The
|
|
67
|
+
* first `sample()` call (and the one right after `reset()`) has no prior pose to diff against,
|
|
68
|
+
* so it reports zero motion and just records the baseline - a restarted effect never reports a
|
|
69
|
+
* teleport spike from wherever the object was last posed.
|
|
70
|
+
*/
|
|
71
|
+
export class FXObjectMotionTracker {
|
|
72
|
+
/** The motion arriving at `pose` over the last `deltaTime` seconds; `deltaTime <= 0` (paused) reports zero. */
|
|
73
|
+
sample(pose, deltaTime) {
|
|
74
|
+
const previous = this.previous;
|
|
75
|
+
// Always record the latest pose, even on a zero/negative-deltaTime or first call, so a paused
|
|
76
|
+
// frame's teleport is not mistaken for a spike on the next real tick.
|
|
77
|
+
this.previous = pose;
|
|
78
|
+
if (previous === undefined || deltaTime <= 0) {
|
|
79
|
+
return ZERO_MOTION;
|
|
80
|
+
}
|
|
81
|
+
return diffPose(pose, previous, deltaTime);
|
|
82
|
+
}
|
|
83
|
+
/** Drops the stored baseline, so the next `sample()` reports zero motion instead of a restart spike. */
|
|
84
|
+
reset() {
|
|
85
|
+
this.previous = undefined;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { FX_CORE_LIFECYCLE, FX_CORE_POSITION } from "../coreLayout.js";
|
|
2
|
+
const CORE_BUFFER_NAMES = new Set([FX_CORE_POSITION, FX_CORE_LIFECYCLE]);
|
|
3
|
+
/**
|
|
4
|
+
* @internal The runtime's behavior driver: holds a precompiled {@link FXBehaviorArtifact} and just
|
|
5
|
+
* calls its `spawn`/`update` each tick (no graph, compiler, or `new Function`). The artifact's
|
|
6
|
+
* `bindings` record is passed through on every call, so a value scrub is read next tick.
|
|
7
|
+
*/
|
|
8
|
+
export class FXSimulationHolder {
|
|
9
|
+
constructor(artifact) {
|
|
10
|
+
this.artifact = artifact;
|
|
11
|
+
}
|
|
12
|
+
/** Declared buffers minus the fixed core `position`/`lifecycle` - one per user attribute. */
|
|
13
|
+
get attributeBuffers() {
|
|
14
|
+
return this.artifact.buffers.filter((buffer) => !CORE_BUFFER_NAMES.has(buffer.name));
|
|
15
|
+
}
|
|
16
|
+
get attributeWrites() {
|
|
17
|
+
return this.artifact.attributeWrites;
|
|
18
|
+
}
|
|
19
|
+
get canSpawn() {
|
|
20
|
+
return this.artifact.spawn !== undefined;
|
|
21
|
+
}
|
|
22
|
+
get spawnWrittenBuffers() {
|
|
23
|
+
return this.artifact.spawnWrittenBuffers ?? [];
|
|
24
|
+
}
|
|
25
|
+
get updateWrittenBuffers() {
|
|
26
|
+
return this.artifact.updateWrittenBuffers;
|
|
27
|
+
}
|
|
28
|
+
/** Seeds newborns `[begin, begin + count)`. No-op if the artifact is update-only. */
|
|
29
|
+
spawn(buffers, begin, count, emitter) {
|
|
30
|
+
this.artifact.spawn?.(buffers, begin, count, this.artifact.bindings, emitter);
|
|
31
|
+
}
|
|
32
|
+
update(buffers, count, deltaTime, emitter) {
|
|
33
|
+
this.artifact.update(buffers, count, deltaTime, this.artifact.bindings, emitter);
|
|
34
|
+
}
|
|
35
|
+
/** Behavior half of {@link FXEmitter.applyValues}: mutate each named slot in place; unknown name = no-op. */
|
|
36
|
+
applyBindingValues(values) {
|
|
37
|
+
for (const name in values) {
|
|
38
|
+
if (name in this.artifact.bindings) {
|
|
39
|
+
this.artifact.bindings[name].value = values[name];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,39 +1,11 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { FXSpawnLifetime } from "./emitter/spawn/FXSpawnLifetime";
|
|
13
|
-
export { FXSpawnOffset } from "./emitter/spawn/FXSpawnOffset";
|
|
14
|
-
export { FXSpawnPoint } from "./emitter/spawn/FXSpawnPoint";
|
|
15
|
-
export { FXSpawnRotation } from "./emitter/spawn/FXSpawnRotation";
|
|
16
|
-
export { FXSpawnScale } from "./emitter/spawn/FXSpawnScale";
|
|
17
|
-
export { FXSpawnSphere } from "./emitter/spawn/FXSpawnSphere";
|
|
18
|
-
export { FXSpawnTorque } from "./emitter/spawn/FXSpawnTorque";
|
|
19
|
-
export { FXSpawnVelocity } from "./emitter/spawn/FXSpawnVelocity";
|
|
20
|
-
export { FXDiffuseMaterial } from "./materials/FXDiffuseMaterial/FXDiffuseMaterial";
|
|
21
|
-
export { FXBlending, FXMaterial } from "./materials/FXMaterial/FXMaterial";
|
|
22
|
-
export { FXUnlitMaterial } from "./materials/FXUnlitMaterial/FXUnlitMaterial";
|
|
23
|
-
export { FXColor } from "./miscellaneous/color/FXColor";
|
|
24
|
-
export { FXCurve1D } from "./miscellaneous/curve/FXCurve1D";
|
|
25
|
-
export type { FXCurve1DAnchor, FXCurve1DConfig, FXCurve1DPoint, } from "./miscellaneous/curve/FXCurve1D";
|
|
26
|
-
export { FXTextureView } from "./miscellaneous/texture/FXTextureView";
|
|
27
|
-
export type { FXTextureAtlasConfig, FXTextureConfig, FXTextureRect, FXTextureSize, FXTextureTrim, } from "./miscellaneous/texture/FXTextureView.Internal";
|
|
28
|
-
export { FXNodeBlending } from "./nodes/blending/FXNodeBlending";
|
|
29
|
-
export { FXNodeLightnessBlendingMask } from "./nodes/blending/FXNodeLightnessBlendingMask";
|
|
30
|
-
export { FXNodeColor } from "./nodes/color/FXNodeColor";
|
|
31
|
-
export { FXNodeColorOverLife } from "./nodes/color/FXNodeColorOverLife";
|
|
32
|
-
export { FXNodeSphericalClip } from "./nodes/color/FXNodeSphericalClip";
|
|
33
|
-
export { FXNodeFlatNormal } from "./nodes/normal/FXNodeFlatNormal";
|
|
34
|
-
export { FXNodeNormal } from "./nodes/normal/FXNodeNormal";
|
|
35
|
-
export { FXNodeSphericalNormal } from "./nodes/normal/FXNodeSphericalNormal";
|
|
36
|
-
export { FXNodeAnimatedTexture } from "./nodes/texture/FXNodeAnimatedTexture";
|
|
37
|
-
export type { FXNodeAnimatedTextureOptions } from "./nodes/texture/FXNodeAnimatedTexture";
|
|
38
|
-
export { FXNodeStaticTexture } from "./nodes/texture/FXNodeStaticTexture";
|
|
39
|
-
export { FXNodeTexture } from "./nodes/texture/FXNodeTexture";
|
|
1
|
+
export type { FXAttributeDecl, FXBehaviorArtifact, FXBufferLayout, FXGeometrySource, FXKernelBuffers, FXRenderArtifact, FXShaderStageSource, FXUniformInit, FXValueSlot, } from "./artifact/FXArtifact.js";
|
|
2
|
+
export { FX_AGE, FX_CORE_LIFECYCLE, FX_CORE_LIFECYCLE_STRIDE, FX_CORE_LIFECYCLE_VARYING, FX_CORE_PARTICLE_DEFINES, FX_CORE_POSITION, FX_CORE_POSITION_STRIDE, FX_CORE_POSITION_VARYING, FX_LIFETIME, FX_POSITION_X, FX_POSITION_Y, FX_POSITION_Z, } from "./coreLayout.js";
|
|
3
|
+
export type { FXGraphLambertMaterialOptions, FXGraphUnlitMaterialOptions, FXRenderMode, } from "./render/FXMaterialOptions.js";
|
|
4
|
+
export type { FXGeometryPrimitive } from "./artifact/FXArtifact.js";
|
|
5
|
+
export { FXEffect } from "./effect/FXEffect.js";
|
|
6
|
+
export type { FXEffectOptions, FXEffectSpec } from "./effect/FXEffectSpec.js";
|
|
7
|
+
export type { FXEmitter } from "./emitter/FXEmitter.js";
|
|
8
|
+
export { FXWorld } from "./world/FXWorld.js";
|
|
9
|
+
export { fxFbm, fxFract, fxHash, fxMix, fxMod, fxSampleLut, fxSmoothstep, fxSnoise2, fxSnoise3, fxValueNoise, } from "./miscellaneous/fxMath.js";
|
|
10
|
+
export { fxDataTexture } from "./miscellaneous/texture/fxDataTexture.js";
|
|
11
|
+
export type { FXDataTextureOptions } from "./miscellaneous/texture/fxDataTexture.js";
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export { FXSpawnPoint } from './emitter/spawn/FXSpawnPoint.js';
|
|
15
|
-
export { FXSpawnRotation } from './emitter/spawn/FXSpawnRotation.js';
|
|
16
|
-
export { FXSpawnScale } from './emitter/spawn/FXSpawnScale.js';
|
|
17
|
-
export { FXSpawnSphere } from './emitter/spawn/FXSpawnSphere.js';
|
|
18
|
-
export { FXSpawnTorque } from './emitter/spawn/FXSpawnTorque.js';
|
|
19
|
-
export { FXSpawnVelocity } from './emitter/spawn/FXSpawnVelocity.js';
|
|
20
|
-
export { FXDiffuseMaterial } from './materials/FXDiffuseMaterial/FXDiffuseMaterial.js';
|
|
21
|
-
export { FXBlending, FXMaterial } from './materials/FXMaterial/FXMaterial.js';
|
|
22
|
-
export { FXUnlitMaterial } from './materials/FXUnlitMaterial/FXUnlitMaterial.js';
|
|
23
|
-
export { FXColor } from './miscellaneous/color/FXColor.js';
|
|
24
|
-
export { FXCurve1D } from './miscellaneous/curve/FXCurve1D.js';
|
|
25
|
-
export { FXTextureView } from './miscellaneous/texture/FXTextureView.js';
|
|
26
|
-
export { FXNodeBlending } from './nodes/blending/FXNodeBlending.js';
|
|
27
|
-
export { FXNodeLightnessBlendingMask } from './nodes/blending/FXNodeLightnessBlendingMask.js';
|
|
28
|
-
export { FXNodeColor } from './nodes/color/FXNodeColor.js';
|
|
29
|
-
export { FXNodeColorOverLife } from './nodes/color/FXNodeColorOverLife.js';
|
|
30
|
-
export { FXNodeSphericalClip } from './nodes/color/FXNodeSphericalClip.js';
|
|
31
|
-
export { FXNodeFlatNormal } from './nodes/normal/FXNodeFlatNormal.js';
|
|
32
|
-
export { FXNodeNormal } from './nodes/normal/FXNodeNormal.js';
|
|
33
|
-
export { FXNodeSphericalNormal } from './nodes/normal/FXNodeSphericalNormal.js';
|
|
34
|
-
export { FXNodeAnimatedTexture } from './nodes/texture/FXNodeAnimatedTexture.js';
|
|
35
|
-
export { FXNodeStaticTexture } from './nodes/texture/FXNodeStaticTexture.js';
|
|
36
|
-
export { FXNodeTexture } from './nodes/texture/FXNodeTexture.js';
|
|
1
|
+
// Public surface of the thin runtime: an editor-emitted module subclasses FXEffect, joins an
|
|
2
|
+
// FXWorld, and is driven by a single FXWorld.update per frame - plus the runtime-owned types the
|
|
3
|
+
// editor imports (artifact contracts and the core layout). No graph, compiler, validator, or live
|
|
4
|
+
// protocol lives here.
|
|
5
|
+
export { FX_AGE, FX_CORE_LIFECYCLE, FX_CORE_LIFECYCLE_STRIDE, FX_CORE_LIFECYCLE_VARYING, FX_CORE_PARTICLE_DEFINES, FX_CORE_POSITION, FX_CORE_POSITION_STRIDE, FX_CORE_POSITION_VARYING, FX_LIFETIME, FX_POSITION_X, FX_POSITION_Y, FX_POSITION_Z, } from "./coreLayout.js";
|
|
6
|
+
// Whole-project playback: the generic runtime behind every editor-emitted project module (base
|
|
7
|
+
// class + scene specification). An emitted module supplies only its `FXEffectSpec` data and a thin subclass.
|
|
8
|
+
export { FXEffect } from "./effect/FXEffect.js";
|
|
9
|
+
// The tick domain: an effect joins one on construction; a single FXWorld.update per frame drives
|
|
10
|
+
// every effect's timeline and the shared particle pool.
|
|
11
|
+
export { FXWorld } from "./world/FXWorld.js";
|
|
12
|
+
export { fxFbm, fxFract, fxHash, fxMix, fxMod, fxSampleLut, fxSmoothstep, fxSnoise2, fxSnoise3, fxValueNoise, } from "./miscellaneous/fxMath.js";
|
|
13
|
+
export { fxDataTexture } from "./miscellaneous/texture/fxDataTexture.js";
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { InstancedBufferAttribute, Mesh } from "three";
|
|
3
|
-
import type { GLTypeInfo } from "./shared";
|
|
4
|
-
export declare class FXInstancedParticle extends Mesh {
|
|
5
|
-
private readonly capacityStep;
|
|
6
|
-
readonly propertyBuffers: Record<string, InstancedBufferAttribute>;
|
|
7
|
-
private readonly instancedGeometry;
|
|
8
|
-
private readonly particleMaterial;
|
|
9
|
-
private capacity;
|
|
10
|
-
private sortingIndices;
|
|
11
|
-
private sortingSquaredDistances;
|
|
12
|
-
private sortingTemporaryBuffer;
|
|
13
|
-
constructor(varyings: Record<string, GLTypeInfo>, expectedCapacity: number, capacityStep: number, material: Material);
|
|
14
|
-
get instanceCount(): number;
|
|
15
|
-
get instanceCapacity(): number;
|
|
16
|
-
createInstances(count: number): void;
|
|
17
|
-
removeDeadParticles(): void;
|
|
18
|
-
sortByDistance(cameraWorldPosition: Vector3): void;
|
|
19
|
-
drop(): void;
|
|
20
|
-
destroy(): void;
|
|
21
|
-
private ensureCapacity;
|
|
22
|
-
}
|
|
1
|
+
export {};
|