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
@@ -340,6 +340,10 @@ export function compileGraph(graph: ShaderGraph, opts: CompileOptions = {}): Com
340
340
  args.distortion.literal === 0
341
341
  )
342
342
  return `tex_noise_d2(${raw.vector}, ${raw.scale})`
343
+ // Lit is the SURFACE only when it is the graph's output: then it shades the
344
+ // lamps' diffuse by its own albedo, as URP does. Mixed in as a layer (a
345
+ // toon look's gloss), the lamps stay the epilogue's, on the whole material.
346
+ if (node.type === "lit" && node.id !== out.node) return spec(node).emit!(raw).replace(/, true\)$/, ", false)")
343
347
  return spec(node).emit!(raw)
344
348
  }
345
349
 
@@ -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
 
@@ -18,13 +18,13 @@ export const BODY_GRAPH: ShaderGraph = {
18
18
  { id: "mat_diffuse", type: "material_diffuse" },
19
19
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
20
20
  { id: "geo", type: "geometry" },
21
- { id: "str", type: "shader_to_rgb_diffuse" },
21
+ { id: "str", type: "lambert" },
22
22
  { id: "toon", type: "ramp_cardinal", inputs: { pos0: 0.2466, pos1: 0.3466 } },
23
23
  { id: "shadow_tint", type: "hue_sat", inputs: { hue: 0.5, saturation: 2.0, value: 0.3499999940395355, fac: 1.0 } },
24
24
  { id: "lit_tint", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.5, value: 1.0, fac: 1.0 } },
25
25
  { id: "toon_color", type: "mix/blend" },
26
26
  { id: "bc", type: "bright_contrast", inputs: { bright: 0.1, contrast: 0.2 } },
27
- { id: "emission3", type: "emission", inputs: { strength: 4.0 } },
27
+ { id: "emission3", type: "vector_math/scale", inputs: { scale: 4.0 } },
28
28
  { id: "warm_add", type: "math/add", inputs: { b: 0.5 } },
29
29
  { id: "warm_clamp", type: "math/clamp01" },
30
30
  {
@@ -37,17 +37,18 @@ export const BODY_GRAPH: ShaderGraph = {
37
37
  color1: [0.6677, 0.5024, 0.5126, 1.0],
38
38
  },
39
39
  },
40
- { id: "warm_emit", type: "emission", inputs: { strength: 0.30000001192092896 } },
40
+ { id: "warm_emit", type: "vector_math/scale", inputs: { scale: 0.30000001192092896 } },
41
41
  { id: "rim1_fres", type: "fresnel", inputs: { ior: 2.0 } },
42
42
  { id: "rim1_lw", type: "layer_weight/facing", inputs: { blend: 0.24000005424022675 } },
43
43
  { id: "rim1_str", type: "math/multiply" },
44
- { id: "rim1", type: "emission", inputs: { color: [0.984157919883728, 0.6110184788703918, 0.5736401677131653] } },
44
+ { id: "rim1", type: "vector_math/scale" },
45
+ { id: "rim1_color", type: "rgb", inputs: { color: [0.984157919883728, 0.6110184788703918, 0.5736401677131653] } },
45
46
  { id: "rim2_lw", type: "layer_weight/facing", inputs: { blend: 0.20000000298023224 } },
46
47
  { id: "rim2_pow", type: "math/power", inputs: { b: 1.4300000667572021 } },
47
48
  { id: "rim2_ramp", type: "ramp_cardinal", inputs: { pos0: 0.0, pos1: 0.5052 } },
48
- { id: "rim2_mix", type: "mix_shader", inputs: { b: [1.0, 0.4303792119026184, 0.3315804898738861] } },
49
- { id: "npr_add1", type: "add_shader" },
50
- { id: "npr_stack", type: "add_shader" },
49
+ { id: "rim2_mix", type: "mix/blend", inputs: { b: [1.0, 0.4303792119026184, 0.3315804898738861] } },
50
+ { id: "npr_add1", type: "vector_math/add" },
51
+ { id: "npr_stack", type: "vector_math/add" },
51
52
  { id: "map", type: "mapping", inputs: { scl: [1.0, 1.0, 1.5] } },
52
53
  { id: "noise", type: "tex_noise", inputs: { scale: 1.0 } },
53
54
  { id: "noise_ramp", type: "ramp_linear", inputs: { pos0: 0.0, pos1: 1.0 } },
@@ -57,14 +58,14 @@ export const BODY_GRAPH: ShaderGraph = {
57
58
  type: "mix/blend",
58
59
  inputs: { b: [0.6831911206245422, 0.19474034011363983, 0.13732507824897766] },
59
60
  },
60
- { id: "p_emit", type: "emission", inputs: { strength: 0.2 } },
61
+ { id: "p_emit", type: "vector_math/scale", inputs: { scale: 0.2 } },
61
62
  {
62
63
  id: "principled",
63
- type: "principled",
64
- inputs: { metallic: 0.0, specular_ior_level: 0.5, roughness: 0.3, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
64
+ type: "lit",
65
+ inputs: { metallic: 0.0, smoothness: 0.4523 },
65
66
  },
66
- { id: "p_sum", type: "add_shader" },
67
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.5 } },
67
+ { id: "p_sum", type: "vector_math/add" },
68
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.5 } },
68
69
  ],
