reze-engine 0.18.1 → 0.19.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.
Files changed (46) hide show
  1. package/dist/engine.d.ts +45 -28
  2. package/dist/engine.d.ts.map +1 -1
  3. package/dist/engine.js +339 -144
  4. package/dist/graph/compile.d.ts +6 -0
  5. package/dist/graph/compile.d.ts.map +1 -1
  6. package/dist/graph/compile.js +1 -1
  7. package/dist/graph/presets/body.js +1 -1
  8. package/dist/graph/presets/cloth_rough.js +1 -1
  9. package/dist/graph/presets/cloth_smooth.js +1 -1
  10. package/dist/graph/presets/default.js +1 -1
  11. package/dist/graph/presets/eye.js +1 -1
  12. package/dist/graph/presets/face.js +1 -1
  13. package/dist/graph/presets/hair.js +1 -1
  14. package/dist/graph/presets/metal.js +1 -1
  15. package/dist/graph/presets/stockings.js +1 -1
  16. package/dist/graph/render-class.d.ts +16 -0
  17. package/dist/graph/render-class.d.ts.map +1 -0
  18. package/dist/graph/render-class.js +15 -0
  19. package/dist/graph/schema.d.ts +4 -5
  20. package/dist/graph/schema.d.ts.map +1 -1
  21. package/dist/graph/slots.d.ts +7 -12
  22. package/dist/graph/slots.d.ts.map +1 -1
  23. package/dist/graph/slots.js +68 -100
  24. package/dist/graph/style-group.d.ts +38 -0
  25. package/dist/graph/style-group.d.ts.map +1 -0
  26. package/dist/graph/style-group.js +6 -0
  27. package/dist/index.d.ts +3 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1 -0
  30. package/package.json +1 -1
  31. package/src/engine.ts +395 -156
  32. package/src/graph/compile.ts +7 -1
  33. package/src/graph/presets/body.ts +1 -1
  34. package/src/graph/presets/cloth_rough.ts +1 -1
  35. package/src/graph/presets/cloth_smooth.ts +1 -1
  36. package/src/graph/presets/default.ts +1 -1
  37. package/src/graph/presets/eye.ts +1 -1
  38. package/src/graph/presets/face.ts +1 -1
  39. package/src/graph/presets/hair.ts +1 -1
  40. package/src/graph/presets/metal.ts +1 -1
  41. package/src/graph/presets/stockings.ts +1 -1
  42. package/src/graph/render-class.ts +33 -0
  43. package/src/graph/schema.ts +4 -6
  44. package/src/graph/slots.ts +76 -113
  45. package/src/graph/style-group.ts +39 -0
  46. package/src/index.ts +7 -1
@@ -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;AAK5F,MAAM,MAAM,cAAc,GAAG;IAC3B;8EAC0E;IAC1E,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;6DACyD;IACzD,WAAW,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/C,CAAA;AAED,yFAAyF;AACzF,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,GAAG,OAAO,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,GAA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OAAO,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;IACjC,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,OAAO,CAAA;IACX,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,WAAW,EAAE,MAAM,EAAE,CAAA;CACtB,CAAA;AAcD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,SAAS,EAAE,CAuBpE;AAID,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,GAAE,cAAmB,GAAG,UAAU,EAAE,CAqGxF;AAID,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,GAAE,cAAmB,GAAG,aAAa,CA6JxF"}
@@ -294,6 +294,6 @@ 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(graph.slot, fsBody, usesStyle.current);
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
  }
