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
package/src/graph/compile.ts
CHANGED
|
@@ -355,7 +355,7 @@ export function compileGraph(graph: ShaderGraph, opts: CompileOptions = {}): Com
|
|
|
355
355
|
// Lit is the SURFACE only when it is the graph's output: then it shades the
|
|
356
356
|
// lamps' diffuse by its own albedo, as URP does. Mixed in as a layer (a
|
|
357
357
|
// toon look's gloss), the lamps stay the epilogue's, on the whole material.
|
|
358
|
-
if (node.type === "lit" && node.id !== out.node) return spec(node).emit!(raw).replace(
|
|
358
|
+
if (node.type === "lit" && node.id !== out.node) return spec(node).emit!(raw).replace(/input\.worldPos, true\)/, "input.worldPos, false)")
|
|
359
359
|
return spec(node).emit!(raw)
|
|
360
360
|
}
|
|
361
361
|
|
package/src/graph/registry.ts
CHANGED
|
@@ -392,6 +392,15 @@ export const NODE_REGISTRY: Record<string, NodeSpec> = {
|
|
|
392
392
|
outputs: { value: "float" },
|
|
393
393
|
contextOutputs: { value: "material.shininess" },
|
|
394
394
|
},
|
|
395
|
+
// The PMX ambient colour, live: a host rewrites it per frame with
|
|
396
|
+
// setMaterialUniforms({ ambient }), so a graph that multiplies by it has a
|
|
397
|
+
// per-material dial on the clock (a game stage's scene tint, which its show
|
|
398
|
+
// moves with the music).
|
|
399
|
+
material_ambient: {
|
|
400
|
+
inputs: {},
|
|
401
|
+
outputs: { color: "color" },
|
|
402
|
+
contextOutputs: { color: "material.ambient" },
|
|
403
|
+
},
|
|
395
404
|
|
|
396
405
|
material_diffuse: {
|
|
397
406
|
inputs: {},
|
|
@@ -738,12 +747,20 @@ export const NODE_REGISTRY: Record<string, NodeSpec> = {
|
|
|
738
747
|
* (Schlick), as Blender's Principled; 0 is URP's fixed reflectance. */
|
|
739
748
|
fresnel: F(0),
|
|
740
749
|
normal: { type: "vector", contextDefault: "n" },
|
|
750
|
+
/** Its whole result scaled — lamps, reflections and glow alike, as a game
|
|
751
|
+
* stage's last multiply (SimSceneTint) scales it. Inside the node rather
|
|
752
|
+
* than after it, because Lit is the SURFACE only as the graph's output
|
|
753
|
+
* (it then shades the lamps itself; see compile.ts emitExpr). */
|
|
754
|
+
tint: C([1, 1, 1]),
|
|
741
755
|
},
|
|
742
756
|
outputs: { color: "color", alpha: "float" },
|
|
743
757
|
outputSelect: { color: ".rgb", alpha: ".a" },
|
|
744
|
-
emit: (a) =>
|
|
745
|
-
|
|
746
|
-
|
|
758
|
+
emit: (a) => {
|
|
759
|
+
const call =
|
|
760
|
+
`urp_lit(${a.base_color}, ${a.metallic}, ${a.smoothness}, ${a.specular}, ${a.occlusion}, ${a.emission}, ${a.alpha}, ${a.fresnel}, ` +
|
|
761
|
+
`${a.normal}, l, v, sun, amb, shadow, input.worldPos, true)`
|
|
762
|
+
return a.tint === "vec3f(1.0)" ? call : `(${call} * vec4f(${a.tint}, 1.0))`
|
|
763
|
+
},
|
|
747
764
|
takesLight: true,
|
|
748
765
|
},
|
|
749
766
|
|