69
70
  links: [
70
71
  { from: { node: "str", socket: "value" }, to: { node: "toon", socket: "fac" } },
@@ -76,22 +77,23 @@ export const BODY_GRAPH: ShaderGraph = {
76
77
  { from: { node: "shadow_tint", socket: "color" }, to: { node: "toon_color", socket: "a" } },
77
78
  { from: { node: "lit_tint", socket: "color" }, to: { node: "toon_color", socket: "b" } },
78
79
  { from: { node: "toon_color", socket: "color" }, to: { node: "bc", socket: "color" } },
79
- { from: { node: "bc", socket: "color" }, to: { node: "emission3", socket: "color" } },
80
+ { from: { node: "bc", socket: "color" }, to: { node: "emission3", socket: "a" } },
80
81
  { from: { node: "toon", socket: "fac_out" }, to: { node: "warm_add", socket: "a" } },
81
82
  { from: { node: "warm_add", socket: "value" }, to: { node: "warm_clamp", socket: "a" } },
82
83
  { from: { node: "warm_clamp", socket: "value" }, to: { node: "warm_ramp", socket: "fac" } },
83
- { from: { node: "warm_ramp", socket: "color" }, to: { node: "warm_emit", socket: "color" } },
84
+ { from: { node: "warm_ramp", socket: "color" }, to: { node: "warm_emit", socket: "a" } },
84
85
  { from: { node: "rim1_fres", socket: "value" }, to: { node: "rim1_str", socket: "a" } },
85
86
  { from: { node: "rim1_lw", socket: "value" }, to: { node: "rim1_str", socket: "b" } },
86
- { from: { node: "rim1_str", socket: "value" }, to: { node: "rim1", socket: "strength" } },
87
+ { from: { node: "rim1_str", socket: "value" }, to: { node: "rim1", socket: "scale" } },
87
88
  { from: { node: "rim2_lw", socket: "value" }, to: { node: "rim2_pow", socket: "a" } },
88
89
  { from: { node: "rim2_pow", socket: "value" }, to: { node: "rim2_ramp", socket: "fac" } },
89
- { from: { node: "emission3", socket: "color" }, to: { node: "rim2_mix", socket: "a" } },
90
+ { from: { node: "emission3", socket: "vector" }, to: { node: "rim2_mix", socket: "a" } },
90
91
  { from: { node: "rim2_ramp", socket: "fac_out" }, to: { node: "rim2_mix", socket: "fac" } },
91
- { from: { node: "rim1", socket: "color" }, to: { node: "npr_add1", socket: "a" } },
92
+ { from: { node: "rim1_color", socket: "color" }, to: { node: "rim1", socket: "a" } },
93
+ { from: { node: "rim1", socket: "vector" }, to: { node: "npr_add1", socket: "a" } },
92
94
  { from: { node: "rim2_mix", socket: "color" }, to: { node: "npr_add1", socket: "b" } },
93
- { from: { node: "npr_add1", socket: "color" }, to: { node: "npr_stack", socket: "a" } },
94
- { from: { node: "warm_emit", socket: "color" }, to: { node: "npr_stack", socket: "b" } },
95
+ { from: { node: "npr_add1", socket: "vector" }, to: { node: "npr_stack", socket: "a" } },
96
+ { from: { node: "warm_emit", socket: "vector" }, to: { node: "npr_stack", socket: "b" } },
95
97
  { from: { node: "geo", socket: "rest_pos" }, to: { node: "map", socket: "vector" } },
96
98
  { from: { node: "map", socket: "vector" }, to: { node: "noise", socket: "vector" } },
97
99
  { from: { node: "noise", socket: "value" }, to: { node: "noise_ramp", socket: "fac" } },
@@ -99,13 +101,13 @@ export const BODY_GRAPH: ShaderGraph = {
99
101
  { from: { node: "geo", socket: "normal" }, to: { node: "bump", socket: "normal" } },
100
102
  { from: { node: "noise_ramp", socket: "fac_out" }, to: { node: "principled_base", socket: "fac" } },
101
103
  { from: { node: "bc", socket: "color" }, to: { node: "principled_base", socket: "a" } },
102
- { from: { node: "bc", socket: "color" }, to: { node: "p_emit", socket: "color" } },
104
+ { from: { node: "bc", socket: "color" }, to: { node: "p_emit", socket: "a" } },
103
105
  { from: { node: "principled_base", socket: "color" }, to: { node: "principled", socket: "base_color" } },
104
106
  { from: { node: "bump", socket: "vector" }, to: { node: "principled", socket: "normal" } },
105
107
  { from: { node: "principled", socket: "color" }, to: { node: "p_sum", socket: "a" } },
106
- { from: { node: "p_emit", socket: "color" }, to: { node: "p_sum", socket: "b" } },
107
- { from: { node: "npr_stack", socket: "color" }, to: { node: "mix_shader_001", socket: "a" } },
108
- { from: { node: "p_sum", socket: "color" }, to: { node: "mix_shader_001", socket: "b" } },
108
+ { from: { node: "p_emit", socket: "vector" }, to: { node: "p_sum", socket: "b" } },
109
+ { from: { node: "npr_stack", socket: "vector" }, to: { node: "mix_shader_001", socket: "a" } },
110
+ { from: { node: "p_sum", socket: "vector" }, to: { node: "mix_shader_001", socket: "b" } },
109
111
  ],
110
112
  output: { node: "mix_shader_001", socket: "color" },
111
113
  }
@@ -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.
@@ -20,7 +20,7 @@ export const CLOTH_ROUGH_GRAPH: ShaderGraph = {
20
20
  { id: "mat_diffuse", type: "material_diffuse" },
21
21
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
22
22
  { id: "geo", type: "geometry" },
23
- { id: "str", type: "shader_to_rgb_diffuse" },
23
+ { id: "str", type: "lambert" },
24
24
  { id: "ramp_008", type: "ramp_cardinal", inputs: { pos0: 0.2, pos1: 0.45 } },
25
25
  { id: "mix04_fac", type: "math/multiply", inputs: { b: 0.5 } },
26
26
  { id: "dark_tex", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.19999998807907104, fac: 1.0 } },
@@ -30,17 +30,17 @@ export const CLOTH_ROUGH_GRAPH: ShaderGraph = {
30
30
  { id: "mix_003", type: "mix/blend" },
31
31
  { id: "hue_004", type: "hue_sat", inputs: { hue: 0.5, saturation: 0.800000011920929, value: 2.0, fac: 1.0 } },
32
32
  { id: "npr_overlay", type: "mix/overlay", inputs: { fac: 1.0 } },
33
- { id: "npr_emit", type: "emission", inputs: { strength: 18.200000762939453 } },
33
+ { id: "npr_emit", type: "vector_math/scale", inputs: { scale: 18.200000762939453 } },
34
34
  { id: "noise", type: "tex_noise", inputs: { scale: 17.7 } },
35
35
  { id: "noise_ramp", type: "ramp_linear", inputs: { pos0: 0.0, pos1: 1.0 } },
36
36
  { id: "bump", type: "bump", inputs: { strength: 1.0 } },
37
37
  { id: "principled_base", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.800000011920929, fac: 1.0 } },
38
38
  {
39
39
  id: "principled",
40
- type: "principled",
41
- inputs: { metallic: 0.0, specular_ior_level: 0.25, roughness: 1.0, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
40
+ type: "lit",
41
+ inputs: { metallic: 0.0, smoothness: 0.0, specular: 0.25 },
42
42
  },
43
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.8999999761581421 } },
43
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.8999999761581421 } },
44
44
  ],
