reze-engine 0.65.0 → 0.66.1

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 (151) hide show
  1. package/dist/engine.d.ts +156 -42
  2. package/dist/engine.d.ts.map +1 -1
  3. package/dist/engine.js +876 -186
  4. package/dist/graph/compile.d.ts.map +1 -1
  5. package/dist/graph/compile.js +5 -0
  6. package/dist/graph/presets/body.d.ts.map +1 -1
  7. package/dist/graph/presets/body.js +26 -24
  8. package/dist/graph/presets/cloth_rough.js +8 -8
  9. package/dist/graph/presets/cloth_smooth.js +8 -8
  10. package/dist/graph/presets/default.js +4 -4
  11. package/dist/graph/presets/eye.js +10 -10
  12. package/dist/graph/presets/face.d.ts.map +1 -1
  13. package/dist/graph/presets/face.js +28 -26
  14. package/dist/graph/presets/hair.js +6 -6
  15. package/dist/graph/presets/metal.js +8 -8
  16. package/dist/graph/presets/stockings.d.ts.map +1 -1
  17. package/dist/graph/presets/stockings.js +4 -11
  18. package/dist/graph/presets/unlit.d.ts.map +1 -1
  19. package/dist/graph/presets/unlit.js +9 -13
  20. package/dist/graph/registry.d.ts.map +1 -1
  21. package/dist/graph/registry.js +128 -157
  22. package/dist/graph/render-class.d.ts +5 -2
  23. package/dist/graph/render-class.d.ts.map +1 -1
  24. package/dist/graph/slots.d.ts.map +1 -1
  25. package/dist/graph/slots.js +5 -1
  26. package/dist/model.d.ts +14 -1
  27. package/dist/model.d.ts.map +1 -1
  28. package/dist/model.js +27 -1
  29. package/dist/pmx-loader.d.ts +4 -0
  30. package/dist/pmx-loader.d.ts.map +1 -1
  31. package/dist/pmx-loader.js +11 -2
  32. package/dist/shaders/anchor-table.d.ts +11 -0
  33. package/dist/shaders/anchor-table.d.ts.map +1 -1
  34. package/dist/shaders/anchor-table.js +9 -3
  35. package/dist/shaders/directives.d.ts +42 -5
  36. package/dist/shaders/directives.d.ts.map +1 -1
  37. package/dist/shaders/directives.js +51 -4
  38. package/dist/shaders/lights.d.ts +11 -7
  39. package/dist/shaders/lights.d.ts.map +1 -1
  40. package/dist/shaders/lights.js +315 -271
  41. package/dist/shaders/materials/common.d.ts.map +1 -1
  42. package/dist/shaders/materials/common.js +26 -3
  43. package/dist/shaders/materials/nodes.d.ts +1 -1
  44. package/dist/shaders/materials/nodes.d.ts.map +1 -1
  45. package/dist/shaders/materials/nodes.js +191 -271
  46. package/dist/shaders/passes/composite.d.ts +1 -1
  47. package/dist/shaders/passes/composite.d.ts.map +1 -1
  48. package/dist/shaders/passes/composite.js +3 -5
  49. package/dist/shaders/passes/ground.js +1 -1
  50. package/dist/shaders/passes/particles.d.ts.map +1 -1
  51. package/dist/shaders/passes/particles.js +9 -3
  52. package/dist/shaders/passes/probe.d.ts +45 -0
  53. package/dist/shaders/passes/probe.d.ts.map +1 -0
  54. package/dist/shaders/passes/probe.js +230 -0
  55. package/dist/shaders/passes/scene-contract.d.ts +13 -0
  56. package/dist/shaders/passes/scene-contract.d.ts.map +1 -1
  57. package/dist/shaders/passes/scene-contract.js +4 -0
  58. package/dist/shaders/scene-light-api.d.ts.map +1 -1
  59. package/dist/shaders/scene-light-api.js +1 -0
  60. package/dist/unity/globals.d.ts +7 -0
  61. package/dist/unity/globals.d.ts.map +1 -1
  62. package/dist/unity/globals.js +4 -3
  63. package/dist/unity/host.d.ts +3 -0
  64. package/dist/unity/host.d.ts.map +1 -1
  65. package/dist/unity/host.js +41 -7
  66. package/dist/unity/looks.d.ts +42 -0
  67. package/dist/unity/looks.d.ts.map +1 -1
  68. package/dist/unity/looks.js +131 -4
  69. package/dist/unity/stage.d.ts +17 -0
  70. package/dist/unity/stage.d.ts.map +1 -1
  71. package/dist/unity/stage.js +22 -5
  72. package/package.json +1 -1
  73. package/src/engine.ts +949 -215
  74. package/src/graph/compile.ts +4 -0
  75. package/src/graph/presets/body.ts +26 -24
  76. package/src/graph/presets/cloth_rough.ts +8 -8
  77. package/src/graph/presets/cloth_smooth.ts +8 -8
  78. package/src/graph/presets/default.ts +4 -4
  79. package/src/graph/presets/eye.ts +10 -10
  80. package/src/graph/presets/face.ts +28 -26
  81. package/src/graph/presets/hair.ts +6 -6
  82. package/src/graph/presets/metal.ts +8 -8
  83. package/src/graph/presets/stockings.ts +4 -11
  84. package/src/graph/presets/unlit.ts +9 -13
  85. package/src/graph/registry.ts +133 -158
  86. package/src/graph/render-class.ts +5 -2
  87. package/src/graph/slots.ts +5 -1
  88. package/src/model.ts +33 -1
  89. package/src/pmx-loader.ts +11 -2
  90. package/src/shaders/anchor-table.ts +15 -3
  91. package/src/shaders/directives.ts +88 -6
  92. package/src/shaders/lights.ts +464 -415
  93. package/src/shaders/materials/common.ts +26 -3
  94. package/src/shaders/materials/nodes.ts +191 -271
  95. package/src/shaders/passes/composite.ts +3 -5
  96. package/src/shaders/passes/ground.ts +1 -1
  97. package/src/shaders/passes/particles.ts +9 -3
  98. package/src/shaders/passes/probe.ts +240 -0
  99. package/src/shaders/passes/scene-contract.ts +17 -0
  100. package/src/shaders/scene-light-api.ts +1 -0
  101. package/src/unity/globals.ts +7 -3
  102. package/src/unity/host.ts +36 -6
  103. package/src/unity/looks.ts +161 -7
  104. package/src/unity/stage.ts +28 -5
  105. package/dist/physics-debug.d.ts +0 -30
  106. package/dist/physics-debug.d.ts.map +0 -1
  107. package/dist/physics-debug.js +0 -526
  108. package/dist/shaders/agx-lut.d.ts +0 -11
  109. package/dist/shaders/agx-lut.d.ts.map +0 -1
  110. package/dist/shaders/agx-lut.js +0 -29
  111. package/dist/shaders/dfg_lut.d.ts +0 -3
  112. package/dist/shaders/dfg_lut.d.ts.map +0 -1
  113. package/dist/shaders/dfg_lut.js +0 -129
  114. package/dist/shaders/ltc_mag_lut.d.ts +0 -3
  115. package/dist/shaders/ltc_mag_lut.d.ts.map +0 -1
  116. package/dist/shaders/ltc_mag_lut.js +0 -1033
  117. package/dist/shaders/materials/body.d.ts +0 -2
  118. package/dist/shaders/materials/body.d.ts.map +0 -1
  119. package/dist/shaders/materials/body.js +0 -95
  120. package/dist/shaders/materials/cloth_rough.d.ts +0 -2
  121. package/dist/shaders/materials/cloth_rough.d.ts.map +0 -1
  122. package/dist/shaders/materials/cloth_rough.js +0 -69
  123. package/dist/shaders/materials/cloth_smooth.d.ts +0 -2
  124. package/dist/shaders/materials/cloth_smooth.d.ts.map +0 -1
  125. package/dist/shaders/materials/cloth_smooth.js +0 -61
  126. package/dist/shaders/materials/default.d.ts +0 -2
  127. package/dist/shaders/materials/default.d.ts.map +0 -1
  128. package/dist/shaders/materials/default.js +0 -43
  129. package/dist/shaders/materials/eye.d.ts +0 -2
  130. package/dist/shaders/materials/eye.d.ts.map +0 -1
  131. package/dist/shaders/materials/eye.js +0 -60
  132. package/dist/shaders/materials/face.d.ts +0 -2
  133. package/dist/shaders/materials/face.d.ts.map +0 -1
  134. package/dist/shaders/materials/face.js +0 -95
  135. package/dist/shaders/materials/hair.d.ts +0 -2
  136. package/dist/shaders/materials/hair.d.ts.map +0 -1
  137. package/dist/shaders/materials/hair.js +0 -90
  138. package/dist/shaders/materials/metal.d.ts +0 -2
  139. package/dist/shaders/materials/metal.d.ts.map +0 -1
  140. package/dist/shaders/materials/metal.js +0 -77
  141. package/dist/shaders/materials/mmd_classic.d.ts +0 -2
  142. package/dist/shaders/materials/mmd_classic.d.ts.map +0 -1
  143. package/dist/shaders/materials/mmd_classic.js +0 -66
  144. package/dist/shaders/materials/stockings.d.ts +0 -2
  145. package/dist/shaders/materials/stockings.d.ts.map +0 -1
  146. package/dist/shaders/materials/stockings.js +0 -122
  147. package/dist/shaders/passes/physics-debug.d.ts +0 -2
  148. package/dist/shaders/passes/physics-debug.d.ts.map +0 -1
  149. package/dist/shaders/passes/physics-debug.js +0 -69
  150. package/src/shaders/dfg_lut.ts +0 -131
  151. package/src/shaders/ltc_mag_lut.ts +0 -1035
