reze-engine 0.18.1 → 0.20.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/README.md +291 -252
- package/dist/engine.d.ts +45 -41
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +401 -421
- package/dist/graph/compile.d.ts +6 -0
- package/dist/graph/compile.d.ts.map +1 -1
- package/dist/graph/compile.js +1 -1
- package/dist/graph/presets/body.js +1 -1
- package/dist/graph/presets/cloth_rough.js +1 -1
- package/dist/graph/presets/cloth_smooth.js +1 -1
- package/dist/graph/presets/default.d.ts.map +1 -1
- package/dist/graph/presets/default.js +14 -7
- package/dist/graph/presets/eye.js +1 -1
- package/dist/graph/presets/face.js +1 -1
- package/dist/graph/presets/hair.js +1 -1
- package/dist/graph/presets/metal.js +1 -1
- package/dist/graph/presets/stockings.js +1 -1
- package/dist/graph/registry.d.ts.map +1 -1
- package/dist/graph/registry.js +8 -0
- package/dist/graph/render-class.d.ts +16 -0
- package/dist/graph/render-class.d.ts.map +1 -0
- package/dist/graph/render-class.js +15 -0
- package/dist/graph/schema.d.ts +4 -5
- package/dist/graph/schema.d.ts.map +1 -1
- package/dist/graph/slots.d.ts +7 -12
- package/dist/graph/slots.d.ts.map +1 -1
- package/dist/graph/slots.js +68 -100
- package/dist/graph/style-group.d.ts +38 -0
- package/dist/graph/style-group.d.ts.map +1 -0
- package/dist/graph/style-group.js +6 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/tga-loader.d.ts +7 -0
- package/dist/tga-loader.d.ts.map +1 -0
- package/dist/tga-loader.js +154 -0
- package/package.json +2 -2
- package/src/engine.ts +4488 -4479
- package/src/graph/compile.ts +7 -1
- package/src/graph/presets/body.ts +1 -1
- package/src/graph/presets/cloth_rough.ts +1 -1
- package/src/graph/presets/cloth_smooth.ts +1 -1
- package/src/graph/presets/default.ts +14 -7
- package/src/graph/presets/eye.ts +1 -1
- package/src/graph/presets/face.ts +1 -1
- package/src/graph/presets/hair.ts +1 -1
- package/src/graph/presets/metal.ts +1 -1
- package/src/graph/presets/stockings.ts +1 -1
- package/src/graph/registry.ts +8 -0
- package/src/graph/render-class.ts +33 -0
- package/src/graph/schema.ts +4 -6
- package/src/graph/slots.ts +76 -113
- package/src/graph/style-group.ts +39 -0
- package/src/index.ts +7 -1
- package/src/tga-loader.ts +154 -0
package/dist/graph/compile.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Diagnostic, ExposedParam, StyleGraph } from "./schema";
|
|
2
|
+
import type { AlphaMode, RenderClass } from "./render-class";
|
|
2
3
|
export type CompileOptions = {
|
|
3
4
|
/** Fold exposed params to their defaults as consts (no StyleUniforms binding).
|
|
4
5
|
* Used by golden tests and by hosts that don't bind the style buffer. */
|
|
@@ -9,6 +10,11 @@ export type CompileOptions = {
|
|
|
9
10
|
node: string;
|
|
10
11
|
socket: string;
|
|
11
12
|
};
|
|
13
|
+
/** Pass-integration class the fs() shell is assembled for (stencil/cull/gate). The
|
|
14
|
+
* graph is pure shading; the group supplies this. Default "auto". */
|
|
15
|
+
renderClass?: RenderClass;
|
|
16
|
+
/** Alpha-handling axis, orthogonal to renderClass. Default "opaque". */
|
|
17
|
+
alphaMode?: AlphaMode;
|
|
12
18
|
};
|
|
13
19
|
/** UBO slot for one exposed param: write `value` at style.p[vec4Index] (+ component). */
|
|
14
20
|
export type StyleSlot = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/graph/compile.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAA0B,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/graph/compile.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAA0B,UAAU,EAA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@@ export function compileGraph(graph, opts = {}) {
|
|
|
294
294
|
}
|
|
295
295
|
lines.push(` let final_color = ${outputExpr(out, "color")}; // @node:${out.node}`);
|
|
296
296
|
const fsBody = lines.join("\n");
|
|
297
|
-
const wgsl = assembleModule(
|
|
297
|
+
const wgsl = assembleModule(opts.renderClass ?? "auto", opts.alphaMode ?? "opaque", fsBody, usesStyle.current);
|
|
298
298
|
return { ok: true, wgsl, fsBody, slotMap, diagnostics, prunedNodes };
|
|
299
299
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/default.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/default.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,eAAO,MAAM,aAAa,EAAE,UAoB3B,CAAA"}
|
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
// Default material
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Default material — the neutral base used two ways: the ungrouped fallback (a material
|
|
2
|
+
// in no style group renders this) and the blank-canvas starter the editor's "New graph"
|
|
3
|
+
// begins from, so the two always agree. MMD-correct PBSDF base: diffuse texture × the
|
|
4
|
+
// PMX material diffuse color → Principled BSDF (Metallic 0, Specular 0.5, Roughness 0.5).
|
|
5
|
+
// The material-color multiply is what keeps untextured/solid-color materials from
|
|
6
|
+
// rendering white (they carry their color in material.diffuse, not a texture).
|
|
6
7
|
export const DEFAULT_GRAPH = {
|
|
7
8
|
version: 1,
|
|
8
9
|
name: "Principled BSDF",
|
|
9
|
-
|
|
10
|
+
tags: ["default"],
|
|
10
11
|
nodes: [
|
|
11
12
|
{ id: "tex", type: "texture" },
|
|
13
|
+
{ id: "mat", type: "material_diffuse" },
|
|
14
|
+
{ id: "base", type: "mix/multiply", inputs: { fac: 1.0 } }, // texture × material diffuse
|
|
12
15
|
{
|
|
13
16
|
id: "principled",
|
|
14
17
|
type: "principled",
|
|
15
18
|
inputs: { metallic: 0.0, specular: 0.5, roughness: 0.5, spec_clamp: 10.0, sheen: 0.0, sheen_tint: 0.0 },
|
|
16
19
|
},
|
|
17
20
|
],
|
|
18
|
-
links: [
|
|
21
|
+
links: [
|
|
22
|
+
{ from: { node: "tex", socket: "color" }, to: { node: "base", socket: "a" } },
|
|
23
|
+
{ from: { node: "mat", socket: "color" }, to: { node: "base", socket: "b" } },
|
|
24
|
+
{ from: { node: "base", socket: "color" }, to: { node: "principled", socket: "base" } },
|
|
25
|
+
],
|
|
19
26
|
output: { node: "principled", socket: "color" },
|
|
20
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/graph/registry.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3C,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEzD,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,KAAK,CAAA;IACX,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,4FAA4F;IAC5F,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,yFAAyF;IACzF,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC9B,2FAA2F;IAC3F,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAA;IAC/C,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EA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AI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,MAAM,CAAA;IAC/C,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvC,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACtC,CAAA;AAMD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAI1C;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,GAAG,MAAM,CAgBhE;AAED,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAIpE;AAMD,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,OAAO,CAM1D;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKpE;AA6BD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAuPlD,CAAA"}
|
package/dist/graph/registry.js
CHANGED
|
@@ -118,6 +118,14 @@ export const NODE_REGISTRY = {
|
|
|
118
118
|
reflection: "reflect(-v, n)",
|
|
119
119
|
},
|
|
120
120
|
},
|
|
121
|
+
// PMX material's diffuse color (the authored base tint). Multiply the diffuse texture
|
|
122
|
+
// by this for the MMD-correct base — untextured materials carry their color here, so a
|
|
123
|
+
// texture-only base would render them white.
|
|
124
|
+
material_diffuse: {
|
|
125
|
+
inputs: {},
|
|
126
|
+
outputs: { color: "color" },
|
|
127
|
+
contextOutputs: { color: "material.diffuseColor" },
|
|
128
|
+
},
|
|
121
129
|
// ── Literals as nodes (for editor ergonomics; inlined literals work too) ──
|
|
122
130
|
value: { inputs: { value: F(0) }, outputs: { value: "float" }, emit: (a) => a.value },
|
|
123
131
|
rgb: { inputs: { color: C() }, outputs: { color: "color" }, emit: (a) => a.color },
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Pass-integration class. Selects stencil/cull/draw-order behavior. */
|
|
2
|
+
export type RenderClass = "auto" | "eye" | "hair";
|
|
3
|
+
/** Alpha-handling axis, orthogonal to RenderClass. "hashed" = Wyman & McGuire object-space
|
|
4
|
+
* hashed alpha test (stockings); "opaque" = the standard near-zero threshold discard. */
|
|
5
|
+
export type AlphaMode = "opaque" | "hashed";
|
|
6
|
+
/** Descriptive manifest for hosts (reze-design) so the render-class picker is data-driven
|
|
7
|
+
* instead of hardcoding strings. The effect implementations stay engine-side; this only
|
|
8
|
+
* describes them. `pairsWith` = the effect needs a counterpart class present to show. */
|
|
9
|
+
export type RenderClassInfo = {
|
|
10
|
+
id: RenderClass;
|
|
11
|
+
label: string;
|
|
12
|
+
description: string;
|
|
13
|
+
pairsWith?: RenderClass;
|
|
14
|
+
};
|
|
15
|
+
export declare const RENDER_CLASSES: readonly RenderClassInfo[];
|
|
16
|
+
//# sourceMappingURL=render-class.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-class.d.ts","sourceRoot":"","sources":["../../src/graph/render-class.ts"],"names":[],"mappings":"AAMA,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAA;AAEjD;0FAC0F;AAC1F,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE3C;;0FAE0F;AAC1F,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,WAAW,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,WAAW,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,eAAe,EASpD,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Render-class + alpha-mode: the small, closed, engine-owned vocabularies that carry
|
|
2
|
+
// pass integration for a style group. A group's node graph is pure shading; these select
|
|
3
|
+
// how the engine wires that shading into the passes. Not user-extensible — this is where
|
|
4
|
+
// rendering correctness lives (stencil, cull, draw order, alpha test). See
|
|
5
|
+
// docs/style-groups-spec.md §5.
|
|
6
|
+
export const RENDER_CLASSES = [
|
|
7
|
+
{ id: "auto", label: "Standard", description: "Opaque or transparent, derived from material alpha." },
|
|
8
|
+
{ id: "eye", label: "Eye", description: "Stamps the see-through stencil; visible through hair.", pairsWith: "hair" },
|
|
9
|
+
{
|
|
10
|
+
id: "hair",
|
|
11
|
+
label: "Hair",
|
|
12
|
+
description: "Reads the eye stencil so eyes show through the silhouette.",
|
|
13
|
+
pairsWith: "eye",
|
|
14
|
+
},
|
|
15
|
+
];
|
package/dist/graph/schema.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { MaterialPreset } from "../engine";
|
|
2
1
|
export type SocketValue = number | [number, number, number] | [number, number, number, number];
|
|
3
2
|
export type GraphNode = {
|
|
4
3
|
/** Unique within the graph, /^[a-z0-9_]+$/ — becomes the WGSL variable suffix. */
|
|
@@ -43,10 +42,6 @@ export type ExposedParam = {
|
|
|
43
42
|
export type StyleGraph = {
|
|
44
43
|
version: 1;
|
|
45
44
|
name: string;
|
|
46
|
-
/** Which preset slot this style targets. The slot owns pass integration (stencil
|
|
47
|
-
* variants like hair-over-eyes, alpha semantics, draw order) — always on,
|
|
48
|
-
* graph-invisible. The graph only restyles the slot's shading. */
|
|
49
|
-
slot: MaterialPreset;
|
|
50
45
|
nodes: GraphNode[];
|
|
51
46
|
links: GraphLink[];
|
|
52
47
|
/** Must resolve to a color (vec3f) or float (auto-splatted) socket. */
|
|
@@ -55,6 +50,10 @@ export type StyleGraph = {
|
|
|
55
50
|
socket: string;
|
|
56
51
|
};
|
|
57
52
|
params?: ExposedParam[];
|
|
53
|
+
/** Soft, host-only hints for library filtering and smart default-group / render-class
|
|
54
|
+
* matching (e.g. ["hair"]). Ignored by the compiler; round-tripped. A graph is pure
|
|
55
|
+
* shading — pass integration lives on the style group's renderClass, not here. */
|
|
56
|
+
tags?: string[];
|
|
58
57
|
};
|
|
59
58
|
export type Diagnostic = {
|
|
60
59
|
severity: "error" | "warning";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/graph/schema.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/graph/schema.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAE9F,MAAM,MAAM,SAAS,GAAG;IACtB,kFAAkF;IAClF,EAAE,EAAE,MAAM,CAAA;IACV,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAA;IACZ,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACpC;mFAC+E;IAC/E,EAAE,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAC7C,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IACtC,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CACrC,CAAA;AAED,0FAA0F;AAC1F,MAAM,MAAM,YAAY,GAAG;IACzB,+DAA+D;IAC/D,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;IACvB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,WAAW,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,CAAC,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,uEAAuE;IACvE,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAA;IACvB;;uFAEmF;IACnF,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,SAAS,KAAK,CAAA;AAC3B,eAAO,MAAM,UAAU,KAAK,CAAA"}
|
package/dist/graph/slots.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type SlotTemplate = {
|
|
3
|
-
/** Module-scope declarations (pipeline-override constants, helper fns). */
|
|
4
|
-
decls: string;
|
|
5
|
-
/** Optional replacement for the standard fs() prelude (custom alpha semantics). */
|
|
6
|
-
prelude?: string;
|
|
7
|
-
/** Tail of fs(): consumes `final_color` + template locals, writes FSOut. */
|
|
8
|
-
epilogue: string;
|
|
9
|
-
};
|
|
10
|
-
export declare const SLOT_TEMPLATES: Partial<Record<MaterialPreset, SlotTemplate>>;
|
|
11
|
-
export declare function slotTemplate(slot: MaterialPreset): SlotTemplate;
|
|
1
|
+
import type { AlphaMode, RenderClass } from "./render-class";
|
|
12
2
|
export declare const STYLE_UNIFORMS_WGSL = "struct StyleUniforms { p: array<vec4f, 16> };\n@group(2) @binding(4) var<uniform> style: StyleUniforms;\n\n";
|
|
13
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Assemble a full WGSL module: shared node library + bindings/skinning prelude, optional
|
|
5
|
+
* StyleUniforms, render-class/alpha-mode declarations, the composed fs() shell, and the
|
|
6
|
+
* graph's node body.
|
|
7
|
+
*/
|
|
8
|
+
export declare function assembleModule(renderClass: RenderClass, alphaMode: AlphaMode, fsBody: string, includeStyleUniforms: boolean): string;
|
|
14
9
|
//# sourceMappingURL=slots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../src/graph/slots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slots.d.ts","sourceRoot":"","sources":["../../src/graph/slots.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAiD5D,eAAO,MAAM,mBAAmB,gHAG/B,CAAA;AAuDD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,OAAO,GAC5B,MAAM,CAYR"}
|
package/dist/graph/slots.js
CHANGED
|
@@ -1,37 +1,20 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
1
|
+
// fs() shell assembly. The graph computes only `final_color`; everything around it —
|
|
2
|
+
// texture sample, alpha discard, lighting context, built-in gates, and the FSOut/mask
|
|
3
|
+
// write — is composed here from two orthogonal, engine-owned axes:
|
|
4
|
+
// RenderClass ("auto" | "eye" | "hair") — stencil/cull/draw-order + eye rear-gate +
|
|
5
|
+
// hair over-eyes alpha. See render-class.ts.
|
|
6
|
+
// AlphaMode ("opaque" | "hashed") — standard threshold discard vs Wyman hashed.
|
|
7
|
+
// A style group supplies both; this file turns them into the WGSL shell around fsBody.
|
|
8
|
+
// See docs/style-groups-spec.md §5, §7.
|
|
5
9
|
import { NODES_WGSL } from "../shaders/materials/nodes";
|
|
6
10
|
import { COMMON_MATERIAL_PRELUDE_WGSL } from "../shaders/materials/common";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`;
|
|
12
|
-
const DEFAULT_TEMPLATE = { decls: "", epilogue: DEFAULT_EPILOGUE };
|
|
13
|
-
// Hair's built-in over-eyes effect (see hair.ts): the engine compiles two pipeline
|
|
14
|
-
// variants from the same module — normal opaque hair, and a stencil-matched re-draw
|
|
15
|
-
// at 25% alpha so eyes read through the silhouette. Always on for the hair slot.
|
|
16
|
-
const HAIR_TEMPLATE = {
|
|
17
|
-
decls: `override IS_OVER_EYES: bool = false;
|
|
18
|
-
|
|
19
|
-
`,
|
|
20
|
-
epilogue: ` var outAlpha = alpha;
|
|
21
|
-
if (IS_OVER_EYES) { outAlpha = alpha * 0.25; }
|
|
11
|
+
// ── Module-scope declarations ──
|
|
12
|
+
// hair: the over-eyes pipeline-override constant (a second pipeline is compiled with
|
|
13
|
+
// IS_OVER_EYES=1). hashed: the Wyman & McGuire object-space hashed-alpha helpers.
|
|
14
|
+
const HAIR_OVER_EYES_DECL = `override IS_OVER_EYES: bool = false;
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
out.mask = vec4f(1.0, 1.0, 0.0, out.color.a);
|
|
26
|
-
return out;
|
|
27
|
-
`,
|
|
28
|
-
};
|
|
29
|
-
// Stockings' built-in alpha behavior (see stockings.ts): Wyman & McGuire hashed
|
|
30
|
-
// alpha testing on bind-pose restPos replaces the standard threshold discard —
|
|
31
|
-
// sort-independent through self-overlap, dither pinned to the fabric. The graph
|
|
32
|
-
// only computes final_color; the hash gate and the alpha=1 output are slot-owned.
|
|
33
|
-
const STOCKINGS_TEMPLATE = {
|
|
34
|
-
decls: `fn _hash3d_wm(a: vec3f) -> f32 {
|
|
16
|
+
`;
|
|
17
|
+
const HASHED_ALPHA_DECLS = `fn _hash3d_wm(a: vec3f) -> f32 {
|
|
35
18
|
return _hash33(a).x * 0.5 + 0.5;
|
|
36
19
|
}
|
|
37
20
|
fn hashed_alpha_threshold(co: vec3f) -> f32 {
|
|
@@ -56,84 +39,43 @@ fn hashed_alpha_threshold(co: vec3f) -> f32 {
|
|
|
56
39
|
return clamp(threshold, 1e-6, 1.0);
|
|
57
40
|
}
|
|
58
41
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (alpha < hashed_alpha_threshold(input.restPos)) { discard; }
|
|
65
|
-
|
|
66
|
-
let n = safe_normal(input.normal);
|
|
67
|
-
let v = normalize(camera.viewPos - input.worldPos);
|
|
68
|
-
let l = -light.lights[0].direction.xyz;
|
|
69
|
-
let sun = light.lights[0].color.xyz * light.lights[0].color.w;
|
|
70
|
-
let amb = light.ambientColor.xyz;
|
|
71
|
-
let shadow = sampleShadow(input.worldPos, n);
|
|
72
|
-
let tex_color = tex_s.rgb;
|
|
73
|
-
|
|
74
|
-
`,
|
|
75
|
-
epilogue: ` var out: FSOut;
|
|
76
|
-
out.color = vec4f(final_color, 1.0);
|
|
77
|
-
out.mask = vec4f(1.0, 1.0, 0.0, out.color.a);
|
|
78
|
-
return out;
|
|
79
|
-
`,
|
|
80
|
-
};
|
|
81
|
-
// Eye's built-in rear-view gate (see eye.ts): open-shell PMX heads don't occlude
|
|
82
|
-
// the eye from behind, so it would draw (and stamp the see-through stencil) through
|
|
83
|
-
// the back of the head. Gate by camera-vs-face hemisphere via the 頭 bone's skinning
|
|
84
|
-
// matrix. Discarding here drops color, depth, and the stencil stamp together. The
|
|
85
|
-
// stencil-stamp pipeline state + front-face cull are slot-owned in createSlotPipeline;
|
|
86
|
-
// the graph only computes the eye's shading (Principled + emission).
|
|
87
|
-
const EYE_TEMPLATE = {
|
|
88
|
-
decls: "",
|
|
89
|
-
prelude: `@fragment fn fs(input: VertexOutput) -> FSOut {
|
|
90
|
-
let tex_s = textureSample(diffuseTexture, diffuseSampler, input.uv);
|
|
91
|
-
let alpha = material.alpha * tex_s.a;
|
|
92
|
-
if (alpha < 0.001) { discard; }
|
|
93
|
-
|
|
94
|
-
let n = safe_normal(input.normal);
|
|
95
|
-
let v = normalize(camera.viewPos - input.worldPos);
|
|
96
|
-
|
|
42
|
+
`;
|
|
43
|
+
// Eye's built-in rear-view gate (open-shell PMX heads don't occlude the eye from behind,
|
|
44
|
+
// so gate by camera-vs-face hemisphere via the 頭 bone; discard drops color + depth +
|
|
45
|
+
// the stencil stamp together). Injected between the view vectors and the lighting setup.
|
|
46
|
+
const EYE_REAR_GATE = `
|
|
97
47
|
if (material.headBoneIndex >= 0.0) {
|
|
98
48
|
let hm = skinMats[u32(material.headBoneIndex)];
|
|
99
49
|
let faceDir = -normalize(hm[2].xyz);
|
|
100
50
|
if (dot(faceDir, v) < -0.15) { discard; }
|
|
101
51
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
let amb = light.ambientColor.xyz;
|
|
106
|
-
let shadow = sampleShadow(input.worldPos, n);
|
|
107
|
-
let tex_color = tex_s.rgb;
|
|
108
|
-
|
|
109
|
-
`,
|
|
110
|
-
epilogue: DEFAULT_EPILOGUE,
|
|
111
|
-
};
|
|
112
|
-
export const SLOT_TEMPLATES = {
|
|
113
|
-
hair: HAIR_TEMPLATE,
|
|
114
|
-
stockings: STOCKINGS_TEMPLATE,
|
|
115
|
-
eye: EYE_TEMPLATE,
|
|
116
|
-
};
|
|
117
|
-
export function slotTemplate(slot) {
|
|
118
|
-
return SLOT_TEMPLATES[slot] ?? DEFAULT_TEMPLATE;
|
|
119
|
-
}
|
|
120
|
-
// Adjust-tier uniforms — fixed 16-vec4f block (256 B) so the single shared material
|
|
121
|
-
// bind group layout serves every graph; non-graph presets bind a zero buffer.
|
|
52
|
+
`;
|
|
53
|
+
// ── Adjust-tier uniforms — fixed 16-vec4f block (256 B) shared by the single material
|
|
54
|
+
// bind group layout; non-graph draws bind a zero buffer. ──
|
|
122
55
|
export const STYLE_UNIFORMS_WGSL = `struct StyleUniforms { p: array<vec4f, 16> };
|
|
123
56
|
@group(2) @binding(4) var<uniform> style: StyleUniforms;
|
|
124
57
|
|
|
125
58
|
`;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
59
|
+
function decls(renderClass, alphaMode) {
|
|
60
|
+
return (alphaMode === "hashed" ? HASHED_ALPHA_DECLS : "") + (renderClass === "hair" ? HAIR_OVER_EYES_DECL : "");
|
|
61
|
+
}
|
|
62
|
+
// fs() header up to and including the graph body's context locals. Composed so the
|
|
63
|
+
// hand-written material shaders' local names (tex_color, n, v, l, sun, amb, shadow) are
|
|
64
|
+
// preserved exactly — the registry's context nodes and emit functions reference them.
|
|
65
|
+
function prelude(renderClass, alphaMode) {
|
|
66
|
+
const discard = alphaMode === "hashed"
|
|
67
|
+
? " if (alpha < hashed_alpha_threshold(input.restPos)) { discard; }"
|
|
68
|
+
: " if (alpha < 0.001) { discard; }";
|
|
69
|
+
const gate = renderClass === "eye" ? EYE_REAR_GATE : "";
|
|
70
|
+
return `@fragment fn fs(input: VertexOutput) -> FSOut {
|
|
129
71
|
let tex_s = textureSample(diffuseTexture, diffuseSampler, input.uv);
|
|
130
|
-
// MMD alpha semantics: material alpha × texture alpha
|
|
131
|
-
// their shapes in the alpha channel).
|
|
72
|
+
// MMD alpha semantics: material alpha × texture alpha.
|
|
132
73
|
let alpha = material.alpha * tex_s.a;
|
|
133
|
-
|
|
74
|
+
${discard}
|
|
134
75
|
|
|
135
76
|
let n = safe_normal(input.normal);
|
|
136
77
|
let v = normalize(camera.viewPos - input.worldPos);
|
|
78
|
+
${gate}
|
|
137
79
|
let l = -light.lights[0].direction.xyz;
|
|
138
80
|
let sun = light.lights[0].color.xyz * light.lights[0].color.w;
|
|
139
81
|
let amb = light.ambientColor.xyz;
|
|
@@ -141,15 +83,41 @@ const FS_PRELUDE = `@fragment fn fs(input: VertexOutput) -> FSOut {
|
|
|
141
83
|
let tex_color = tex_s.rgb;
|
|
142
84
|
|
|
143
85
|
`;
|
|
144
|
-
|
|
145
|
-
|
|
86
|
+
}
|
|
87
|
+
// Tail of fs(): consumes `final_color` + locals, writes FSOut. hashed forces output
|
|
88
|
+
// alpha to 1 (the discard already did the cutout); hair scales alpha for the over-eyes
|
|
89
|
+
// pass when IS_OVER_EYES is compiled true.
|
|
90
|
+
function epilogue(renderClass, alphaMode) {
|
|
91
|
+
const alphaBase = alphaMode === "hashed" ? "1.0" : "alpha";
|
|
92
|
+
if (renderClass === "hair") {
|
|
93
|
+
return ` var outAlpha = ${alphaBase};
|
|
94
|
+
if (IS_OVER_EYES) { outAlpha = ${alphaBase} * 0.25; }
|
|
95
|
+
|
|
96
|
+
var out: FSOut;
|
|
97
|
+
out.color = vec4f(final_color, outAlpha);
|
|
98
|
+
out.mask = vec4f(1.0, 1.0, 0.0, out.color.a);
|
|
99
|
+
return out;
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
return ` var out: FSOut;
|
|
103
|
+
out.color = vec4f(final_color, ${alphaBase});
|
|
104
|
+
out.mask = vec4f(1.0, 1.0, 0.0, out.color.a);
|
|
105
|
+
return out;
|
|
106
|
+
`;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Assemble a full WGSL module: shared node library + bindings/skinning prelude, optional
|
|
110
|
+
* StyleUniforms, render-class/alpha-mode declarations, the composed fs() shell, and the
|
|
111
|
+
* graph's node body.
|
|
112
|
+
*/
|
|
113
|
+
export function assembleModule(renderClass, alphaMode, fsBody, includeStyleUniforms) {
|
|
146
114
|
return (NODES_WGSL +
|
|
147
115
|
COMMON_MATERIAL_PRELUDE_WGSL +
|
|
148
116
|
(includeStyleUniforms ? STYLE_UNIFORMS_WGSL : "") +
|
|
149
|
-
|
|
150
|
-
(
|
|
117
|
+
decls(renderClass, alphaMode) +
|
|
118
|
+
prelude(renderClass, alphaMode) +
|
|
151
119
|
fsBody +
|
|
152
120
|
"\n" +
|
|
153
|
-
|
|
121
|
+
epilogue(renderClass, alphaMode) +
|
|
154
122
|
"}\n");
|
|
155
123
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Diagnostic, StyleGraph } from "./schema";
|
|
2
|
+
import type { AlphaMode, RenderClass } from "./render-class";
|
|
3
|
+
import type { StyleSlot } from "./compile";
|
|
4
|
+
export type StyleGroup = {
|
|
5
|
+
/** Stable, unique within a model; /^[a-z0-9_-]+$/. The engine keys installs by this. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Human display name ("Skirt", "Visor"); host-owned, round-tripped, never interpreted
|
|
8
|
+
* by the engine. Defaults to `id`. */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Material names in this group; each material is in AT MOST one group. */
|
|
11
|
+
materials: string[];
|
|
12
|
+
/** Pure shading (StyleGraph has no `slot` — integration lives here on the group). */
|
|
13
|
+
graph: StyleGraph;
|
|
14
|
+
/** Pass-integration class: stencil/cull/draw-order. Default "auto". */
|
|
15
|
+
renderClass?: RenderClass;
|
|
16
|
+
/** Alpha-handling axis, orthogonal to renderClass. Default "opaque". */
|
|
17
|
+
alphaMode?: AlphaMode;
|
|
18
|
+
};
|
|
19
|
+
export type GroupDiagnostic = {
|
|
20
|
+
groupId: string;
|
|
21
|
+
diagnostics: Diagnostic[];
|
|
22
|
+
ok: boolean;
|
|
23
|
+
};
|
|
24
|
+
export type ApplyStyleGroupsResult = {
|
|
25
|
+
/** Every group compiled + swapped. */
|
|
26
|
+
ok: boolean;
|
|
27
|
+
groups: GroupDiagnostic[];
|
|
28
|
+
/** Names in a group that no model material matches (warning). */
|
|
29
|
+
unknownMaterials: string[];
|
|
30
|
+
/** Materials claimed by >1 group; the last group in array order wins (logged). */
|
|
31
|
+
conflicts: string[];
|
|
32
|
+
};
|
|
33
|
+
export type ApplyStyleGroupResult = {
|
|
34
|
+
ok: boolean;
|
|
35
|
+
diagnostics: Diagnostic[];
|
|
36
|
+
slotMap: StyleSlot[];
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=style-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-group.d.ts","sourceRoot":"","sources":["../../src/graph/style-group.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAE1C,MAAM,MAAM,UAAU,GAAG;IACvB,wFAAwF;IACxF,EAAE,EAAE,MAAM,CAAA;IACV;2CACuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2EAA2E;IAC3E,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,qFAAqF;IACrF,KAAK,EAAE,UAAU,CAAA;IACjB,uEAAuE;IACvE,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,wEAAwE;IACxE,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAC;IAAC,EAAE,EAAE,OAAO,CAAA;CAAE,CAAA;AAEzF,MAAM,MAAM,sBAAsB,GAAG;IACnC,sCAAsC;IACtC,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,iEAAiE;IACjE,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,kFAAkF;IAClF,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAC;IAAC,OAAO,EAAE,SAAS,EAAE,CAAA;CAAE,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Style groups — the user-facing unit of material styling. A group binds a set of
|
|
2
|
+
// materials to a node graph (pure shading) plus the engine-owned pass-integration axes
|
|
3
|
+
// (renderClass + alphaMode). Each material belongs to at most one group; grouped
|
|
4
|
+
// materials render via the group's compiled-graph pipeline, ungrouped ones fall back to
|
|
5
|
+
// the hand-written preset path. See docs/style-groups-spec.md.
|
|
6
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export { Engine, DEFAULT_BLOOM_OPTIONS, DEFAULT_VIEW_TRANSFORM, type EngineStats, type EngineOptions, type BloomOptions, type ViewTransformOptions, type LoadModelFromFilesOptions, type MaterialPreset, type ResolvedMaterialPreset, type MaterialPresetMap, type
|
|
1
|
+
export { Engine, DEFAULT_BLOOM_OPTIONS, DEFAULT_VIEW_TRANSFORM, type EngineStats, type EngineOptions, type BloomOptions, type ViewTransformOptions, type LoadModelFromFilesOptions, type MaterialPreset, type ResolvedMaterialPreset, type MaterialPresetMap, type GizmoDragEvent, type GizmoDragCallback, type GizmoDragKind, } from "./engine";
|
|
2
2
|
export { parsePmxFolderInput, pmxFileAtRelativePath, type PmxFolderInputResult } from "./folder-upload";
|
|
3
3
|
export { compileGraph, validateGraph, assignStyleSlots, type CompileOptions, type CompileResult, type StyleSlot, } from "./graph/compile";
|
|
4
4
|
export type { StyleGraph, GraphNode, GraphLink, ExposedParam, SocketValue, Diagnostic, } from "./graph/schema";
|
|
5
5
|
export { NODE_REGISTRY, type NodeSpec, type SockT } from "./graph/registry";
|
|
6
|
+
export { RENDER_CLASSES, type RenderClass, type AlphaMode, type RenderClassInfo } from "./graph/render-class";
|
|
7
|
+
export type { StyleGroup, GroupDiagnostic, ApplyStyleGroupsResult, ApplyStyleGroupResult, } from "./graph/style-group";
|
|
6
8
|
export { HAIR_GRAPH } from "./graph/presets/hair";
|
|
7
9
|
export { DEFAULT_GRAPH } from "./graph/presets/default";
|
|
8
10
|
export { CLOTH_SMOOTH_GRAPH } from "./graph/presets/cloth_smooth";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACvG,OAAO,EACL,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,YAAY,EACZ,WAAW,EACX,UAAU,G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
|
export { parsePmxFolderInput, pmxFileAtRelativePath } from "./folder-upload";
|
|
3
3
|
export { compileGraph, validateGraph, assignStyleSlots, } from "./graph/compile";
|
|
4
4
|
export { NODE_REGISTRY } from "./graph/registry";
|
|
5
|
+
export { RENDER_CLASSES } from "./graph/render-class";
|
|
5
6
|
export { HAIR_GRAPH } from "./graph/presets/hair";
|
|
6
7
|
export { DEFAULT_GRAPH } from "./graph/presets/default";
|
|
7
8
|
export { CLOTH_SMOOTH_GRAPH } from "./graph/presets/cloth_smooth";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tga-loader.d.ts","sourceRoot":"","sources":["../src/tga-loader.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAA;AAY9E,wBAAgB,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAoH3D"}
|