45
45
  links: [
46
46
  { from: { node: "str", socket: "value" }, to: { node: "ramp_008", socket: "fac" } },
@@ -59,7 +59,7 @@ export const CLOTH_ROUGH_GRAPH: ShaderGraph = {
59
59
  { from: { node: "mix_003", socket: "color" }, to: { node: "hue_004", socket: "color" } },
60
60
  { from: { node: "mix_003", socket: "color" }, to: { node: "npr_overlay", socket: "a" } },
61
61
  { from: { node: "hue_004", socket: "color" }, to: { node: "npr_overlay", socket: "b" } },
62
- { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "color" } },
62
+ { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "a" } },
63
63
  { from: { node: "geo", socket: "rest_pos" }, to: { node: "noise", socket: "vector" } },
64
64
  { from: { node: "noise", socket: "value" }, to: { node: "noise_ramp", socket: "fac" } },
65
65
  { from: { node: "noise_ramp", socket: "fac_out" }, to: { node: "bump", socket: "height" } },
@@ -67,7 +67,7 @@ export const CLOTH_ROUGH_GRAPH: ShaderGraph = {
67
67
  { from: { node: "tex_base", socket: "color" }, to: { node: "principled_base", socket: "color" } },
68
68
  { from: { node: "principled_base", socket: "color" }, to: { node: "principled", socket: "base_color" } },
69
69
  { from: { node: "bump", socket: "vector" }, to: { node: "principled", socket: "normal" } },
70
- { from: { node: "npr_emit", socket: "color" }, to: { node: "mix_shader_001", socket: "a" } },
70
+ { from: { node: "npr_emit", socket: "vector" }, to: { node: "mix_shader_001", socket: "a" } },
71
71
  { from: { node: "principled", socket: "color" }, to: { node: "mix_shader_001", socket: "b" } },
72
72
  ],
73
73
  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
 
6
6
  import type { ShaderGraph } from "../schema"
@@ -18,7 +18,7 @@ export const CLOTH_SMOOTH_GRAPH: ShaderGraph = {
18
18
  { id: "mat_diffuse", type: "material_diffuse" },
19
19
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
20
20
  { id: "geo", type: "geometry" },
21
- { id: "str", type: "shader_to_rgb_diffuse" },
21
+ { id: "str", type: "lambert" },
22
22
  { id: "ramp_008", type: "ramp_cardinal", inputs: { pos0: 0.2466, pos1: 0.3466 } },
23
23
  { id: "mix04_fac", type: "math/multiply", inputs: { b: 0.5 } },
24
24
  { id: "dark_tex", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.19999998807907104, fac: 1.0 } },