@@ -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,WAAW,EAAE,MAAM,UAAU,CAAA;AAI7F,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAExE,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;IAC9C;0EACsE;IACtE,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,wEAAwE;IACxE,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,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,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,WAAW,EAAE,IAAI,GAAE,cAAmB,GAAG,UAAU,EAAE,CA4GzF;AAID,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,GAAE,cAAmB,GAAG,aAAa,CAwKzF"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/graph/compile.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAA0B,WAAW,EAAE,MAAM,UAAU,CAAA;AAI7F,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAExE,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;IAC9C;0EACsE;IACtE,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,wEAAwE;IACxE,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,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,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,WAAW,EAAE,IAAI,GAAE,cAAmB,GAAG,UAAU,EAAE,CA4GzF;AAID,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,GAAE,cAAmB,GAAG,aAAa,CA4KzF"}
@@ -291,6 +291,11 @@ export function compileGraph(graph, opts = {}) {
291
291
  args.roughness.literal === 0.5 &&
292
292
  args.distortion.literal === 0)
293
293
  return `tex_noise_d2(${raw.vector}, ${raw.scale})`;
294
+ // Lit is the SURFACE only when it is the graph's output: then it shades the
295
+ // lamps' diffuse by its own albedo, as URP does. Mixed in as a layer (a
296
+ // toon look's gloss), the lamps stay the epilogue's, on the whole material.
297
+ if (node.type === "lit" && node.id !== out.node)
298
+ return spec(node).emit(raw).replace(/, true\)$/, ", false)");
294
299
  return spec(node).emit(raw);
295
300
  };
296
301
  const lines = [];
@@ -1 +1 @@
1
- {"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/body.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,UAAU,EAAE,WAuGxB,CAAA"}
1
+ {"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/body.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,UAAU,EAAE,WAyGxB,CAAA"}
@@ -1,5 +1,5 @@
1
1
  // M_Body as a ShaderGraph — port of shaders/materials/body.ts (仿深空之眼 "M_Body").
2
- // Toon + warm rim + rim1/rim2 stack mixed 50/50 against a Principled BSDF with
2
+ // Toon + warm rim + rim1/rim2 stack mixed 50/50 against a Lit layer with
3
3
  // noise-bumped normal. The hand port's local ramp_ease is ramp_cardinal (identical
4
4
  // smoothstep form); the Mapping node's zero loc/rot folds to a scale multiply.
