reze-engine 0.69.7 → 0.69.9
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/_dbg-loader.mjs +1100 -0
- package/dist/engine.d.ts +36 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +81 -3
- package/dist/graph/compile.js +1 -1
- package/dist/graph/registry.d.ts.map +1 -1
- package/dist/graph/registry.js +19 -2
- package/dist/graph/slots.js +117 -117
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +7 -4
- package/dist/shaders/materials/common.d.ts +11 -1
- package/dist/shaders/materials/common.d.ts.map +1 -1
- package/dist/shaders/materials/common.js +571 -548
- package/dist/shaders/passes/particles.d.ts.map +1 -1
- package/dist/shaders/passes/particles.js +13 -2
- package/dist/shaders/passes/shadow.d.ts +1 -1
- package/dist/shaders/passes/shadow.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/engine.ts +21337 -21249
- package/src/graph/compile.ts +1 -1
- package/src/graph/registry.ts +20 -3
- package/src/graph/slots.ts +304 -304
- package/src/index.ts +1 -0
- package/src/model.ts +7 -4
- package/src/shaders/materials/common.ts +706 -682
- package/src/shaders/passes/particles.ts +14 -2
|
@@ -209,6 +209,13 @@ fn rzProject(p: vec3f) -> vec3f {
|
|
|
209
209
|
fn rzCamPos() -> vec3f { return cam.camPos; }
|
|
210
210
|
`
|
|
211
211
|
|
|
212
|
+
/** `fn particleStep(p, dt, id: u32)`: the step is told the particle's slot, as
|
|
213
|
+
* particleInit is, so it can read the slot's emitter. Two parameters is the
|
|
214
|
+
* usual step and is called as before. */
|
|
215
|
+
function stepTakesId(wgsl: string): boolean {
|
|
216
|
+
return /\bfn\s+particleStep\s*\([^)]*,[^)]*,[^)]*\)/.test(wgsl)
|
|
217
|
+
}
|
|
218
|
+
|
|
212
219
|
/** Does the source define the particle contract? All three are required
|
|
213
220
|
* together; `cover` is optional and only means anything to a cutout, and
|
|
214
221
|
* `count` is optional and bounds the frame's work — see particleCount. */
|
|
@@ -302,7 +309,7 @@ fn main(@builtin(global_invocation_id) gid: vec3u) {
|
|
|
302
309
|
// its life staggers the pool, which is the difference between snow and a
|
|
303
310
|
// pulse of snow arriving all at once every few seconds.
|
|
304
311
|
} else {
|
|
305
|
-
p = particleStep(p, pu.dt);
|
|
312
|
+
p = particleStep(p, pu.dt${stepTakesId(src.wgsl) ? ", i" : ""});
|
|
306
313
|
p.age = p.age + pu.dt;
|
|
307
314
|
}
|
|
308
315
|
particles[i] = p;
|
|
@@ -376,7 +383,12 @@ struct VSOut {
|
|
|
376
383
|
fn vs(@builtin(vertex_index) vi: u32, @builtin(instance_index) ii: u32) -> VSOut {
|
|
377
384
|
var out: VSOut;
|
|
378
385
|
out.id = ii;
|
|
379
|
-
|
|
386
|
+
${/\bfn\s+particleWorld\s*\(/.test(src.wgsl) ? ` // the effect keeps the pool in its emitters' own frames (Unity's Local
|
|
387
|
+
// simulation space: a beam riding a moving head); particleWorld puts this
|
|
388
|
+
// one in the world as its emitter stands now, before the card is built
|
|
389
|
+
let p = particleWorld(particles[ii], ii);
|
|
390
|
+
` : ` let p = particles[ii];
|
|
391
|
+
`}
|
|
380
392
|
// Two triangles, corners in the order 0,1,2, 2,1,3.
|
|
381
393
|
let quad = array<vec2f, 6>(
|
|
382
394
|
vec2f(-1.0, -1.0), vec2f(1.0, -1.0), vec2f(-1.0, 1.0),
|