@@ -28,14 +28,14 @@ export const CLOTH_SMOOTH_GRAPH: ShaderGraph = {
28
28
  { id: "mix_003", type: "mix/blend" },
29
29
  { id: "hue_004", type: "hue_sat", inputs: { hue: 0.5, saturation: 0.800000011920929, value: 2.0, fac: 1.0 } },
30
30
  { id: "npr_overlay", type: "mix/overlay", inputs: { fac: 1.0 } },
31
- { id: "npr_emit", type: "emission", inputs: { strength: 18.200000762939453 } },
31
+ { id: "npr_emit", type: "vector_math/scale", inputs: { scale: 18.200000762939453 } },
32
32
  { id: "principled_base", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.800000011920929, fac: 1.0 } },
33
33
  {
34
34
  id: "principled",
35
- type: "principled",
36
- inputs: { metallic: 0.0, specular_ior_level: 0.8, roughness: 0.5, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
35
+ type: "lit",
36
+ inputs: { metallic: 0.0, smoothness: 0.2929, specular: 0.8 },
37
37
  },
38
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.8999999761581421 } },
38
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.8999999761581421 } },
39
39
  ],
40
40
  links: [
41
41
  { from: { node: "str", socket: "value" }, to: { node: "ramp_008", socket: "fac" } },
@@ -54,10 +54,10 @@ export const CLOTH_SMOOTH_GRAPH: ShaderGraph = {
54
54
  { from: { node: "mix_003", socket: "color" }, to: { node: "hue_004", socket: "color" } },
55
55
  { from: { node: "mix_003", socket: "color" }, to: { node: "npr_overlay", socket: "a" } },
56
56
  { from: { node: "hue_004", socket: "color" }, to: { node: "npr_overlay", socket: "b" } },
57
- { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "color" } },
57
+ { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "a" } },
58
58
  { from: { node: "tex_base", socket: "color" }, to: { node: "principled_base", socket: "color" } },
59
59
  { from: { node: "principled_base", socket: "color" }, to: { node: "principled", socket: "base_color" } },
60
- { from: { node: "npr_emit", socket: "color" }, to: { node: "mix_shader_001", socket: "a" } },
60
+ { from: { node: "npr_emit", socket: "vector" }, to: { node: "mix_shader_001", socket: "a" } },
61
61
  { from: { node: "principled", socket: "color" }, to: { node: "mix_shader_001", socket: "b" } },
62
62
  ],
63
63
  output: { node: "mix_shader_001", socket: "color" },
@@ -1,7 +1,7 @@
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
 
@@ -9,7 +9,7 @@ import type { ShaderGraph } from "../schema"
9
9
 