5
5
  export const BODY_GRAPH = {
@@ -15,13 +15,13 @@ export const BODY_GRAPH = {
15
15
  { id: "mat_diffuse", type: "material_diffuse" },
16
16
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
17
17
  { id: "geo", type: "geometry" },
18
- { id: "str", type: "shader_to_rgb_diffuse" },
18
+ { id: "str", type: "lambert" },
19
19
  { id: "toon", type: "ramp_cardinal", inputs: { pos0: 0.2466, pos1: 0.3466 } },
20
20
  { id: "shadow_tint", type: "hue_sat", inputs: { hue: 0.5, saturation: 2.0, value: 0.3499999940395355, fac: 1.0 } },
21
21
  { id: "lit_tint", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.5, value: 1.0, fac: 1.0 } },
22
22
  { id: "toon_color", type: "mix/blend" },
23
23
  { id: "bc", type: "bright_contrast", inputs: { bright: 0.1, contrast: 0.2 } },
24
- { id: "emission3", type: "emission", inputs: { strength: 4.0 } },
24
+ { id: "emission3", type: "vector_math/scale", inputs: { scale: 4.0 } },
25
25
  { id: "warm_add", type: "math/add", inputs: { b: 0.5 } },
26
26
  { id: "warm_clamp", type: "math/clamp01" },
27
27
  {
@@ -34,17 +34,18 @@ export const BODY_GRAPH = {
34
34
  color1: [0.6677, 0.5024, 0.5126, 1.0],
35
35
  },
36
36
  },
37
- { id: "warm_emit", type: "emission", inputs: { strength: 0.30000001192092896 } },
37
+ { id: "warm_emit", type: "vector_math/scale", inputs: { scale: 0.30000001192092896 } },
38
38
  { id: "rim1_fres", type: "fresnel", inputs: { ior: 2.0 } },
39
39
  { id: "rim1_lw", type: "layer_weight/facing", inputs: { blend: 0.24000005424022675 } },
40
40
  { id: "rim1_str", type: "math/multiply" },
41
- { id: "rim1", type: "emission", inputs: { color: [0.984157919883728, 0.6110184788703918, 0.5736401677131653] } },
41
+ { id: "rim1", type: "vector_math/scale" },
42
+ { id: "rim1_color", type: "rgb", inputs: { color: [0.984157919883728, 0.6110184788703918, 0.5736401677131653] } },
42
43
  { id: "rim2_lw", type: "layer_weight/facing", inputs: { blend: 0.20000000298023224 } },
43
44
  { id: "rim2_pow", type: "math/power", inputs: { b: 1.4300000667572021 } },
44
45
  { id: "rim2_ramp", type: "ramp_cardinal", inputs: { pos0: 0.0, pos1: 0.5052 } },
45
- { id: "rim2_mix", type: "mix_shader", inputs: { b: [1.0, 0.4303792119026184, 0.3315804898738861] } },
46
- { id: "npr_add1", type: "add_shader" },
47
- { id: "npr_stack", type: "add_shader" },
46
+ { id: "rim2_mix", type: "mix/blend", inputs: { b: [1.0, 0.4303792119026184, 0.3315804898738861] } },
47
+ { id: "npr_add1", type: "vector_math/add" },
48
+ { id: "npr_stack", type: "vector_math/add" },
48
49
  { id: "map", type: "mapping", inputs: { scl: [1.0, 1.0, 1.5] } },
49
50
  { id: "noise", type: "tex_noise", inputs: { scale: 1.0 } },
50
51
  { id: "noise_ramp", type: "ramp_linear", inputs: { pos0: 0.0, pos1: 1.0 } },
@@ -54,14 +55,14 @@ export const BODY_GRAPH = {
54
55
  type: "mix/blend",
55
56
  inputs: { b: [0.6831911206245422, 0.19474034011363983, 0.13732507824897766] },
56
57
  },
57
- { id: "p_emit", type: "emission", inputs: { strength: 0.2 } },
58
+ { id: "p_emit", type: "vector_math/scale", inputs: { scale: 0.2 } },
58
59
  {
59
60
  id: "principled",
60
- type: "principled",
61
- inputs: { metallic: 0.0, specular_ior_level: 0.5, roughness: 0.3, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
61
+ type: "lit",
62
+ inputs: { metallic: 0.0, smoothness: 0.4523 },
62
63
  },
63
- { id: "p_sum", type: "add_shader" },
64
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.5 } },
64
+ { id: "p_sum", type: "vector_math/add" },
65
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.5 } },
65
66
  ],
