@margoengine/vfx 0.0.0-stage → 1.0.0
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/LICENSE +201 -0
- package/NOTICE +4 -0
- package/README.md +2240 -2
- package/dist/base-LGs65K7K.js +709 -0
- package/dist/base.d.ts +869 -0
- package/dist/base.js +1 -0
- package/dist/blown-sand.d.ts +218 -0
- package/dist/blown-sand.js +700 -0
- package/dist/clouds.d.ts +237 -0
- package/dist/clouds.js +583 -0
- package/dist/compat-BFjXAQuu.js +14 -0
- package/dist/compat-CVSEj1Bp.js +217 -0
- package/dist/compat.d.ts +59 -0
- package/dist/curves.d.ts +11 -0
- package/dist/curves.js +59 -0
- package/dist/debris.d.ts +154 -0
- package/dist/debris.js +290 -0
- package/dist/depth-collide.d.ts +7 -0
- package/dist/depth-collide.js +96 -0
- package/dist/dust-current.d.ts +66 -0
- package/dist/dust-current.js +92 -0
- package/dist/emitter.d.ts +10 -0
- package/dist/emitter.js +125 -0
- package/dist/events.d.ts +9 -0
- package/dist/events.js +131 -0
- package/dist/extra-CgGjbojB.js +4 -0
- package/dist/extra.d.ts +2 -0
- package/dist/fields.d.ts +11 -0
- package/dist/fields.js +95 -0
- package/dist/fire-front.d.ts +610 -0
- package/dist/fire-front.js +1080 -0
- package/dist/fire.d.ts +140 -0
- package/dist/fire.js +194 -0
- package/dist/flame-ramp-VoBKpYnM.js +75 -0
- package/dist/flame-ramp.d.ts +61 -0
- package/dist/flame.d.ts +428 -0
- package/dist/flame.js +817 -0
- package/dist/flipbook.d.ts +7 -0
- package/dist/flipbook.js +23 -0
- package/dist/flocking-shaders.d.ts +48 -0
- package/dist/flocking-sim.d.ts +623 -0
- package/dist/flocking.d.ts +145 -0
- package/dist/flocking.js +1846 -0
- package/dist/fog-B-kBv7g0.js +32 -0
- package/dist/frame-BuvMFBPp.js +4 -0
- package/dist/frame.d.ts +7 -0
- package/dist/gunfire.d.ts +742 -0
- package/dist/gunfire.js +1214 -0
- package/dist/hash-Btsp6fGK.js +7 -0
- package/dist/hash.d.ts +2 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +60 -0
- package/dist/json.d.ts +53 -0
- package/dist/json.js +239 -0
- package/dist/lit-Dx2tNwP-.js +152 -0
- package/dist/lit.d.ts +18 -0
- package/dist/lit.js +1 -0
- package/dist/mesh.d.ts +16 -0
- package/dist/mesh.js +248 -0
- package/dist/node-system.d.ts +315 -0
- package/dist/node-system.js +384 -0
- package/dist/nodes.d.ts +14 -0
- package/dist/nodes.js +293 -0
- package/dist/obstacles.d.ts +3 -0
- package/dist/obstacles.js +25 -0
- package/dist/over-life.d.ts +14 -0
- package/dist/over-life.js +94 -0
- package/dist/reactive-mask-B8xbyzlk.js +69 -0
- package/dist/require-webgpu--tUXPsmA.js +7 -0
- package/dist/ribbons.d.ts +22 -0
- package/dist/ribbons.js +165 -0
- package/dist/schedule.d.ts +29 -0
- package/dist/schedule.js +47 -0
- package/dist/settings.d.ts +362 -0
- package/dist/settings.js +707 -0
- package/dist/shader.d.ts +49 -0
- package/dist/shadows.d.ts +26 -0
- package/dist/shadows.js +182 -0
- package/dist/shapes.d.ts +34 -0
- package/dist/shapes.js +81 -0
- package/dist/shared/fog.d.ts +33 -0
- package/dist/shared/pass.d.ts +53 -0
- package/dist/shared/settings.d.ts +89 -0
- package/dist/skinned.d.ts +11 -0
- package/dist/skinned.js +104 -0
- package/dist/smoke.d.ts +283 -0
- package/dist/smoke.js +504 -0
- package/dist/soft.d.ts +17 -0
- package/dist/soft.js +55 -0
- package/dist/solid.d.ts +168 -0
- package/dist/solid.js +403 -0
- package/dist/sort.d.ts +3 -0
- package/dist/sort.js +58 -0
- package/dist/space.d.ts +14 -0
- package/dist/space.js +88 -0
- package/dist/stretch.d.ts +7 -0
- package/dist/stretch.js +40 -0
- package/dist/texture.d.ts +8 -0
- package/dist/texture.js +45 -0
- package/dist/view-RKprOPAy.js +30 -0
- package/dist/view-rect-DkeiiUtw.js +13 -0
- package/dist/wrap.d.ts +3 -0
- package/dist/wrap.js +5 -0
- package/package.json +198 -4
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LinearToSRGB as e, parseColor as t } from "@margoengine/math/color";
|
|
2
|
+
//#region ../shared/fog.js
|
|
3
|
+
var n = (e, t) => `
|
|
4
|
+
struct MargoFog {color:vec4f,params:vec4f,eye:vec4f}
|
|
5
|
+
@group(${e}) @binding(${t}) var<uniform> margoFog:MargoFog;
|
|
6
|
+
fn fogAmount(p:vec3f)->f32 {
|
|
7
|
+
let d=distance(p,margoFog.eye.xyz);let q=margoFog.params;
|
|
8
|
+
let amount=select(clamp((d-q.x)/max(q.y-q.x,1e-6),0.0,1.0),1.0-exp(-q.z*q.z*d*d),q.z>0.0);
|
|
9
|
+
return amount*exp(-q.w*max(p.y-margoFog.color.w,0.0));
|
|
10
|
+
}
|
|
11
|
+
`, r = (e, t, n, r) => {
|
|
12
|
+
let i = e === void 0 ? t : e;
|
|
13
|
+
if (typeof i != "number" || !Number.isFinite(i) || i < r) throw RangeError(`Fog ${n} is ${String(i)}; pass a finite number${r === 0 ? ", 0 or more" : ""}`);
|
|
14
|
+
return i;
|
|
15
|
+
};
|
|
16
|
+
function i(e) {
|
|
17
|
+
if (e !== null && (typeof e != "object" || Array.isArray(e))) throw TypeError("Fog must be an object with Fog fields; pass an environment Fog, such an object or null");
|
|
18
|
+
return e && a(e, [
|
|
19
|
+
0,
|
|
20
|
+
0,
|
|
21
|
+
0
|
|
22
|
+
], /* @__PURE__ */ new Float32Array(12)), e;
|
|
23
|
+
}
|
|
24
|
+
function a(n, i, a, o = !1) {
|
|
25
|
+
let s = n.enabled ?? !0;
|
|
26
|
+
if (typeof s != "boolean") throw TypeError(`Fog enabled is ${String(s)}; pass true or false`);
|
|
27
|
+
let c = r(n.height, 0, "height", -Infinity), l = r(n.near, 1, "near", 0), u = r(n.far, 1e3, "far", 0), d = r(n.density, 0, "density", 0), f = r(n.heightFalloff, 0, "heightFalloff", 0);
|
|
28
|
+
if (t(n.color ?? "#ffffff", a, 0), o) for (let t = 0; t < 3; t++) a[t] = e(a[t]);
|
|
29
|
+
a[3] = c, a[4] = l, a[5] = u, a[6] = d, a[7] = f, s || (a.fill(0, 0, 8), a[4] = a[5] = 34028234663852886e22), a[8] = i[0], a[9] = i[1], a[10] = i[2], a[11] = 0;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { n, a as r, i as t };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region src/frame.ts
|
|
2
|
+
var e = "\nstruct Particle {positionLife:vec4f,velocitySize:vec4f,color:vec4f,rotation:vec4f}\nstruct Frame {camera:mat4x4f,right:vec4f,up:vec4f,gravityDelta:vec4f,emitterTime:vec4f,velocitySpread:vec4f,color:vec4f,shape:vec4f,physics:vec4f,emissionExtent:vec4f,control:vec4u}\n@group(0) @binding(0) var<uniform> f:Frame;\n", t = "particles[at]=p.positionLife;";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { t as n, e as t };
|
package/dist/frame.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* right and up: the camera's axes; right.w: the view matrix's z translation (a particle's view depth, under a transparency
|
|
3
|
+
* hook); up.w: pixels per world unit at clip w = 1 (for the billboard's minimum size).
|
|
4
|
+
*/
|
|
5
|
+
export declare const frame = "\nstruct Particle {positionLife:vec4f,velocitySize:vec4f,color:vec4f,rotation:vec4f}\nstruct Frame {camera:mat4x4f,right:vec4f,up:vec4f,gravityDelta:vec4f,emitterTime:vec4f,velocitySpread:vec4f,color:vec4f,shape:vec4f,physics:vec4f,emissionExtent:vec4f,control:vec4u}\n@group(0) @binding(0) var<uniform> f:Frame;\n";
|
|
6
|
+
/** Statement the obstacle and wrap features insert their per-particle work before. */
|
|
7
|
+
export declare const settle = "particles[at]=p.positionLife;";
|