10
10
  export const DEFAULT_GRAPH: ShaderGraph = {
11
11
  version: 1,
12
- name: "Principled BSDF",
12
+ name: "Lit",
13
13
  tags: ["default"],
14
14
  nodes: [
15
15
  { id: "tex", type: "texture" },
@@ -17,8 +17,8 @@ export const DEFAULT_GRAPH: ShaderGraph = {
17
17
  { id: "base", type: "mix/multiply", inputs: { fac: 1.0 } }, // texture × material diffuse
18
18
  {
19
19
  id: "principled",
20
- type: "principled",
21
- inputs: { metallic: 0.0, specular_ior_level: 0.5, roughness: 0.5, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
20
+ type: "lit",
21
+ inputs: { metallic: 0.0, smoothness: 0.2929 },
22
22
  },
23
23
  ],
24
24
  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
@@ -23,11 +23,11 @@ export const EYE_GRAPH: ShaderGraph = {
23
23
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
24
24
  {
25
25
  id: "principled",
26
- type: "principled",
27
- inputs: { metallic: 0.0, specular_ior_level: 0.5, roughness: 0.5, spec_clamp: 1e30, sheen_weight: 0.0, sheen_tint: 0.0 },
26
+ type: "lit",
27
+ inputs: { metallic: 0.0, smoothness: 0.2929 },
28
28
  },
29
- { id: "emission", type: "emission", inputs: { strength: 1.5 } },
30
- { id: "add", type: "add_shader" },
29
+ { id: "emission", type: "vector_math/scale", inputs: { scale: 1.5 } },
30
+ { id: "add", type: "vector_math/add" },
31
31
  // The iris glow follows the key round her head: full (1.5) lit from the
32
32
  // front, easing to 0.2 of it lit from behind - a fixed 1.5 left the eyes
33
33
  // bright white in a backlit face. head_basis.forward · L, half-Lambert,
@@ -44,9 +44,9 @@ export const EYE_GRAPH: ShaderGraph = {
44
44
  { from: { node: "tex", socket: "color" }, to: { node: "tex_base", socket: "a" } },
45
45
  { from: { node: "mat_diffuse", socket: "color" }, to: { node: "tex_base", socket: "b" } },
46
46
  { from: { node: "tex_base", socket: "color" }, to: { node: "principled", socket: "base_color" } },
47
- { from: { node: "tex_base", socket: "color" }, to: { node: "emission", socket: "color" } },
47
+ { from: { node: "tex_base", socket: "color" }, to: { node: "emission", socket: "a" } },
48
48
  { from: { node: "principled", socket: "color" }, to: { node: "add", socket: "a" } },
49
- { from: { node: "emission", socket: "color" }, to: { node: "add", socket: "b" } },
49
+ { from: { node: "emission", socket: "vector" }, to: { node: "add", socket: "b" } },
50
50
  { from: { node: "eye_hb", socket: "forward" }, to: { node: "eye_fl", socket: "a" } },
51
51
  { from: { node: "eye_lt", socket: "direction" }, to: { node: "eye_fl", socket: "b" } },
52
52
  { from: { node: "eye_fl", socket: "value" }, to: { node: "eye_half", socket: "a" } },
@@ -54,7 +54,7 @@ export const EYE_GRAPH: ShaderGraph = {
54
54
  { from: { node: "eye_lt", socket: "shadow" }, to: { node: "eye_sh", socket: "b" } },
55
55
  { from: { node: "eye_sh", socket: "value" }, to: { node: "eye_lvl", socket: "value" } },
56
56
  { from: { node: "eye_lvl", socket: "value" }, to: { node: "eye_str", socket: "a" } },
57
- { from: { node: "eye_str", socket: "value" }, to: { node: "emission", socket: "strength" } },
57
+ { from: { node: "eye_str", socket: "value" }, to: { node: "emission", socket: "scale" } },
58
58
  ],
59
- output: { node: "add", socket: "color" },
59
+ output: { node: "add", socket: "vector" },
60
60
  }
@@ -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
@@ -23,13 +23,13 @@ export const FACE_GRAPH: ShaderGraph = {
23
23
  { id: "geo", type: "geometry" },
24
24
 
25
25
  // ── toon shading ──
26
- { id: "str", type: "shader_to_rgb_diffuse" },
26
+ { id: "str", type: "lambert" },
27
27
  { id: "toon", type: "ramp_cardinal", inputs: { pos0: 0.2466, pos1: 0.3466 } },
28
28
  { id: "shadow_tint", type: "hue_sat", inputs: { hue: 0.46000000834465027, saturation: 2.0, value: 0.3499999940395355, fac: 1.0 } },
29
29
  { id: "lit_tint", type: "hue_sat", inputs: { hue: 0.46000000834465027, saturation: 1.600000023841858, value: 1.5, fac: 1.0 } },
30
30
  { id: "toon_color", type: "mix/blend" },
31
31
  { id: "bc", type: "bright_contrast", inputs: { bright: 0.1, contrast: 0.2 } },
32
- { id: "emission3", type: "emission", inputs: { strength: 2.5 } },
32
+ { id: "emission3", type: "vector_math/scale", inputs: { scale: 2.5 } },
33
33
 
34
34
  // ── warm rim (toon*0.5+0.5 → cardinal ramp) ──
35
35
  { id: "warm_mul", type: "math/multiply", inputs: { b: 0.5 } },
@@ -45,29 +45,30 @@ export const FACE_GRAPH: ShaderGraph = {
45
45
  color1: [0.6677, 0.5024, 0.5126, 1.0],
46
46
  },
47
47
  },
48
- { id: "warm_emit", type: "emission", inputs: { strength: 0.30000001192092896 } },
48
+ { id: "warm_emit", type: "vector_math/scale", inputs: { scale: 0.30000001192092896 } },
49
49
 
50
50
  // ── rim1: fresnel × facing ──
51
51
  { id: "rim1_fres", type: "fresnel", inputs: { ior: 2.0 } },
52
52
  { id: "rim1_lw", type: "layer_weight/facing", inputs: { blend: 0.24 } },
53
53
  { id: "rim1_str", type: "math/multiply" },
54
- { id: "rim1", type: "emission", inputs: { color: [0.984157919883728, 0.6110184788703918, 0.5736401677131653] } },
54
+ { id: "rim1", type: "vector_math/scale" },
55
+ { id: "rim1_color", type: "rgb", inputs: { color: [0.984157919883728, 0.6110184788703918, 0.5736401677131653] } },
55
56
 
56
57
  // ── rim2: fresnel × fresnel-layer-weight, powered (hair-style) ──
57
58
  { id: "rim2_fres", type: "fresnel", inputs: { ior: 1.45 } },
58
59
  { id: "rim2_lw", type: "layer_weight/fresnel", inputs: { blend: 0.61 } },
59
60
  { id: "rim2_raw", type: "math/multiply" },
60
61
  { id: "rim2_pow", type: "math/power", inputs: { b: 0.6300000548362732 } },
61
- { id: "rim2_mix", type: "mix_shader", inputs: { b: [1.0, 0.4684903025627136, 0.3698573112487793] } },
62
+ { id: "rim2_mix", type: "mix/blend", inputs: { b: [1.0, 0.4684903025627136, 0.3698573112487793] } },
62
63
 
63
64
  // ── near-white texture gate emission ──
64
65
  { id: "gate", type: "math/greater_than", inputs: { b: 0.9300000071525574 } },
65
66
  { id: "gate_scale", type: "math/multiply", inputs: { b: 3.0 } },
66
67
 
67
68
  // ── npr stack (rim1 + rim2 + bright_emit + warm) ──
68
- { id: "npr_add1", type: "add_shader" },
69
- { id: "npr_add2", type: "add_shader" },
70
- { id: "npr_stack", type: "add_shader" },
69
+ { id: "npr_add1", type: "vector_math/add" },
70
+ { id: "npr_add2", type: "vector_math/add" },
71
+ { id: "npr_stack", type: "vector_math/add" },
71
72
 
72
73
  // ── principled with noise bump ──
73
74
  { id: "map", type: "mapping", inputs: { scl: [1.0, 1.0, 1.5] } },
@@ -75,15 +76,15 @@ export const FACE_GRAPH: ShaderGraph = {
75
76
  { id: "noise_ramp", type: "ramp_linear", inputs: { pos0: 0.0, pos1: 1.0 } },
76
77
  { id: "bump", type: "bump", inputs: { strength: 0.324644535779953 } },
77
78
  { id: "principled_base", type: "mix/blend", inputs: { b: [0.6832, 0.1947, 0.1373] } },
78
- { id: "p_emit", type: "emission", inputs: { strength: 0.2 } },
79
+ { id: "p_emit", type: "vector_math/scale", inputs: { scale: 0.2 } },
79
80
  {
80
81
  id: "principled",
81
- type: "principled",
82
- inputs: { metallic: 0.0, specular_ior_level: 0.5, roughness: 0.3, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
82
+ type: "lit",
83
+ inputs: { metallic: 0.0, smoothness: 0.4523 },
83
84
  },
84
- { id: "p_sum", type: "add_shader" },
85
+ { id: "p_sum", type: "vector_math/add" },
85
86
 
86
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.5 } },
87
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.5 } },
87
88
  ],
88
89
  links: [
89
90
  // toon
@@ -96,33 +97,34 @@ export const FACE_GRAPH: ShaderGraph = {
96
97
  { from: { node: "shadow_tint", socket: "color" }, to: { node: "toon_color", socket: "a" } },
97
98
  { from: { node: "lit_tint", socket: "color" }, to: { node: "toon_color", socket: "b" } },
98
99
  { from: { node: "toon_color", socket: "color" }, to: { node: "bc", socket: "color" } },
99
- { from: { node: "bc", socket: "color" }, to: { node: "emission3", socket: "color" } },
100
+ { from: { node: "bc", socket: "color" }, to: { node: "emission3", socket: "a" } },
100
101
  // warm rim
101
102
  { from: { node: "toon", socket: "fac_out" }, to: { node: "warm_mul", socket: "a" } },
102
103
  { from: { node: "warm_mul", socket: "value" }, to: { node: "warm_add", socket: "a" } },
103
104
  { from: { node: "warm_add", socket: "value" }, to: { node: "warm_clamp", socket: "a" } },
104
105
  { from: { node: "warm_clamp", socket: "value" }, to: { node: "warm_ramp", socket: "fac" } },
105
- { from: { node: "warm_ramp", socket: "color" }, to: { node: "warm_emit", socket: "color" } },
106
+ { from: { node: "warm_ramp", socket: "color" }, to: { node: "warm_emit", socket: "a" } },
106
107
  // rim1
107
108
  { from: { node: "rim1_fres", socket: "value" }, to: { node: "rim1_str", socket: "a" } },
108
109
  { from: { node: "rim1_lw", socket: "value" }, to: { node: "rim1_str", socket: "b" } },
109
- { from: { node: "rim1_str", socket: "value" }, to: { node: "rim1", socket: "strength" } },
110
+ { from: { node: "rim1_str", socket: "value" }, to: { node: "rim1", socket: "scale" } },
110
111
  // rim2
111
112
  { from: { node: "rim2_fres", socket: "value" }, to: { node: "rim2_raw", socket: "a" } },
112
113
  { from: { node: "rim2_lw", socket: "value" }, to: { node: "rim2_raw", socket: "b" } },
113
114
  { from: { node: "rim2_raw", socket: "value" }, to: { node: "rim2_pow", socket: "a" } },
114
- { from: { node: "emission3", socket: "color" }, to: { node: "rim2_mix", socket: "a" } },
115
+ { from: { node: "emission3", socket: "vector" }, to: { node: "rim2_mix", socket: "a" } },
115
116
  { from: { node: "rim2_pow", socket: "value" }, to: { node: "rim2_mix", socket: "fac" } },
116
117
  // gate
117
118
  { from: { node: "tex", socket: "color" }, to: { node: "gate", socket: "a" } },
118
119
  { from: { node: "gate", socket: "value" }, to: { node: "gate_scale", socket: "a" } },
119
120
  // npr stack
120
- { from: { node: "rim1", socket: "color" }, to: { node: "npr_add1", socket: "a" } },
121
+ { from: { node: "rim1_color", socket: "color" }, to: { node: "rim1", socket: "a" } },
122
+ { from: { node: "rim1", socket: "vector" }, to: { node: "npr_add1", socket: "a" } },
121
123
  { from: { node: "rim2_mix", socket: "color" }, to: { node: "npr_add1", socket: "b" } },
122
- { from: { node: "npr_add1", socket: "color" }, to: { node: "npr_add2", socket: "a" } },
124
+ { from: { node: "npr_add1", socket: "vector" }, to: { node: "npr_add2", socket: "a" } },
123
125
  { from: { node: "gate_scale", socket: "value" }, to: { node: "npr_add2", socket: "b" } },
124
- { from: { node: "npr_add2", socket: "color" }, to: { node: "npr_stack", socket: "a" } },
125
- { from: { node: "warm_emit", socket: "color" }, to: { node: "npr_stack", socket: "b" } },
126
+ { from: { node: "npr_add2", socket: "vector" }, to: { node: "npr_stack", socket: "a" } },
127
+ { from: { node: "warm_emit", socket: "vector" }, to: { node: "npr_stack", socket: "b" } },
126
128
  // principled + noise bump
127
129
  { from: { node: "geo", socket: "rest_pos" }, to: { node: "map", socket: "vector" } },
128
130
  { from: { node: "map", socket: "vector" }, to: { node: "noise", socket: "vector" } },
@@ -131,14 +133,14 @@ export const FACE_GRAPH: ShaderGraph = {
131
133
  { from: { node: "geo", socket: "normal" }, to: { node: "bump", socket: "normal" } },
132
134
  { from: { node: "noise_ramp", socket: "fac_out" }, to: { node: "principled_base", socket: "fac" } },
133
135
  { from: { node: "bc", socket: "color" }, to: { node: "principled_base", socket: "a" } },
134
- { from: { node: "bc", socket: "color" }, to: { node: "p_emit", socket: "color" } },
136
+ { from: { node: "bc", socket: "color" }, to: { node: "p_emit", socket: "a" } },
135
137
  { from: { node: "principled_base", socket: "color" }, to: { node: "principled", socket: "base_color" } },
136
138
  { from: { node: "bump", socket: "vector" }, to: { node: "principled", socket: "normal" } },
137
139
  { from: { node: "principled", socket: "color" }, to: { node: "p_sum", socket: "a" } },
138
- { from: { node: "p_emit", socket: "color" }, to: { node: "p_sum", socket: "b" } },
140
+ { from: { node: "p_emit", socket: "vector" }, to: { node: "p_sum", socket: "b" } },
139
141
  // final mix
140
- { from: { node: "npr_stack", socket: "color" }, to: { node: "mix_shader_001", socket: "a" } },
141
- { from: { node: "p_sum", socket: "color" }, to: { node: "mix_shader_001", socket: "b" } },
142
+ { from: { node: "npr_stack", socket: "vector" }, to: { node: "mix_shader_001", socket: "a" } },
143
+ { from: { node: "p_sum", socket: "vector" }, to: { node: "mix_shader_001", socket: "b" } },
142
144
  ],
143
145
  output: { node: "mix_shader_001", socket: "color" },
144
146
  }
@@ -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,
@@ -28,7 +28,7 @@ export const HAIR_GRAPH: ShaderGraph = {
28
28
  { id: "hs_shadow", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.2, value: 0.5, fac: 1.0 } },
29
29
  { id: "hs_002", type: "hue_sat", inputs: { hue: 0.48, saturation: 1.2, value: 0.7, fac: 1.0 } },
30
30
  { id: "hs_001", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.5, value: 1.0, fac: 1.0 } },
31
- { id: "str", type: "shader_to_rgb_diffuse" },
31
+ { id: "str", type: "lambert" },
32
32
  { id: "ramp_008", type: "ramp_cardinal", inputs: { pos0: 0.2466, color0: [0, 0, 0, 1], pos1: 0.3466, color1: [1, 1, 1, 1] } },
33
33
  { id: "mix_004", type: "mix/blend" },
34
34
  { id: "bc", type: "bright_contrast", inputs: { bright: 0.1, contrast: 0.2 } },
@@ -41,7 +41,7 @@ export const HAIR_GRAPH: ShaderGraph = {
41
41
  { id: "rim_pow", type: "math/power", inputs: { b: 0.6300000548362732 } },
42
42
  {
43
43
  id: "mix_shader_002",
44
- type: "mix_shader",
44
+ type: "mix/blend",
45
45
  inputs: { b: [0.1673291176557541, 0.1673291176557541, 0.1673291176557541] },
46
46
  },
47
47
  { id: "gate", type: "math/greater_than", inputs: { b: 0.15000000596046448 } },
@@ -49,10 +49,10 @@ export const HAIR_GRAPH: ShaderGraph = {
49
49
  { id: "npr_add", type: "mix/add_emit" },
50
50
  {
51
51
  id: "principled",
52
- type: "principled",
53
- inputs: { metallic: 0.0, specular_ior_level: 1.0, roughness: 0.3, spec_clamp: 10.0, sheen_weight: 0.0, sheen_tint: 0.0 },
52
+ type: "lit",
53
+ inputs: { metallic: 0.0, smoothness: 0.4523, specular: 1.0 },
54
54
  },
55
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.2 } },
55
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.2 } },
56
56
  ],