66
67
  links: [
67
68
  { from: { node: "str", socket: "value" }, to: { node: "toon", socket: "fac" } },
@@ -73,22 +74,23 @@ export const BODY_GRAPH = {
73
74
  { from: { node: "shadow_tint", socket: "color" }, to: { node: "toon_color", socket: "a" } },
74
75
  { from: { node: "lit_tint", socket: "color" }, to: { node: "toon_color", socket: "b" } },
75
76
  { from: { node: "toon_color", socket: "color" }, to: { node: "bc", socket: "color" } },
76
- { from: { node: "bc", socket: "color" }, to: { node: "emission3", socket: "color" } },
77
+ { from: { node: "bc", socket: "color" }, to: { node: "emission3", socket: "a" } },
77
78
  { from: { node: "toon", socket: "fac_out" }, to: { node: "warm_add", socket: "a" } },
78
79
  { from: { node: "warm_add", socket: "value" }, to: { node: "warm_clamp", socket: "a" } },
79
80
  { from: { node: "warm_clamp", socket: "value" }, to: { node: "warm_ramp", socket: "fac" } },
80
- { from: { node: "warm_ramp", socket: "color" }, to: { node: "warm_emit", socket: "color" } },
81
+ { from: { node: "warm_ramp", socket: "color" }, to: { node: "warm_emit", socket: "a" } },
81
82
  { from: { node: "rim1_fres", socket: "value" }, to: { node: "rim1_str", socket: "a" } },
82
83
  { from: { node: "rim1_lw", socket: "value" }, to: { node: "rim1_str", socket: "b" } },
83
- { from: { node: "rim1_str", socket: "value" }, to: { node: "rim1", socket: "strength" } },
84
+ { from: { node: "rim1_str", socket: "value" }, to: { node: "rim1", socket: "scale" } },
84
85
  { from: { node: "rim2_lw", socket: "value" }, to: { node: "rim2_pow", socket: "a" } },
85
86
  { from: { node: "rim2_pow", socket: "value" }, to: { node: "rim2_ramp", socket: "fac" } },
86
- { from: { node: "emission3", socket: "color" }, to: { node: "rim2_mix", socket: "a" } },
87
+ { from: { node: "emission3", socket: "vector" }, to: { node: "rim2_mix", socket: "a" } },
87
88
  { from: { node: "rim2_ramp", socket: "fac_out" }, to: { node: "rim2_mix", socket: "fac" } },
88
- { from: { node: "rim1", socket: "color" }, to: { node: "npr_add1", socket: "a" } },
89
+ { from: { node: "rim1_color", socket: "color" }, to: { node: "rim1", socket: "a" } },
90
+ { from: { node: "rim1", socket: "vector" }, to: { node: "npr_add1", socket: "a" } },
89
91
  { from: { node: "rim2_mix", socket: "color" }, to: { node: "npr_add1", socket: "b" } },
90
- { from: { node: "npr_add1", socket: "color" }, to: { node: "npr_stack", socket: "a" } },
91
- { from: { node: "warm_emit", socket: "color" }, to: { node: "npr_stack", socket: "b" } },
92
+ { from: { node: "npr_add1", socket: "vector" }, to: { node: "npr_stack", socket: "a" } },
93
+ { from: { node: "warm_emit", socket: "vector" }, to: { node: "npr_stack", socket: "b" } },
92
94
  { from: { node: "geo", socket: "rest_pos" }, to: { node: "map", socket: "vector" } },
93
95
  { from: { node: "map", socket: "vector" }, to: { node: "noise", socket: "vector" } },
94
96
  { from: { node: "noise", socket: "value" }, to: { node: "noise_ramp", socket: "fac" } },
@@ -96,13 +98,13 @@ export const BODY_GRAPH = {
96
98
  { from: { node: "geo", socket: "normal" }, to: { node: "bump", socket: "normal" } },
97
99
  { from: { node: "noise_ramp", socket: "fac_out" }, to: { node: "principled_base", socket: "fac" } },
98
100
  { from: { node: "bc", socket: "color" }, to: { node: "principled_base", socket: "a" } },
99
- { from: { node: "bc", socket: "color" }, to: { node: "p_emit", socket: "color" } },
101
+ { from: { node: "bc", socket: "color" }, to: { node: "p_emit", socket: "a" } },
100
102
  { from: { node: "principled_base", socket: "color" }, to: { node: "principled", socket: "base_color" } },
101
103
  { from: { node: "bump", socket: "vector" }, to: { node: "principled", socket: "normal" } },
102
104
  { from: { node: "principled", socket: "color" }, to: { node: "p_sum", socket: "a" } },
103
- { from: { node: "p_emit", socket: "color" }, to: { node: "p_sum", socket: "b" } },
104
- { from: { node: "npr_stack", socket: "color" }, to: { node: "mix_shader_001", socket: "a" } },
105
- { from: { node: "p_sum", socket: "color" }, to: { node: "mix_shader_001", socket: "b" } },
105
+ { from: { node: "p_emit", socket: "vector" }, to: { node: "p_sum", socket: "b" } },
106
+ { from: { node: "npr_stack", socket: "vector" }, to: { node: "mix_shader_001", socket: "a" } },
107
+ { from: { node: "p_sum", socket: "vector" }, to: { node: "mix_shader_001", socket: "b" } },
106
108
  ],
107
109
  output: { node: "mix_shader_001", socket: "color" },
108
110
  };
@@ -1,6 +1,6 @@
1
1
  // M_Rough_Cloth as a ShaderGraph — port of shaders/materials/cloth_rough.ts.
2
2
  // NPR graph identical to M_Smooth_Cloth, but the noise bump subtree IS live on
3
- // Principled.Normal (weave bump in rest space), and it is MATTE where smooth cloth
3
+ // the Lit layer's normal (weave bump in rest space), and it is MATTE where smooth cloth
4
4
  // shines: roughness 1, specular 0.25, and a wider toon band (0.20-0.45) so the
5
5
  // light rolls off cotton instead of cutting. Smooth keeps 0.5 / 0.8 / 0.25-0.35.
6
6
  // The tex_noise node hits the detail=2 peephole → tex_noise_d2.
@@ -17,7 +17,7 @@ export const CLOTH_ROUGH_GRAPH = {
17
17
  { id: "mat_diffuse", type: "material_diffuse" },
18
18
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
19
19
  { id: "geo", type: "geometry" },
20
- { id: "str", type: "shader_to_rgb_diffuse" },
20
+ { id: "str", type: "lambert" },
21
21
  { id: "ramp_008", type: "ramp_cardinal", inputs: { pos0: 0.2, pos1: 0.45 } },
22
22
  { id: "mix04_fac", type: "math/multiply", inputs: { b: 0.5 } },
23
23
  { id: "dark_tex", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.19999998807907104, fac: 1.0 } },
@@ -27,17 +27,17 @@ export const CLOTH_ROUGH_GRAPH = {
27
27
  { id: "mix_003", type: "mix/blend" },
28
28
  { id: "hue_004", type: "hue_sat", inputs: { hue: 0.5, saturation: 0.800000011920929, value: 2.0, fac: 1.0 } },
29
29
  { id: "npr_overlay", type: "mix/overlay", inputs: { fac: 1.0 } },
30
- { id: "npr_emit", type: "emission", inputs: { strength: 18.200000762939453 } },
30
+ { id: "npr_emit", type: "vector_math/scale", inputs: { scale: 18.200000762939453 } },
31
31
  { id: "noise", type: "tex_noise", inputs: { scale: 17.7 } },
32
32
  { id: "noise_ramp", type: "ramp_linear", inputs: { pos0: 0.0, pos1: 1.0 } },
33
33
  { id: "bump", type: "bump", inputs: { strength: 1.0 } },
34
34
  { id: "principled_base", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.800000011920929, fac: 1.0 } },
35
35
  {
36
36
  id: "principled",
37
- type: "principled",
38
- inputs: { metallic: 0.0, specular_ior_level: 0.25, roughness: 1.0, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
37
+ type: "lit",
38
+ inputs: { metallic: 0.0, smoothness: 0.0, specular: 0.25 },
39
39
  },
40
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.8999999761581421 } },
40
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.8999999761581421 } },
41
41
  ],
42
42
  links: [
43
43
  { from: { node: "str", socket: "value" }, to: { node: "ramp_008", socket: "fac" } },
@@ -56,7 +56,7 @@ export const CLOTH_ROUGH_GRAPH = {
56
56
  { from: { node: "mix_003", socket: "color" }, to: { node: "hue_004", socket: "color" } },
57
57
  { from: { node: "mix_003", socket: "color" }, to: { node: "npr_overlay", socket: "a" } },
58
58
  { from: { node: "hue_004", socket: "color" }, to: { node: "npr_overlay", socket: "b" } },
59
- { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "color" } },
59
+ { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "a" } },
60
60
  { from: { node: "geo", socket: "rest_pos" }, to: { node: "noise", socket: "vector" } },
61
61
  { from: { node: "noise", socket: "value" }, to: { node: "noise_ramp", socket: "fac" } },
62
62
  { from: { node: "noise_ramp", socket: "fac_out" }, to: { node: "bump", socket: "height" } },
@@ -64,7 +64,7 @@ export const CLOTH_ROUGH_GRAPH = {
64
64
  { from: { node: "tex_base", socket: "color" }, to: { node: "principled_base", socket: "color" } },
65
65
  { from: { node: "principled_base", socket: "color" }, to: { node: "principled", socket: "base_color" } },
66
66
  { from: { node: "bump", socket: "vector" }, to: { node: "principled", socket: "normal" } },
67
- { from: { node: "npr_emit", socket: "color" }, to: { node: "mix_shader_001", socket: "a" } },
67
+ { from: { node: "npr_emit", socket: "vector" }, to: { node: "mix_shader_001", socket: "a" } },
68
68
  { from: { node: "principled", socket: "color" }, to: { node: "mix_shader_001", socket: "b" } },
69
69
  ],
70
70
  output: { node: "mix_shader_001", socket: "color" },
@@ -1,6 +1,6 @@
1
1
  // M_Smooth_Cloth as a ShaderGraph — port of shaders/materials/cloth_smooth.ts.
2
2
  // NPR toon + bevel + overlay-boosted emission (18.2×) mixed 10/90 against a plain
3
- // Principled BSDF. The Blender graph's dead bump subtree is omitted (as in the hand
3
+ // Lit layer. The Blender graph's dead bump subtree is omitted (as in the hand
4
4
  // port). hue_sat nodes with hue=0.5 compile to the hue_sat_id specialization.