@@ -5,7 +5,7 @@
5
5
  export const BODY_GRAPH = {
6
6
  version: 1,
7
7
  name: "Body",
8
- slot: "body",
8
+ tags: ["body"],
9
9
  nodes: [
10
10
  { id: "tex", type: "texture" },
11
11
  { id: "geo", type: "geometry" },
@@ -5,7 +5,7 @@
5
5
  export const CLOTH_ROUGH_GRAPH = {
6
6
  version: 1,
7
7
  name: "Rough Cloth",
8
- slot: "cloth_rough",
8
+ tags: ["cloth_rough"],
9
9
  nodes: [
10
10
  { id: "tex", type: "texture" },
11
11
  { id: "geo", type: "geometry" },
@@ -5,7 +5,7 @@
5
5
  export const CLOTH_SMOOTH_GRAPH = {
6
6
  version: 1,
7
7
  name: "Smooth Cloth",
8
- slot: "cloth_smooth",
8
+ tags: ["cloth_smooth"],
9
9
  nodes: [
10
10
  { id: "tex", type: "texture" },
11
11
  { id: "geo", type: "geometry" },
@@ -6,7 +6,7 @@
6
6
  export const DEFAULT_GRAPH = {
7
7
  version: 1,
8
8
  name: "Principled BSDF",
9
- slot: "default",
9
+ tags: ["default"],
10
10
  nodes: [
11
11
  { id: "tex", type: "texture" },
12
12
  {
@@ -9,7 +9,7 @@
9
9
  export const EYE_GRAPH = {
10
10
  version: 1,
11
11
  name: "Eye",
12
- slot: "eye",
12
+ tags: ["eye"],
13
13
  nodes: [
14
14
  { id: "tex", type: "texture" },
15
15
  {
@@ -8,7 +8,7 @@
8
8
  export const FACE_GRAPH = {
9
9
  version: 1,
10
10
  name: "Face",
11
- slot: "face",
11
+ tags: ["face"],
12
12
  nodes: [
13
13
  { id: "tex", type: "texture" },
14
14
  { id: "geo", type: "geometry" },
@@ -12,7 +12,7 @@
12
12
  export const HAIR_GRAPH = {
13
13
  version: 1,
14
14
  name: "Hair",
15
- slot: "hair",
15
+ tags: ["hair"],
16
16
  nodes: [
17
17
  { id: "tex", type: "texture" },
18
18
  { id: "geo", type: "geometry" },
@@ -6,7 +6,7 @@
6
6
  export const METAL_GRAPH = {
7
7
  version: 1,
8
8
  name: "Metal",
9
- slot: "metal",
9
+ tags: ["metal"],
10
10
  nodes: [
11
11
  { id: "tex", type: "texture" },
12
12
  { id: "geo", type: "geometry" },
@@ -8,7 +8,7 @@
8
8
  export const STOCKINGS_GRAPH = {
9
9
  version: 1,
10
10
  name: "Stockings",
11
- slot: "stockings",
11
+ tags: ["stockings"],
12
12
  nodes: [
13
13
  { id: "tex", type: "texture" },
14
14
  { id: "geo", type: "geometry" },
@@ -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
+ ];
@@ -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,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE/C,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,MA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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"}
@@ -1,14 +1,9 @@
1
- import type { MaterialPreset } from "../engine";
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
- export declare function assembleModule(slot: MaterialPreset, fsBody: string, includeStyleUniforms: boolean): string;
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":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE/C,MAAM,MAAM,YAAY,GAAG;IACzB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAA;IACb,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAgHD,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,YAAY,CAAC,CAIxE,CAAA;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,YAAY,CAE/D;AAID,eAAO,MAAM,mBAAmB,gHAG/B,CAAA;AAqBD,wBAAgB,cAAc,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,GAAG,MAAM,CAa1G"}
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"}
@@ -1,37 +1,20 @@
1
- // Per-slot WGSL templates. The graph computes only `final_color`; everything the slot
2
- // owns — texture sample, MMD alpha semantics, discard, lighting context, FSOut/mask
3
- // writes, and built-in pass effects like hair's over-eyes stencil variant — lives here,
4
- // always on, graph-invisible. Mirrors the hand-written material shaders line-for-line.
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
- const DEFAULT_EPILOGUE = ` var out: FSOut;
8
- out.color = vec4f(final_color, alpha);
9
- out.mask = vec4f(1.0, 1.0, 0.0, out.color.a);
10
- return out;
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
- var out: FSOut;
24
- out.color = vec4f(final_color, outAlpha);
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
- prelude: `@fragment fn fs(input: VertexOutput) -> FSOut {
61
- let tex_s = textureSample(diffuseTexture, diffuseSampler, input.uv);
62
- // Hashed alpha test (EEVEE "Hashed" blend) instead of the standard threshold.
63
- let alpha = material.alpha * tex_s.a;
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
- let l = -light.lights[0].direction.xyz;
104
- let sun = light.lights[0].color.xyz * light.lights[0].color.w;
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
- // fs() prelude — identical to the hand-written materials so template locals keep the
127
- // exact names the registry's context nodes and emit functions reference.
128
- const FS_PRELUDE = `@fragment fn fs(input: VertexOutput) -> FSOut {
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 (hair/lace textures cut
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
- if (alpha < 0.001) { discard; }
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
- export function assembleModule(slot, fsBody, includeStyleUniforms) {
145
- const tmpl = slotTemplate(slot);
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
- tmpl.decls +
150
- (tmpl.prelude ?? FS_PRELUDE) +
117
+ decls(renderClass, alphaMode) +
118
+ prelude(renderClass, alphaMode) +
151
119
  fsBody +
152
120
  "\n" +
153
- tmpl.epilogue +
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 ApplyStyleResult, type GizmoDragEvent, type GizmoDragCallback, type GizmoDragKind, } from "./engine";
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";
@@ -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,gBAAgB,EACrB,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,E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IAAI,EAAE,MAAM,QAAQ,CAAA;AACzC,YAAY,EACV,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ export { Engine, DEFAULT_BLOOM_OPTIONS, DEFAULT_VIEW_TRANSFORM, } from "./engine
2
2
  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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reze-engine",
3
- "version": "0.18.1",
3
+ "version": "0.19.0",
4
4
  "description": "A lightweight WebGPU engine for real-time 3D MMD/PMX model rendering",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",