57
57
  links: [
58
58
  { 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).
@@ -20,14 +20,14 @@ export const METAL_GRAPH: ShaderGraph = {
20
20
  { id: "tex_base", type: "mix/multiply", inputs: { fac: 1.0 } },
21
21
  { id: "geo", type: "geometry" },
22
22
  { id: "tex_tint", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.800000011920929, fac: 1.0 } },
23
- { id: "str", type: "shader_to_rgb_diffuse" },
23
+ { id: "str", type: "lambert" },
24
24
  { id: "ramp_008", type: "ramp_cardinal", inputs: { pos0: 0.2466, pos1: 0.3466 } },
25
25
  { id: "mix04_fac", type: "math/multiply", inputs: { b: 0.5 } },
26
26
  { id: "dark_tex", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 0.19999998807907104, fac: 1.0 } },
27
27
  { id: "mix_004", type: "mix/blend" },
28
28
  { id: "hue_004", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, 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: 8.100000381469727 } },
30
+ { id: "npr_emit", type: "vector_math/scale", inputs: { scale: 8.100000381469727 } },
31
31
  { id: "voro_cross", type: "vect_cross", inputs: { b: [0, 1, 0] } },
32
32
  { id: "voro", type: "tex_voronoi/color", inputs: { scale: 4.3 } },