5
5
  export const CLOTH_SMOOTH_GRAPH = {
6
6
  version: 1,
@@ -15,7 +15,7 @@ export const CLOTH_SMOOTH_GRAPH = {
15
15
  { id: "mat_diffuse", type: "material_diffuse" },
16
16
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
17
17
  { id: "geo", type: "geometry" },
18
- { id: "str", type: "shader_to_rgb_diffuse" },
18
+ { id: "str", type: "lambert" },
19
19
  { id: "ramp_008", type: "ramp_cardinal", inputs: { pos0: 0.2466, pos1: 0.3466 } },
20
20
  { id: "mix04_fac", type: "math/multiply", inputs: { b: 0.5 } },
21
21
  { id: "dark_tex", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.19999998807907104, fac: 1.0 } },
@@ -25,14 +25,14 @@ export const CLOTH_SMOOTH_GRAPH = {
25
25
  { id: "mix_003", type: "mix/blend" },
26
26
  { id: "hue_004", type: "hue_sat", inputs: { hue: 0.5, saturation: 0.800000011920929, value: 2.0, fac: 1.0 } },
27
27
  { id: "npr_overlay", type: "mix/overlay", inputs: { fac: 1.0 } },
28
- { id: "npr_emit", type: "emission", inputs: { strength: 18.200000762939453 } },
28
+ { id: "npr_emit", type: "vector_math/scale", inputs: { scale: 18.200000762939453 } },
29
29
  { id: "principled_base", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.800000011920929, fac: 1.0 } },
30
30
  {
31
31
  id: "principled",
32
- type: "principled",
33
- inputs: { metallic: 0.0, specular_ior_level: 0.8, roughness: 0.5, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
32
+ type: "lit",
33
+ inputs: { metallic: 0.0, smoothness: 0.2929, specular: 0.8 },
34
34
  },
35
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.8999999761581421 } },
35
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.8999999761581421 } },
36
36
  ],
37
37
  links: [
38
38
  { from: { node: "str", socket: "value" }, to: { node: "ramp_008", socket: "fac" } },
@@ -51,10 +51,10 @@ export const CLOTH_SMOOTH_GRAPH = {
51
51
  { from: { node: "mix_003", socket: "color" }, to: { node: "hue_004", socket: "color" } },
52
52
  { from: { node: "mix_003", socket: "color" }, to: { node: "npr_overlay", socket: "a" } },
53
53
  { from: { node: "hue_004", socket: "color" }, to: { node: "npr_overlay", socket: "b" } },
54
- { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "color" } },
54
+ { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "a" } },
55
55
  { from: { node: "tex_base", socket: "color" }, to: { node: "principled_base", socket: "color" } },
56
56
  { from: { node: "principled_base", socket: "color" }, to: { node: "principled", socket: "base_color" } },
57
- { from: { node: "npr_emit", socket: "color" }, to: { node: "mix_shader_001", socket: "a" } },
57
+ { from: { node: "npr_emit", socket: "vector" }, to: { node: "mix_shader_001", socket: "a" } },
58
58
  { from: { node: "principled", socket: "color" }, to: { node: "mix_shader_001", socket: "b" } },
59
59
  ],
60
60
  output: { node: "mix_shader_001", socket: "color" },
@@ -1,12 +1,12 @@
1
1
  // Default material — the neutral base used two ways: the ungrouped fallback (a material
2
2
  // in no style group renders this) and the blank-canvas starter the editor's "New graph"
3
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).
4
+ // PMX material diffuse color → Lit (metallic 0, smoothness 0.29).
5
5
  // The material-color multiply is what keeps untextured/solid-color materials from
6
6
  // rendering white (they carry their color in material.diffuse, not a texture).
7
7
  export const DEFAULT_GRAPH = {
8
8
  version: 1,
9
- name: "Principled BSDF",
9
+ name: "Lit",
10
10
  tags: ["default"],
11
11
  nodes: [
12
12
  { id: "tex", type: "texture" },
@@ -14,8 +14,8 @@ export const DEFAULT_GRAPH = {
14
14
  { id: "base", type: "mix/multiply", inputs: { fac: 1.0 } }, // texture × material diffuse
15
15
  {
16
16
  id: "principled",
17
- type: "principled",
18
- inputs: { metallic: 0.0, specular_ior_level: 0.5, roughness: 0.5, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
17
+ type: "lit",
18
+ inputs: { metallic: 0.0, smoothness: 0.2929 },
19
19
  },
20
20
  ],
21
21
  links: [
@@ -1,7 +1,7 @@
1
1
  // Eye as a ShaderGraph — port of shaders/materials/eye.ts. The published preset
2
2
  // author's instruction: "keep eyes in the default nodegraph, add emission 1.5".
3
- // So it's the default Principled BSDF plus an Emission of the diffuse texture at
4
- // 1.5× (Blender's Principled Emission socket, decomposed as a separate Emission +
3
+ // So it's the default Lit plus an emission of the diffuse texture at
4
+ // 1.5× (the emission, decomposed as a separate scale +
5
5
  // Add Shader — the emission feeds bloom pre-tonemap).
6
6
  //
7
7
  // The rear-view gate and the see-through stencil stamp are slot-owned (built-in eye
@@ -20,11 +20,11 @@ export const EYE_GRAPH = {
20
20
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
21
21
  {
22
22
  id: "principled",
23
- type: "principled",
24
- inputs: { metallic: 0.0, specular_ior_level: 0.5, roughness: 0.5, spec_clamp: 1e30, sheen_weight: 0.0, sheen_tint: 0.0 },
23
+ type: "lit",
24
+ inputs: { metallic: 0.0, smoothness: 0.2929 },
25
25
  },
26
- { id: "emission", type: "emission", inputs: { strength: 1.5 } },
27
- { id: "add", type: "add_shader" },
26
+ { id: "emission", type: "vector_math/scale", inputs: { scale: 1.5 } },
27
+ { id: "add", type: "vector_math/add" },
28
28
  // The iris glow follows the key round her head: full (1.5) lit from the
29
29
  // front, easing to 0.2 of it lit from behind - a fixed 1.5 left the eyes
30
30
  // bright white in a backlit face. head_basis.forward · L, half-Lambert,
@@ -41,9 +41,9 @@ export const EYE_GRAPH = {
41
41
  { from: { node: "tex", socket: "color" }, to: { node: "tex_base", socket: "a" } },
42
42
  { from: { node: "mat_diffuse", socket: "color" }, to: { node: "tex_base", socket: "b" } },
43
43
  { from: { node: "tex_base", socket: "color" }, to: { node: "principled", socket: "base_color" } },
44
- { from: { node: "tex_base", socket: "color" }, to: { node: "emission", socket: "color" } },
44
+ { from: { node: "tex_base", socket: "color" }, to: { node: "emission", socket: "a" } },
45
45
  { from: { node: "principled", socket: "color" }, to: { node: "add", socket: "a" } },
46
- { from: { node: "emission", socket: "color" }, to: { node: "add", socket: "b" } },
46
+ { from: { node: "emission", socket: "vector" }, to: { node: "add", socket: "b" } },
47
47
  { from: { node: "eye_hb", socket: "forward" }, to: { node: "eye_fl", socket: "a" } },
48
48
  { from: { node: "eye_lt", socket: "direction" }, to: { node: "eye_fl", socket: "b" } },
49
49
  { from: { node: "eye_fl", socket: "value" }, to: { node: "eye_half", socket: "a" } },
@@ -51,7 +51,7 @@ export const EYE_GRAPH = {
51
51
  { from: { node: "eye_lt", socket: "shadow" }, to: { node: "eye_sh", socket: "b" } },
52
52
  { from: { node: "eye_sh", socket: "value" }, to: { node: "eye_lvl", socket: "value" } },
53
53
  { from: { node: "eye_lvl", socket: "value" }, to: { node: "eye_str", socket: "a" } },
54
- { from: { node: "eye_str", socket: "value" }, to: { node: "emission", socket: "strength" } },
54
+ { from: { node: "eye_str", socket: "value" }, to: { node: "emission", socket: "scale" } },
55
55
  ],
56
- output: { node: "add", socket: "color" },
56
+ output: { node: "add", socket: "vector" },
57
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"face.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/face.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,UAAU,EAAE,WAqIxB,CAAA"}
1
+ {"version":3,"file":"face.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/face.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,UAAU,EAAE,WAuIxB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  // M_Face as a ShaderGraph — port of shaders/materials/face.ts (仿深空之眼 "M_Face").
2
2
  // Toon + warm rim + dual fresnel rim + BT.601 bright-tex gate, mixed 50/50 against a
3
- // Principled BSDF with noise bump. Structurally close to body, but: the toon uses the
3
+ // a Lit layer with noise bump. Structurally close to body, but: the toon uses the
4
4
  // edge-AA ramp, hue tints are 0.46 (full hue_sat, not the 0.5 _id specialization),
5
5
  // rim2 is the hair-style fresnel×layer_weight_fresnel rim, and there's an extra
6
6
  // near-white texture gate that emits (freckle/highlight paint). Plain material — no
@@ -19,13 +19,13 @@ export const FACE_GRAPH = {
19
19
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
20
20
  { id: "geo", type: "geometry" },
21
21
  // ── toon shading ──
22
- { id: "str", type: "shader_to_rgb_diffuse" },
22
+ { id: "str", type: "lambert" },
23
23
  { id: "toon", type: "ramp_cardinal", inputs: { pos0: 0.2466, pos1: 0.3466 } },
24
24
  { id: "shadow_tint", type: "hue_sat", inputs: { hue: 0.46000000834465027, saturation: 2.0, value: 0.3499999940395355, fac: 1.0 } },
25
25
  { id: "lit_tint", type: "hue_sat", inputs: { hue: 0.46000000834465027, saturation: 1.600000023841858, value: 1.5, fac: 1.0 } },
26
26
  { id: "toon_color", type: "mix/blend" },
27
27
  { id: "bc", type: "bright_contrast", inputs: { bright: 0.1, contrast: 0.2 } },
28
- { id: "emission3", type: "emission", inputs: { strength: 2.5 } },
28
+ { id: "emission3", type: "vector_math/scale", inputs: { scale: 2.5 } },
29
29
  // ── warm rim (toon*0.5+0.5 → cardinal ramp) ──
30
30
  { id: "warm_mul", type: "math/multiply", inputs: { b: 0.5 } },
31
31
  { id: "warm_add", type: "math/add", inputs: { b: 0.5 } },
@@ -40,39 +40,40 @@ export const FACE_GRAPH = {
40
40
  color1: [0.6677, 0.5024, 0.5126, 1.0],
41
41
  },
42
42
  },
43
- { id: "warm_emit", type: "emission", inputs: { strength: 0.30000001192092896 } },
43
+ { id: "warm_emit", type: "vector_math/scale", inputs: { scale: 0.30000001192092896 } },
44
44
  // ── rim1: fresnel × facing ──
45
45
  { id: "rim1_fres", type: "fresnel", inputs: { ior: 2.0 } },
46
46
  { id: "rim1_lw", type: "layer_weight/facing", inputs: { blend: 0.24 } },
47
47
  { id: "rim1_str", type: "math/multiply" },
48
- { id: "rim1", type: "emission", inputs: { color: [0.984157919883728, 0.6110184788703918, 0.5736401677131653] } },
48
+ { id: "rim1", type: "vector_math/scale" },
49
+ { id: "rim1_color", type: "rgb", inputs: { color: [0.984157919883728, 0.6110184788703918, 0.5736401677131653] } },
49
50
  // ── rim2: fresnel × fresnel-layer-weight, powered (hair-style) ──
50
51
  { id: "rim2_fres", type: "fresnel", inputs: { ior: 1.45 } },
51
52
  { id: "rim2_lw", type: "layer_weight/fresnel", inputs: { blend: 0.61 } },
52
53
  { id: "rim2_raw", type: "math/multiply" },
53
54
  { id: "rim2_pow", type: "math/power", inputs: { b: 0.6300000548362732 } },
54
- { id: "rim2_mix", type: "mix_shader", inputs: { b: [1.0, 0.4684903025627136, 0.3698573112487793] } },
55
+ { id: "rim2_mix", type: "mix/blend", inputs: { b: [1.0, 0.4684903025627136, 0.3698573112487793] } },
55
56
  // ── near-white texture gate emission ──
56
57
  { id: "gate", type: "math/greater_than", inputs: { b: 0.9300000071525574 } },
57
58
  { id: "gate_scale", type: "math/multiply", inputs: { b: 3.0 } },
58
59
  // ── npr stack (rim1 + rim2 + bright_emit + warm) ──
59
- { id: "npr_add1", type: "add_shader" },
60
- { id: "npr_add2", type: "add_shader" },
61
- { id: "npr_stack", type: "add_shader" },
60
+ { id: "npr_add1", type: "vector_math/add" },
61
+ { id: "npr_add2", type: "vector_math/add" },
62
+ { id: "npr_stack", type: "vector_math/add" },
62
63
  // ── principled with noise bump ──
63
64
  { id: "map", type: "mapping", inputs: { scl: [1.0, 1.0, 1.5] } },
64
65
  { id: "noise", type: "tex_noise", inputs: { scale: 1.0 } },
65
66
  { id: "noise_ramp", type: "ramp_linear", inputs: { pos0: 0.0, pos1: 1.0 } },
66
67
  { id: "bump", type: "bump", inputs: { strength: 0.324644535779953 } },
67
68
  { id: "principled_base", type: "mix/blend", inputs: { b: [0.6832, 0.1947, 0.1373] } },
68
- { id: "p_emit", type: "emission", inputs: { strength: 0.2 } },
69
+ { id: "p_emit", type: "vector_math/scale", inputs: { scale: 0.2 } },
69
70
  {
70
71
  id: "principled",
71
- type: "principled",
72
- inputs: { metallic: 0.0, specular_ior_level: 0.5, roughness: 0.3, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
72
+ type: "lit",
73
+ inputs: { metallic: 0.0, smoothness: 0.4523 },
73
74
  },
74
- { id: "p_sum", type: "add_shader" },
75
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.5 } },
75
+ { id: "p_sum", type: "vector_math/add" },
76
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.5 } },
76
77
  ],
77
78
  links: [
78
79
  // toon
@@ -85,33 +86,34 @@ export const FACE_GRAPH = {
85
86
  { from: { node: "shadow_tint", socket: "color" }, to: { node: "toon_color", socket: "a" } },
86
87
  { from: { node: "lit_tint", socket: "color" }, to: { node: "toon_color", socket: "b" } },
87
88
  { from: { node: "toon_color", socket: "color" }, to: { node: "bc", socket: "color" } },
88
- { from: { node: "bc", socket: "color" }, to: { node: "emission3", socket: "color" } },
89
+ { from: { node: "bc", socket: "color" }, to: { node: "emission3", socket: "a" } },
89
90
  // warm rim
90
91
  { from: { node: "toon", socket: "fac_out" }, to: { node: "warm_mul", socket: "a" } },
91
92
  { from: { node: "warm_mul", socket: "value" }, to: { node: "warm_add", socket: "a" } },
92
93
  { from: { node: "warm_add", socket: "value" }, to: { node: "warm_clamp", socket: "a" } },
93
94
  { from: { node: "warm_clamp", socket: "value" }, to: { node: "warm_ramp", socket: "fac" } },
94
- { from: { node: "warm_ramp", socket: "color" }, to: { node: "warm_emit", socket: "color" } },
95
+ { from: { node: "warm_ramp", socket: "color" }, to: { node: "warm_emit", socket: "a" } },
95
96
  // rim1
96
97
  { from: { node: "rim1_fres", socket: "value" }, to: { node: "rim1_str", socket: "a" } },
97
98
  { from: { node: "rim1_lw", socket: "value" }, to: { node: "rim1_str", socket: "b" } },
98
- { from: { node: "rim1_str", socket: "value" }, to: { node: "rim1", socket: "strength" } },
99
+ { from: { node: "rim1_str", socket: "value" }, to: { node: "rim1", socket: "scale" } },
99
100
  // rim2
100
101
  { from: { node: "rim2_fres", socket: "value" }, to: { node: "rim2_raw", socket: "a" } },
101
102
  { from: { node: "rim2_lw", socket: "value" }, to: { node: "rim2_raw", socket: "b" } },
102
103
  { from: { node: "rim2_raw", socket: "value" }, to: { node: "rim2_pow", socket: "a" } },
103
- { from: { node: "emission3", socket: "color" }, to: { node: "rim2_mix", socket: "a" } },
104
+ { from: { node: "emission3", socket: "vector" }, to: { node: "rim2_mix", socket: "a" } },
104
105
  { from: { node: "rim2_pow", socket: "value" }, to: { node: "rim2_mix", socket: "fac" } },
105
106
  // gate
106
107
  { from: { node: "tex", socket: "color" }, to: { node: "gate", socket: "a" } },
107
108
  { from: { node: "gate", socket: "value" }, to: { node: "gate_scale", socket: "a" } },
108
109
  // npr stack
109
- { from: { node: "rim1", socket: "color" }, to: { node: "npr_add1", socket: "a" } },
110
+ { from: { node: "rim1_color", socket: "color" }, to: { node: "rim1", socket: "a" } },
111
+ { from: { node: "rim1", socket: "vector" }, to: { node: "npr_add1", socket: "a" } },
110
112
  { from: { node: "rim2_mix", socket: "color" }, to: { node: "npr_add1", socket: "b" } },
111
- { from: { node: "npr_add1", socket: "color" }, to: { node: "npr_add2", socket: "a" } },
113
+ { from: { node: "npr_add1", socket: "vector" }, to: { node: "npr_add2", socket: "a" } },
112
114
  { from: { node: "gate_scale", socket: "value" }, to: { node: "npr_add2", socket: "b" } },
113
- { from: { node: "npr_add2", socket: "color" }, to: { node: "npr_stack", socket: "a" } },
114
- { from: { node: "warm_emit", socket: "color" }, to: { node: "npr_stack", socket: "b" } },
115
+ { from: { node: "npr_add2", socket: "vector" }, to: { node: "npr_stack", socket: "a" } },
116
+ { from: { node: "warm_emit", socket: "vector" }, to: { node: "npr_stack", socket: "b" } },
115
117
  // principled + noise bump
116
118
  { from: { node: "geo", socket: "rest_pos" }, to: { node: "map", socket: "vector" } },
117
119
  { from: { node: "map", socket: "vector" }, to: { node: "noise", socket: "vector" } },
@@ -120,14 +122,14 @@ export const FACE_GRAPH = {
120
122
  { from: { node: "geo", socket: "normal" }, to: { node: "bump", socket: "normal" } },
121
123
  { from: { node: "noise_ramp", socket: "fac_out" }, to: { node: "principled_base", socket: "fac" } },
122
124
  { from: { node: "bc", socket: "color" }, to: { node: "principled_base", socket: "a" } },
123
- { from: { node: "bc", socket: "color" }, to: { node: "p_emit", socket: "color" } },
125
+ { from: { node: "bc", socket: "color" }, to: { node: "p_emit", socket: "a" } },
124
126
  { from: { node: "principled_base", socket: "color" }, to: { node: "principled", socket: "base_color" } },
125
127
  { from: { node: "bump", socket: "vector" }, to: { node: "principled", socket: "normal" } },
126
128
  { from: { node: "principled", socket: "color" }, to: { node: "p_sum", socket: "a" } },
127
- { from: { node: "p_emit", socket: "color" }, to: { node: "p_sum", socket: "b" } },
129
+ { from: { node: "p_emit", socket: "vector" }, to: { node: "p_sum", socket: "b" } },
128
130
  // final mix
129
- { from: { node: "npr_stack", socket: "color" }, to: { node: "mix_shader_001", socket: "a" } },
130
- { from: { node: "p_sum", socket: "color" }, to: { node: "mix_shader_001", socket: "b" } },
131
+ { from: { node: "npr_stack", socket: "vector" }, to: { node: "mix_shader_001", socket: "a" } },
132
+ { from: { node: "p_sum", socket: "vector" }, to: { node: "mix_shader_001", socket: "b" } },
131
133
  ],
132
134
  output: { node: "mix_shader_001", socket: "color" },
133
135
  };
@@ -4,7 +4,7 @@
4
4
  // (golden test #1 — see tests/graph.test.mjs).
5
5
  //
6
6
  // Inherited authoring decisions from the hand port: the noise→bump subtree on
7
- // Principled.Normal is omitted (imperceptible at 0.2 mix weight), and Blender's bevel
7
+ // the Lit layer's normal is omitted (imperceptible at 0.2 mix weight), and Blender's bevel
8
8
  // node is approximated by saturate(normal.y) — Blender Z-up ⇒ engine Y-up.
9
9
  //
10
10
  // The object is pure JSON (no functions/undefined) — JSON.stringify round-trips it,
@@ -25,7 +25,7 @@ export const HAIR_GRAPH = {
25
25
  { id: "hs_shadow", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.2, value: 0.5, fac: 1.0 } },
26
26
  { id: "hs_002", type: "hue_sat", inputs: { hue: 0.48, saturation: 1.2, value: 0.7, fac: 1.0 } },
27
27
  { id: "hs_001", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.5, value: 1.0, fac: 1.0 } },
28
- { id: "str", type: "shader_to_rgb_diffuse" },
28
+ { id: "str", type: "lambert" },
29
29
  { id: "ramp_008", type: "ramp_cardinal", inputs: { pos0: 0.2466, color0: [0, 0, 0, 1], pos1: 0.3466, color1: [1, 1, 1, 1] } },
30
30
  { id: "mix_004", type: "mix/blend" },
31
31
  { id: "bc", type: "bright_contrast", inputs: { bright: 0.1, contrast: 0.2 } },
@@ -38,7 +38,7 @@ export const HAIR_GRAPH = {
38
38
  { id: "rim_pow", type: "math/power", inputs: { b: 0.6300000548362732 } },
39
39
  {
40
40
  id: "mix_shader_002",
41
- type: "mix_shader",
41
+ type: "mix/blend",
42
42
  inputs: { b: [0.1673291176557541, 0.1673291176557541, 0.1673291176557541] },
43
43
  },
44
44
  { id: "gate", type: "math/greater_than", inputs: { b: 0.15000000596046448 } },
@@ -46,10 +46,10 @@ export const HAIR_GRAPH = {
46
46
  { id: "npr_add", type: "mix/add_emit" },
47
47
  {
48
48
  id: "principled",
49
- type: "principled",
50
- inputs: { metallic: 0.0, specular_ior_level: 1.0, roughness: 0.3, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
49
+ type: "lit",
50
+ inputs: { metallic: 0.0, smoothness: 0.4523, specular: 1.0 },
51
51
  },
52
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.2 } },
52
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.2 } },
53
53
  ],