33
33
  { id: "voro_ramp", type: "ramp_linear", inputs: { pos0: 0.0, pos1: 1.0 } },
@@ -35,10 +35,10 @@ export const METAL_GRAPH: ShaderGraph = {
35
35
  { id: "albedo", type: "mix/blend" },
36
36
  {
37
37
  id: "principled",
38
- type: "principled",
39
- inputs: { metallic: 1.0, specular_ior_level: 1.0, roughness: 0.3, spec_clamp: 1e30, sheen_weight: 0.0, sheen_tint: 0.0 },
38
+ type: "lit",
39
+ inputs: { metallic: 1.0, smoothness: 0.4523, specular: 1.0 },
40
40
  },
41
- { id: "mix_shader_001", type: "mix_shader", inputs: { fac: 0.6967 } },
41
+ { id: "mix_shader_001", type: "mix/blend", inputs: { fac: 0.6967 } },
42
42
  ],
43
43
  links: [
44
44
  { from: { node: "tex", socket: "color" }, to: { node: "tex_base", socket: "a" } },
@@ -53,7 +53,7 @@ export const METAL_GRAPH: ShaderGraph = {
53
53
  { from: { node: "mix_004", socket: "color" }, to: { node: "hue_004", socket: "color" } },
54
54
  { from: { node: "mix_004", socket: "color" }, to: { node: "npr_overlay", socket: "a" } },
55
55
  { from: { node: "hue_004", socket: "color" }, to: { node: "npr_overlay", socket: "b" } },
56
- { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "color" } },
56
+ { from: { node: "npr_overlay", socket: "color" }, to: { node: "npr_emit", socket: "a" } },
57
57
  { from: { node: "geo", socket: "reflection" }, to: { node: "voro_cross", socket: "a" } },
58
58
  { from: { node: "voro_cross", socket: "vector" }, to: { node: "voro", socket: "vector" } },
59
59
  { from: { node: "voro", socket: "color" }, to: { node: "voro_ramp", socket: "fac" } },
@@ -62,7 +62,7 @@ export const METAL_GRAPH: ShaderGraph = {
62
62
  { from: { node: "voro_ramp", socket: "fac_out" }, to: { node: "albedo", socket: "a" } },
63
63
  { from: { node: "hue_006", socket: "color" }, to: { node: "albedo", socket: "b" } },
64
64
  { from: { node: "albedo", socket: "color" }, to: { node: "principled", socket: "base_color" } },
65
- { from: { node: "npr_emit", socket: "color" }, to: { node: "mix_shader_001", socket: "a" } },
65
+ { from: { node: "npr_emit", socket: "vector" }, to: { node: "mix_shader_001", socket: "a" } },
66
66
  { from: { node: "principled", socket: "color" }, to: { node: "mix_shader_001", socket: "b" } },
67
67
  ],
68
68
  output: { node: "mix_shader_001", socket: "color" },
@@ -1,6 +1,6 @@
1
1
  // M_Stockings as a ShaderGraph — port of shaders/materials/stockings.ts.
2
2
  // A bbox-gradient × facing-rim mask drives a Mix Shader between an HSV-boosted
3
- // emission (val 5×) and a sheen Principled. The hashed-alpha discard and the
3
+ // emission (val 5×) and a Lit layer. The hashed-alpha discard and the
4
4
  // alpha=1 output are slot-owned (see STOCKINGS_TEMPLATE in slots.ts) — the graph
5
5
  // computes only the radiance. Blender's Generated coord is approximated with UV,
6
6
  // as in the hand port. The grayscale mask feeds Mix Shader Fac through Blender's
@@ -32,17 +32,10 @@ export const STOCKINGS_GRAPH: ShaderGraph = {
32
32
  { id: "emission_hs", type: "hue_sat", inputs: { hue: 0.5, saturation: 1.0, value: 5.0, fac: 1.0 } },
33
33
  {
34
34
  id: "principled",
35
- type: "principled",
36
- inputs: {
37
- metallic: 0.1,
38
- specular_ior_level: 1.0,
39
- roughness: 0.5,
40
- spec_clamp: 1e30,
41
- sheen_weight: 0.7017999887466431,
42
- sheen_tint: 0.5,
43
- },
35
+ type: "lit",
36
+ inputs: { metallic: 0.1, smoothness: 0.2929, specular: 1.0 },
44
37
  },
45
- { id: "mix_shader_001", type: "mix_shader" },
38
+ { id: "mix_shader_001", type: "mix/blend" },
46
39
  ],
47
40
  links: [
48
41
  { from: { node: "geo", socket: "uv" }, to: { node: "map", socket: "vector" } },