54
54
  links: [
55
55
  { from: { node: "tex", socket: "color" }, to: { node: "tex_base", socket: "a" } },
@@ -1,5 +1,5 @@
1
1
  // M_Metal as a ShaderGraph — port of shaders/materials/metal.ts.
2
- // Metallic Principled (Metallic=1, Specular=1, Roughness=0.3) with a
2
+ // a metallic Lit (metallic 1, smoothness 0.45) with a
3
3
  // reflection-coord voronoi driving base color (metallic sparkle), plus an NPR
4
4
  // toon/overlay emission stack mixed at Fac=0.6967. The voronoi Color→ramp Fac
5
5
  // link goes through Blender's implicit BT.601 conversion (color_to_value).
@@ -17,14 +17,14 @@ export const METAL_GRAPH = {
17
17
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
18
18
  { id: "geo", type: "geometry" },
19
19
  { id: "tex_tint", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.800000011920929, fac: 1.0 } },
20
- { id: "str", type: "shader_to_rgb_diffuse" },
20
+ { id: "str", type: "lambert" },
21
21
  { id: "ramp_008", type: "ramp_cardinal", inputs: { pos0: 0.2466, pos1: 0.3466 } },
22
22
  { id: "mix04_fac", type: "math/multiply", inputs: { b: 0.5 } },
23
23
  { id: "dark_tex", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.19999998807907104, fac: 1.0 } },
24
24
  { id: "mix_004", type: "mix/blend" },
25
25
  { id: "hue_004", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 2.0, fac: 1.0 } },
26
26
  { id: "npr_overlay", type: "mix/overlay", inputs: { fac: 1.0 } },
27
- { id: "npr_emit", type: "emission", inputs: { strength: 8.100000381469727 } },
27
+ { id: "npr_emit", type: "vector_math/scale", inputs: { scale: 8.100000381469727 } },
28
28
  { id: "voro_cross", type: "vect_cross", inputs: { b: [0, 1, 0] } },
29
29
  { id: "voro", type: "tex_voronoi/color", inputs: { scale: 4.3 } },
30
30
  { id: "voro_ramp", type: "ramp_linear", inputs: { pos0: 0.0, pos1: 1.0 } },
@@ -32,10 +32,10 @@ export const METAL_GRAPH = {
32
32
  { id: "albedo", type: "mix/blend" },
33
33
  {
34
34
  id: "principled",
35
- type: "principled",
36
- inputs: { metallic: 1.0, specular_ior_level: 1.0, roughness: 0.3, spec_clamp: 1e30, sheen_weight: 0.0, sheen_tint: 0.0 },
35
+ type: "lit",
36
+ inputs: { metallic: 1.0, smoothness: 0.4523, specular: 1.0 },
37
37
  },
38
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.6967 } },
38
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.6967 } },
39
39
  ],
40
40
  links: [
41
41
  { from: { node: "tex", socket: "color" }, to: { node: "tex_base", socket: "a" } },
@@ -50,7 +50,7 @@ export const METAL_GRAPH = {
50
50
  { from: { node: "mix_004", socket: "color" }, to: { node: "hue_004", socket: "color" } },
51
51
  { from: { node: "mix_004", socket: "color" }, to: { node: "npr_overlay", socket: "a" } },
52
52
  { from: { node: "hue_004", socket: "color" }, to: { node: "npr_overlay", socket: "b" } },
53
- { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "color" } },
53
+ { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "a" } },
54
54
  { from: { node: "geo", socket: "reflection" }, to: { node: "voro_cross", socket: "a" } },
55
55
  { from: { node: "voro_cross", socket: "vector" }, to: { node: "voro", socket: "vector" } },
56
56
  { from: { node: "voro", socket: "color" }, to: { node: "voro_ramp", socket: "fac" } },
@@ -59,7 +59,7 @@ export const METAL_GRAPH = {
59
59
  { from: { node: "voro_ramp", socket: "fac_out" }, to: { node: "albedo", socket: "a" } },
60
60
  { from: { node: "hue_006", socket: "color" }, to: { node: "albedo", socket: "b" } },
61
61
  { from: { node: "albedo", socket: "color" }, to: { node: "principled", socket: "base_color" } },
62
- { from: { node: "npr_emit", socket: "color" }, to: { node: "mix_shader_001", socket: "a" } },
62
+ { from: { node: "npr_emit", socket: "vector" }, to: { node: "mix_shader_001", socket: "a" } },
63
63
  { from: { node: "principled", socket: "color" }, to: { node: "mix_shader_001", socket: "b" } },
64
64
  ],
65
65
  output: { node: "mix_shader_001", socket: "color" },
@@ -1 +1 @@
1
- {"version":3,"file":"stockings.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/stockings.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,eAAe,EAAE,WAsD7B,CAAA"}
1
+ {"version":3,"file":"stockings.d.ts","sourceRoot":"","sources":["../../../src/graph/presets/stockings.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,eAAe,EAAE,WA+C7B,CAAA"}