@zephyr3d/scene 0.9.6 → 0.9.7

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 (203) hide show
  1. package/dist/animation/joint_dynamics/controller.js +92 -32
  2. package/dist/animation/joint_dynamics/controller.js.map +1 -1
  3. package/dist/animation/joint_dynamics/convex_collider.js +320 -0
  4. package/dist/animation/joint_dynamics/convex_collider.js.map +1 -0
  5. package/dist/animation/joint_dynamics/joint_dynamics_system.js +57 -19
  6. package/dist/animation/joint_dynamics/joint_dynamics_system.js.map +1 -1
  7. package/dist/animation/joint_dynamics/solver.js +71 -27
  8. package/dist/animation/joint_dynamics/solver.js.map +1 -1
  9. package/dist/animation/joint_dynamics_modifier.js +21 -20
  10. package/dist/animation/joint_dynamics_modifier.js.map +1 -1
  11. package/dist/animation/skeleton.js +7 -10
  12. package/dist/animation/skeleton.js.map +1 -1
  13. package/dist/app/engine.js +134 -140
  14. package/dist/app/engine.js.map +1 -1
  15. package/dist/app/scriptregistry.js +47 -16
  16. package/dist/app/scriptregistry.js.map +1 -1
  17. package/dist/asset/assetmanager.js +3 -1
  18. package/dist/asset/assetmanager.js.map +1 -1
  19. package/dist/asset/model.js +346 -7
  20. package/dist/asset/model.js.map +1 -1
  21. package/dist/avatar/wardrobe.js +20 -16
  22. package/dist/avatar/wardrobe.js.map +1 -1
  23. package/dist/camera/camera.js +416 -210
  24. package/dist/camera/camera.js.map +1 -1
  25. package/dist/index.d.ts +1349 -621
  26. package/dist/index.js +6 -11
  27. package/dist/index.js.map +1 -1
  28. package/dist/material/blinn.js +1 -1
  29. package/dist/material/blinn.js.map +1 -1
  30. package/dist/material/lambert.js +1 -1
  31. package/dist/material/lambert.js.map +1 -1
  32. package/dist/material/material.js +23 -1
  33. package/dist/material/material.js.map +1 -1
  34. package/dist/material/meshmaterial.js +178 -23
  35. package/dist/material/meshmaterial.js.map +1 -1
  36. package/dist/material/mixins/albedocolor.js +4 -4
  37. package/dist/material/mixins/albedocolor.js.map +1 -1
  38. package/dist/material/mixins/lightmodel/blinnphong.js +2 -1
  39. package/dist/material/mixins/lightmodel/blinnphong.js.map +1 -1
  40. package/dist/material/mixins/lightmodel/lambert.js +2 -1
  41. package/dist/material/mixins/lightmodel/lambert.js.map +1 -1
  42. package/dist/material/mixins/lightmodel/pbrblueprintmixin.js +63 -16
  43. package/dist/material/mixins/lightmodel/pbrblueprintmixin.js.map +1 -1
  44. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +105 -32
  45. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
  46. package/dist/material/mixins/lightmodel/pbrspecularglossness.js +16 -6
  47. package/dist/material/mixins/lightmodel/pbrspecularglossness.js.map +1 -1
  48. package/dist/material/mixins/lit.js +1 -1
  49. package/dist/material/mixins/lit.js.map +1 -1
  50. package/dist/material/mixins/pbr/common.js +276 -65
  51. package/dist/material/mixins/pbr/common.js.map +1 -1
  52. package/dist/material/mixins/texture.js +3 -3
  53. package/dist/material/mixins/texture.js.map +1 -1
  54. package/dist/material/mixins/vertexcolor.js +2 -2
  55. package/dist/material/mixins/vertexcolor.js.map +1 -1
  56. package/dist/material/mtoon.js +574 -0
  57. package/dist/material/mtoon.js.map +1 -0
  58. package/dist/material/pbrblueprint.js +499 -336
  59. package/dist/material/pbrblueprint.js.map +1 -1
  60. package/dist/material/pbrmr.js +118 -100
  61. package/dist/material/pbrmr.js.map +1 -1
  62. package/dist/material/pbrsg.js +1 -1
  63. package/dist/material/pbrsg.js.map +1 -1
  64. package/dist/material/shader/helper.js +324 -294
  65. package/dist/material/shader/helper.js.map +1 -1
  66. package/dist/material/subsurfaceprofile.js +812 -0
  67. package/dist/material/subsurfaceprofile.js.map +1 -0
  68. package/dist/material/unlit.js +1 -1
  69. package/dist/material/unlit.js.map +1 -1
  70. package/dist/posteffect/compositor.js +46 -11
  71. package/dist/posteffect/compositor.js.map +1 -1
  72. package/dist/posteffect/ssr.js +422 -96
  73. package/dist/posteffect/ssr.js.map +1 -1
  74. package/dist/posteffect/sss.js +1053 -0
  75. package/dist/posteffect/sss.js.map +1 -0
  76. package/dist/posteffect/taa.js +61 -60
  77. package/dist/posteffect/taa.js.map +1 -1
  78. package/dist/render/abuffer_oit.js +63 -12
  79. package/dist/render/abuffer_oit.js.map +1 -1
  80. package/dist/render/cluster_light.js +6 -5
  81. package/dist/render/cluster_light.js.map +1 -1
  82. package/dist/render/drawable.js +1 -5
  83. package/dist/render/drawable.js.map +1 -1
  84. package/dist/render/drawable_mixin.js +2 -1
  85. package/dist/render/drawable_mixin.js.map +1 -1
  86. package/dist/render/fbm_wavegenerator.js +2 -1
  87. package/dist/render/fbm_wavegenerator.js.map +1 -1
  88. package/dist/render/gerstner_wavegenerator.js +2 -1
  89. package/dist/render/gerstner_wavegenerator.js.map +1 -1
  90. package/dist/render/globalbindgroup_allocator.js +2 -1
  91. package/dist/render/globalbindgroup_allocator.js.map +1 -1
  92. package/dist/render/lightpass.js +110 -23
  93. package/dist/render/lightpass.js.map +1 -1
  94. package/dist/render/render_queue.js +51 -8
  95. package/dist/render/render_queue.js.map +1 -1
  96. package/dist/render/renderer.js +80 -66
  97. package/dist/render/renderer.js.map +1 -1
  98. package/dist/render/rendergraph/device_pool_allocator.js +8 -0
  99. package/dist/render/rendergraph/device_pool_allocator.js.map +1 -1
  100. package/dist/render/rendergraph/forward_plus_builder.js +481 -95
  101. package/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
  102. package/dist/render/rendergraph/history_resource_manager.js +55 -0
  103. package/dist/render/rendergraph/history_resource_manager.js.map +1 -1
  104. package/dist/render/rendergraph/history_resources.js +3 -1
  105. package/dist/render/rendergraph/history_resources.js.map +1 -1
  106. package/dist/render/rendergraph/types.js.map +1 -1
  107. package/dist/render/renderpass.js +10 -4
  108. package/dist/render/renderpass.js.map +1 -1
  109. package/dist/render/sky.js +31 -1
  110. package/dist/render/sky.js.map +1 -1
  111. package/dist/render/weightedblended_oit.js +23 -5
  112. package/dist/render/weightedblended_oit.js.map +1 -1
  113. package/dist/scene/basesprite.js +4 -2
  114. package/dist/scene/basesprite.js.map +1 -1
  115. package/dist/scene/batchgroup.js +3 -1
  116. package/dist/scene/batchgroup.js.map +1 -1
  117. package/dist/scene/environment.js +11 -1
  118. package/dist/scene/environment.js.map +1 -1
  119. package/dist/scene/light.js +21 -3
  120. package/dist/scene/light.js.map +1 -1
  121. package/dist/scene/mesh.js +29 -14
  122. package/dist/scene/mesh.js.map +1 -1
  123. package/dist/scene/meshdrawable.js +6 -0
  124. package/dist/scene/meshdrawable.js.map +1 -1
  125. package/dist/scene/msdftext.js +5 -2
  126. package/dist/scene/msdftext.js.map +1 -1
  127. package/dist/scene/msdftextsprite.js +5 -3
  128. package/dist/scene/msdftextsprite.js.map +1 -1
  129. package/dist/scene/particlesys.js +3 -1
  130. package/dist/scene/particlesys.js.map +1 -1
  131. package/dist/scene/scene.js +6 -5
  132. package/dist/scene/scene.js.map +1 -1
  133. package/dist/scene/terrain-cm/grass.js +4 -2
  134. package/dist/scene/terrain-cm/grass.js.map +1 -1
  135. package/dist/scene/terrain-cm/grassmaterial.js +2 -1
  136. package/dist/scene/terrain-cm/grassmaterial.js.map +1 -1
  137. package/dist/scene/terrain-cm/terrain-cm.js +4 -2
  138. package/dist/scene/terrain-cm/terrain-cm.js.map +1 -1
  139. package/dist/scene/water.js +4 -2
  140. package/dist/scene/water.js.map +1 -1
  141. package/dist/shaders/shadow.js +26 -393
  142. package/dist/shaders/shadow.js.map +1 -1
  143. package/dist/shadow/esm.js +112 -12
  144. package/dist/shadow/esm.js.map +1 -1
  145. package/dist/shadow/pcf_opt.js +2 -2
  146. package/dist/shadow/pcf_opt.js.map +1 -1
  147. package/dist/shadow/pcf_pd.js +19 -10
  148. package/dist/shadow/pcf_pd.js.map +1 -1
  149. package/dist/shadow/shader.js +58 -7
  150. package/dist/shadow/shader.js.map +1 -1
  151. package/dist/shadow/shadow_impl.js +6 -0
  152. package/dist/shadow/shadow_impl.js.map +1 -1
  153. package/dist/shadow/shadow_region.js +229 -0
  154. package/dist/shadow/shadow_region.js.map +1 -0
  155. package/dist/shadow/shadowmapper.js +67 -59
  156. package/dist/shadow/shadowmapper.js.map +1 -1
  157. package/dist/shadow/vsm.js +45 -19
  158. package/dist/shadow/vsm.js.map +1 -1
  159. package/dist/utility/blueprint/common/constants.js +8 -8
  160. package/dist/utility/blueprint/common/constants.js.map +1 -1
  161. package/dist/utility/blueprint/material/pbr.js +31 -4
  162. package/dist/utility/blueprint/material/pbr.js.map +1 -1
  163. package/dist/utility/blueprint/material/texture.js +1 -17
  164. package/dist/utility/blueprint/material/texture.js.map +1 -1
  165. package/dist/utility/serialization/manager.js +327 -359
  166. package/dist/utility/serialization/manager.js.map +1 -1
  167. package/dist/utility/serialization/scene/animation.js +5 -2
  168. package/dist/utility/serialization/scene/animation.js.map +1 -1
  169. package/dist/utility/serialization/scene/batch.js +4 -1
  170. package/dist/utility/serialization/scene/batch.js.map +1 -1
  171. package/dist/utility/serialization/scene/camera.js +249 -54
  172. package/dist/utility/serialization/scene/camera.js.map +1 -1
  173. package/dist/utility/serialization/scene/common.js +37 -1
  174. package/dist/utility/serialization/scene/common.js.map +1 -1
  175. package/dist/utility/serialization/scene/light.js +42 -3
  176. package/dist/utility/serialization/scene/light.js.map +1 -1
  177. package/dist/utility/serialization/scene/material.js +1112 -646
  178. package/dist/utility/serialization/scene/material.js.map +1 -1
  179. package/dist/utility/serialization/scene/mesh.js +7 -4
  180. package/dist/utility/serialization/scene/mesh.js.map +1 -1
  181. package/dist/utility/serialization/scene/node.js +31 -12
  182. package/dist/utility/serialization/scene/node.js.map +1 -1
  183. package/dist/utility/serialization/scene/particle.js +4 -1
  184. package/dist/utility/serialization/scene/particle.js.map +1 -1
  185. package/dist/utility/serialization/scene/primitive.js +3 -1
  186. package/dist/utility/serialization/scene/primitive.js.map +1 -1
  187. package/dist/utility/serialization/scene/scene.js +18 -0
  188. package/dist/utility/serialization/scene/scene.js.map +1 -1
  189. package/dist/utility/serialization/scene/sprite.js +6 -3
  190. package/dist/utility/serialization/scene/sprite.js.map +1 -1
  191. package/dist/utility/serialization/scene/terrain.js +5 -2
  192. package/dist/utility/serialization/scene/terrain.js.map +1 -1
  193. package/dist/utility/serialization/scene/text.js +3 -1
  194. package/dist/utility/serialization/scene/text.js.map +1 -1
  195. package/dist/utility/serialization/scene/water.js +4 -1
  196. package/dist/utility/serialization/scene/water.js.map +1 -1
  197. package/dist/utility/textures/ltcdata.js +6 -0
  198. package/dist/utility/textures/ltcdata.js.map +1 -0
  199. package/dist/utility/textures/ltclut.js +61 -0
  200. package/dist/utility/textures/ltclut.js.map +1 -0
  201. package/dist/values.js +9 -1
  202. package/dist/values.js.map +1 -1
  203. package/package.json +3 -3
@@ -17,6 +17,8 @@ import { BaseGraphNode } from '../node.js';
17
17
  * - **Normal**: Surface normal in tangent/world space (for bump/normal mapping)
18
18
  * - **Tangent**: Surface tangent vector (for anisotropic effects)
19
19
  * - **Opacity**: Surface transparency (0 = fully transparent, 1 = fully opaque)
20
+ * - **SpecularWeight**: Scalar weight for the specular lobe
21
+ * - **AO**: Ambient occlusion multiplier
20
22
  *
21
23
  * All inputs are optional and have sensible defaults. Only the inputs you connect
22
24
  * will override the default values.
@@ -82,14 +84,16 @@ import { BaseGraphNode } from '../node.js';
82
84
  * Creates a new PBR material output node
83
85
  *
84
86
  * @remarks
85
- * Initializes with 8 input slots for all PBR material properties.
87
+ * Initializes with the full surface input set consumed by the PBR metallic-roughness backend.
88
+ * Existing slot ids are preserved for backward compatibility with saved `.zbpt` graphs,
89
+ * and new inputs are appended at the end.
86
90
  * Each input has:
87
91
  * - Flexible type acceptance (float can expand to vec3/vec4, etc.)
88
92
  * - Default values for when no connection is made
89
93
  * - Origin type that defines the expected canonical type
90
94
  *
91
95
  * Default values provide a reasonable starting material:
92
- * - White base color (1, 1, 1, 1)
96
+ * - White base color (1, 1, 1)
93
97
  * - Fully metallic (1.0)
94
98
  * - Fully rough (1.0)
95
99
  * - White specular (1, 1, 1)
@@ -97,6 +101,8 @@ import { BaseGraphNode } from '../node.js';
97
101
  * - Default surface normal (from vertex data)
98
102
  * - Default tangent (from vertex data)
99
103
  * - Fully opaque (1.0)
104
+ * - Full specular weight (1)
105
+ * - Full AO (1)
100
106
  */ constructor(){
101
107
  super();
102
108
  this._inputs = [
@@ -110,12 +116,11 @@ import { BaseGraphNode } from '../node.js';
110
116
  'vec4'
111
117
  ],
112
118
  defaultValue: [
113
- 1,
114
119
  1,
115
120
  1,
116
121
  1
117
122
  ],
118
- originType: 'vec4'
123
+ originType: 'vec3'
119
124
  },
120
125
  {
121
126
  id: 2,
@@ -198,6 +203,28 @@ import { BaseGraphNode } from '../node.js';
198
203
  1
199
204
  ],
200
205
  originType: 'float'
206
+ },
207
+ {
208
+ id: 9,
209
+ name: 'SpecularWeight',
210
+ type: [
211
+ 'float'
212
+ ],
213
+ defaultValue: [
214
+ 1
215
+ ],
216
+ originType: 'float'
217
+ },
218
+ {
219
+ id: 10,
220
+ name: 'AO',
221
+ type: [
222
+ 'float'
223
+ ],
224
+ defaultValue: [
225
+ 1
226
+ ],
227
+ originType: 'float'
201
228
  }
202
229
  ];
203
230
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pbr.js","sources":["../../../../src/utility/blueprint/material/pbr.ts"],"sourcesContent":["import type { SerializableClass } from '../../serialization';\r\nimport { BaseGraphNode } from '../node';\r\n\r\n/**\r\n * PBR (Physically Based Rendering) material output node\r\n *\r\n * @remarks\r\n * This is the final output node for PBR materials in the material blueprint graph.\r\n * It defines the complete surface properties using the metallic-roughness workflow,\r\n * which is the industry-standard approach for physically-based materials.\r\n *\r\n * The node accepts all essential PBR material properties:\r\n * - **BaseColor**: The diffuse/albedo color of the surface (what color the surface is)\r\n * - **Metallic**: Whether the surface is metallic (0 = dielectric/non-metal, 1 = metal)\r\n * - **Roughness**: How rough/smooth the surface is (0 = mirror smooth, 1 = completely rough)\r\n * - **Specular**: Controls specular reflectance for dielectrics (non-metals)\r\n * - **Emissive**: Light emitted by the surface (for glowing effects)\r\n * - **Normal**: Surface normal in tangent/world space (for bump/normal mapping)\r\n * - **Tangent**: Surface tangent vector (for anisotropic effects)\r\n * - **Opacity**: Surface transparency (0 = fully transparent, 1 = fully opaque)\r\n *\r\n * All inputs are optional and have sensible defaults. Only the inputs you connect\r\n * will override the default values.\r\n *\r\n * Material workflow:\r\n * 1. Connect texture samples and math nodes to the various inputs\r\n * 2. The shader compiler will generate appropriate PBR lighting code\r\n * 3. The material will respond correctly to scene lighting\r\n *\r\n * @example\r\n * ```typescript\r\n * const output = new PBRBlockNode();\r\n *\r\n * // Basic textured material\r\n * const albedoTex = new TextureSampleNode();\r\n * output.connectInput(1, albedoTex, 1); // BaseColor from texture\r\n *\r\n * // Metal/rough workflow\r\n * const metallicTex = new TextureSampleNode();\r\n * const roughnessTex = new TextureSampleNode();\r\n * output.connectInput(2, metallicTex, 2); // Metallic from R channel\r\n * output.connectInput(3, roughnessTex, 2); // Roughness from R channel\r\n *\r\n * // Normal mapping\r\n * const normalMap = new TextureSampleNode();\r\n * output.connectInput(6, normalMap, 1); // Normal from RGB\r\n *\r\n * // Emissive glow\r\n * const emissiveColor = new ConstantVec3Node();\r\n * emissiveColor.x = 1.0; // Red glow\r\n * output.connectInput(5, emissiveColor, 1);\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Advanced material with procedural roughness variation\r\n * const output = new PBRBlockNode();\r\n *\r\n * const baseColor = new ConstantVec3Node();\r\n * baseColor.x = 0.8; baseColor.y = 0.2; baseColor.z = 0.1; // Orange\r\n * output.connectInput(1, baseColor, 1);\r\n *\r\n * // Procedural roughness pattern\r\n * const uv = new VertexUVNode();\r\n * const noise = new NoiseNode();\r\n * noise.connectInput(1, uv, 1);\r\n *\r\n * const roughness = new MixNode();\r\n * roughness.connectInput(1, constant0_3, 1); // Min roughness 0.3\r\n * roughness.connectInput(2, constant0_8, 1); // Max roughness 0.8\r\n * roughness.connectInput(3, noise, 1); // Blend factor\r\n * output.connectInput(3, roughness, 1);\r\n *\r\n * // Non-metallic\r\n * const metallic = new ConstantScalarNode();\r\n * metallic.x = 0.0;\r\n * output.connectInput(2, metallic, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class PBRBlockNode extends BaseGraphNode {\r\n /**\r\n * Creates a new PBR material output node\r\n *\r\n * @remarks\r\n * Initializes with 8 input slots for all PBR material properties.\r\n * Each input has:\r\n * - Flexible type acceptance (float can expand to vec3/vec4, etc.)\r\n * - Default values for when no connection is made\r\n * - Origin type that defines the expected canonical type\r\n *\r\n * Default values provide a reasonable starting material:\r\n * - White base color (1, 1, 1, 1)\r\n * - Fully metallic (1.0)\r\n * - Fully rough (1.0)\r\n * - White specular (1, 1, 1)\r\n * - No emission (0, 0, 0)\r\n * - Default surface normal (from vertex data)\r\n * - Default tangent (from vertex data)\r\n * - Fully opaque (1.0)\r\n */\r\n constructor() {\r\n super();\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'BaseColor',\r\n type: ['float', 'vec2', 'vec3', 'vec4'],\r\n defaultValue: [1, 1, 1, 1],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 2,\r\n name: 'Metallic',\r\n type: ['float'],\r\n defaultValue: [1],\r\n originType: 'float'\r\n },\r\n {\r\n id: 3,\r\n name: 'Roughness',\r\n type: ['float'],\r\n defaultValue: [1],\r\n originType: 'float'\r\n },\r\n {\r\n id: 4,\r\n name: 'Specular',\r\n type: ['float', 'vec2', 'vec3', 'vec4'],\r\n defaultValue: [1, 1, 1],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 5,\r\n name: 'Emissive',\r\n type: ['float', 'vec2', 'vec3', 'vec4'],\r\n defaultValue: [0, 0, 0],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 6,\r\n name: 'Normal',\r\n type: ['vec3', 'vec4'],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 7,\r\n name: 'Tangent',\r\n type: ['vec3'],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 8,\r\n name: 'Opacity',\r\n type: ['float'],\r\n defaultValue: [1],\r\n originType: 'float'\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * No additional properties need to be serialized beyond the base node data\r\n * and input connections.\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: PBRBlockNode,\r\n name: 'PBRBlockNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'Output'\r\n *\r\n * @remarks\r\n * This node is typically labeled \"Output\" in the material editor UI\r\n * as it represents the final material output.\r\n */\r\n toString(): string {\r\n return 'Output';\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * The PBR output node is always valid because:\r\n * - All inputs are optional (have default values)\r\n * - Type conversions are handled automatically (float → vec3, etc.)\r\n * - It's the terminal node with no type inference requirements\r\n */\r\n protected validate(): string {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns Empty string (no outputs)\r\n *\r\n * @remarks\r\n * As a terminal output node, PBRBlockNode has no outputs.\r\n * It consumes the material graph data and provides it to the renderer.\r\n */\r\n protected getType(): string {\r\n return '';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex output node\r\n *\r\n * @public\r\n */\r\nexport class VertexBlockNode extends BaseGraphNode {\r\n constructor() {\r\n super();\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'Position',\r\n type: ['vec3'],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 2,\r\n name: 'Normal',\r\n type: ['vec3'],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 3,\r\n name: 'Tangent',\r\n type: ['vec4'],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 4,\r\n name: 'Color',\r\n type: ['vec4'],\r\n defaultValue: [1, 1, 1, 1],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 5,\r\n name: 'UV',\r\n type: ['vec2'],\r\n originType: 'vec2'\r\n },\r\n {\r\n id: 6,\r\n name: 'Output1',\r\n type: ['vec4'],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 7,\r\n name: 'Output2',\r\n type: ['vec4'],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 8,\r\n name: 'Output3',\r\n type: ['vec4'],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 9,\r\n name: 'Output4',\r\n type: ['vec4'],\r\n originType: 'vec4'\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * No additional properties need to be serialized beyond the base node data\r\n * and input connections.\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: VertexBlockNode,\r\n name: 'VertexBlockNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'Output'\r\n *\r\n * @remarks\r\n * This node is typically labeled \"Output\" in the material editor UI\r\n * as it represents the final material output.\r\n */\r\n toString(): string {\r\n return 'VertexOutput';\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * The PBR output node is always valid because:\r\n * - All inputs are optional (have default values)\r\n * - Type conversions are handled automatically (float → vec3, etc.)\r\n * - It's the terminal node with no type inference requirements\r\n */\r\n protected validate(): string {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns Empty string (no outputs)\r\n *\r\n * @remarks\r\n * As a terminal output node, PBRBlockNode has no outputs.\r\n * It consumes the material graph data and provides it to the renderer.\r\n */\r\n protected getType(): string {\r\n return '';\r\n }\r\n}\r\n\r\n/**\r\n * Sprite material output node\r\n *\r\n * @public\r\n */\r\nexport class SpriteBlockNode extends BaseGraphNode {\r\n /**\r\n * Creates a new Sprite material output node\r\n */\r\n constructor() {\r\n super();\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'Color',\r\n type: ['float', 'vec2', 'vec3', 'vec4'],\r\n defaultValue: [1, 1, 1, 1],\r\n originType: 'vec4'\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * No additional properties need to be serialized beyond the base node data\r\n * and input connections.\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: SpriteBlockNode,\r\n name: 'SpriteBlockNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'Output'\r\n *\r\n * @remarks\r\n * This node is typically labeled \"Output\" in the material editor UI\r\n * as it represents the final material output.\r\n */\r\n toString(): string {\r\n return 'Output';\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * The PBR output node is always valid because:\r\n * - All inputs are optional (have default values)\r\n * - Type conversions are handled automatically (float → vec3, etc.)\r\n * - It's the terminal node with no type inference requirements\r\n */\r\n protected validate(): string {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns Empty string (no outputs)\r\n *\r\n * @remarks\r\n * As a terminal output node, PBRBlockNode has no outputs.\r\n * It consumes the material graph data and provides it to the renderer.\r\n */\r\n protected getType(): string {\r\n return '';\r\n }\r\n}\r\n"],"names":["PBRBlockNode","BaseGraphNode","_inputs","id","name","type","defaultValue","originType","getSerializationCls","ctor","getProps","toString","VertexBlockNode","SpriteBlockNode"],"mappings":";;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8EO,MAAMA,YAAqBC,SAAAA,aAAAA,CAAAA;AAChC;;;;;;;;;;;;;;;;;;;AAmBC,MACD,WAAc,EAAA;QACZ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,OAAO;YACLC,IAAMG,EAAAA,eAAAA;YACNR,IAAM,EAAA,iBAAA;AACNM,YAAAA,QAAAA,CAAAA,GAAAA;AACE,gBAAA,OAAO,EAAE;AACX;AACF,SAAA;AACF;AACA;;;;;;;;AAQC,MACDC,QAAmB,GAAA;QACjB,OAAO,cAAA;AACT;AACA;;;;;;;;;;AAUC,MACD,QAA6B,GAAA;QAC3B,OAAO,EAAA;AACT;AACA;;;;;;;;AAQC,MACD,OAA4B,GAAA;QAC1B,OAAO,EAAA;AACT;AACF;AAEA;;;;IAKO,MAAME,eAAwBZ,SAAAA,aAAAA,CAAAA;AACnC;;AAEC,MACD,WAAc,EAAA;QACZ,KAAK,EAAA;QACL,IAAI,CAACC,OAAO,GAAG;AACb,YAAA;gBACEC,EAAI,EAAA,CAAA;gBACJC,IAAM,EAAA,OAAA;gBACNC,IAAM,EAAA;AAAC,oBAAA,OAAA;AAAS,oBAAA,MAAA;AAAQ,oBAAA,MAAA;AAAQ,oBAAA;AAAO,iBAAA;gBACvCC,YAAc,EAAA;AAAC,oBAAA,CAAA;AAAG,oBAAA,CAAA;AAAG,oBAAA,CAAA;AAAG,oBAAA;AAAE,iBAAA;gBAC1BC,UAAY,EAAA;AACd;AACD,SAAA;AACH;AACA;;;;;;;;AAQC,MACD,OAAOC,mBAAyC,GAAA;QAC9C,OAAO;YACLC,IAAMI,EAAAA,eAAAA;YACNT,IAAM,EAAA,iBAAA;AACNM,YAAAA,QAAAA,CAAAA,GAAAA;AACE,gBAAA,OAAO,EAAE;AACX;AACF,SAAA;AACF;AACA;;;;;;;;AAQC,MACDC,QAAmB,GAAA;QACjB,OAAO,QAAA;AACT;AACA;;;;;;;;;;AAUC,MACD,QAA6B,GAAA;QAC3B,OAAO,EAAA;AACT;AACA;;;;;;;;AAQC,MACD,OAA4B,GAAA;QAC1B,OAAO,EAAA;AACT;AACF;;;;"}
1
+ {"version":3,"file":"pbr.js","sources":["../../../../src/utility/blueprint/material/pbr.ts"],"sourcesContent":["import type { SerializableClass } from '../../serialization';\r\nimport { BaseGraphNode } from '../node';\r\n\r\n/**\r\n * PBR (Physically Based Rendering) material output node\r\n *\r\n * @remarks\r\n * This is the final output node for PBR materials in the material blueprint graph.\r\n * It defines the complete surface properties using the metallic-roughness workflow,\r\n * which is the industry-standard approach for physically-based materials.\r\n *\r\n * The node accepts all essential PBR material properties:\r\n * - **BaseColor**: The diffuse/albedo color of the surface (what color the surface is)\r\n * - **Metallic**: Whether the surface is metallic (0 = dielectric/non-metal, 1 = metal)\r\n * - **Roughness**: How rough/smooth the surface is (0 = mirror smooth, 1 = completely rough)\r\n * - **Specular**: Controls specular reflectance for dielectrics (non-metals)\r\n * - **Emissive**: Light emitted by the surface (for glowing effects)\r\n * - **Normal**: Surface normal in tangent/world space (for bump/normal mapping)\r\n * - **Tangent**: Surface tangent vector (for anisotropic effects)\r\n * - **Opacity**: Surface transparency (0 = fully transparent, 1 = fully opaque)\r\n * - **SpecularWeight**: Scalar weight for the specular lobe\r\n * - **AO**: Ambient occlusion multiplier\r\n *\r\n * All inputs are optional and have sensible defaults. Only the inputs you connect\r\n * will override the default values.\r\n *\r\n * Material workflow:\r\n * 1. Connect texture samples and math nodes to the various inputs\r\n * 2. The shader compiler will generate appropriate PBR lighting code\r\n * 3. The material will respond correctly to scene lighting\r\n *\r\n * @example\r\n * ```typescript\r\n * const output = new PBRBlockNode();\r\n *\r\n * // Basic textured material\r\n * const albedoTex = new TextureSampleNode();\r\n * output.connectInput(1, albedoTex, 1); // BaseColor from texture\r\n *\r\n * // Metal/rough workflow\r\n * const metallicTex = new TextureSampleNode();\r\n * const roughnessTex = new TextureSampleNode();\r\n * output.connectInput(2, metallicTex, 2); // Metallic from R channel\r\n * output.connectInput(3, roughnessTex, 2); // Roughness from R channel\r\n *\r\n * // Normal mapping\r\n * const normalMap = new TextureSampleNode();\r\n * output.connectInput(6, normalMap, 1); // Normal from RGB\r\n *\r\n * // Emissive glow\r\n * const emissiveColor = new ConstantVec3Node();\r\n * emissiveColor.x = 1.0; // Red glow\r\n * output.connectInput(5, emissiveColor, 1);\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Advanced material with procedural roughness variation\r\n * const output = new PBRBlockNode();\r\n *\r\n * const baseColor = new ConstantVec3Node();\r\n * baseColor.x = 0.8; baseColor.y = 0.2; baseColor.z = 0.1; // Orange\r\n * output.connectInput(1, baseColor, 1);\r\n *\r\n * // Procedural roughness pattern\r\n * const uv = new VertexUVNode();\r\n * const noise = new NoiseNode();\r\n * noise.connectInput(1, uv, 1);\r\n *\r\n * const roughness = new MixNode();\r\n * roughness.connectInput(1, constant0_3, 1); // Min roughness 0.3\r\n * roughness.connectInput(2, constant0_8, 1); // Max roughness 0.8\r\n * roughness.connectInput(3, noise, 1); // Blend factor\r\n * output.connectInput(3, roughness, 1);\r\n *\r\n * // Non-metallic\r\n * const metallic = new ConstantScalarNode();\r\n * metallic.x = 0.0;\r\n * output.connectInput(2, metallic, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class PBRBlockNode extends BaseGraphNode {\r\n /**\r\n * Creates a new PBR material output node\r\n *\r\n * @remarks\r\n * Initializes with the full surface input set consumed by the PBR metallic-roughness backend.\r\n * Existing slot ids are preserved for backward compatibility with saved `.zbpt` graphs,\r\n * and new inputs are appended at the end.\r\n * Each input has:\r\n * - Flexible type acceptance (float can expand to vec3/vec4, etc.)\r\n * - Default values for when no connection is made\r\n * - Origin type that defines the expected canonical type\r\n *\r\n * Default values provide a reasonable starting material:\r\n * - White base color (1, 1, 1)\r\n * - Fully metallic (1.0)\r\n * - Fully rough (1.0)\r\n * - White specular (1, 1, 1)\r\n * - No emission (0, 0, 0)\r\n * - Default surface normal (from vertex data)\r\n * - Default tangent (from vertex data)\r\n * - Fully opaque (1.0)\r\n * - Full specular weight (1)\r\n * - Full AO (1)\r\n */\r\n constructor() {\r\n super();\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'BaseColor',\r\n type: ['float', 'vec2', 'vec3', 'vec4'],\r\n defaultValue: [1, 1, 1],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 2,\r\n name: 'Metallic',\r\n type: ['float'],\r\n defaultValue: [1],\r\n originType: 'float'\r\n },\r\n {\r\n id: 3,\r\n name: 'Roughness',\r\n type: ['float'],\r\n defaultValue: [1],\r\n originType: 'float'\r\n },\r\n {\r\n id: 4,\r\n name: 'Specular',\r\n type: ['float', 'vec2', 'vec3', 'vec4'],\r\n defaultValue: [1, 1, 1],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 5,\r\n name: 'Emissive',\r\n type: ['float', 'vec2', 'vec3', 'vec4'],\r\n defaultValue: [0, 0, 0],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 6,\r\n name: 'Normal',\r\n type: ['vec3', 'vec4'],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 7,\r\n name: 'Tangent',\r\n type: ['vec3'],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 8,\r\n name: 'Opacity',\r\n type: ['float'],\r\n defaultValue: [1],\r\n originType: 'float'\r\n },\r\n {\r\n id: 9,\r\n name: 'SpecularWeight',\r\n type: ['float'],\r\n defaultValue: [1],\r\n originType: 'float'\r\n },\r\n {\r\n id: 10,\r\n name: 'AO',\r\n type: ['float'],\r\n defaultValue: [1],\r\n originType: 'float'\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * No additional properties need to be serialized beyond the base node data\r\n * and input connections.\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: PBRBlockNode,\r\n name: 'PBRBlockNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'Output'\r\n *\r\n * @remarks\r\n * This node is typically labeled \"Output\" in the material editor UI\r\n * as it represents the final material output.\r\n */\r\n toString(): string {\r\n return 'Output';\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * The PBR output node is always valid because:\r\n * - All inputs are optional (have default values)\r\n * - Type conversions are handled automatically (float → vec3, etc.)\r\n * - It's the terminal node with no type inference requirements\r\n */\r\n protected validate(): string {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns Empty string (no outputs)\r\n *\r\n * @remarks\r\n * As a terminal output node, PBRBlockNode has no outputs.\r\n * It consumes the material graph data and provides it to the renderer.\r\n */\r\n protected getType(): string {\r\n return '';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex output node\r\n *\r\n * @public\r\n */\r\nexport class VertexBlockNode extends BaseGraphNode {\r\n constructor() {\r\n super();\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'Position',\r\n type: ['vec3'],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 2,\r\n name: 'Normal',\r\n type: ['vec3'],\r\n originType: 'vec3'\r\n },\r\n {\r\n id: 3,\r\n name: 'Tangent',\r\n type: ['vec4'],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 4,\r\n name: 'Color',\r\n type: ['vec4'],\r\n defaultValue: [1, 1, 1, 1],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 5,\r\n name: 'UV',\r\n type: ['vec2'],\r\n originType: 'vec2'\r\n },\r\n {\r\n id: 6,\r\n name: 'Output1',\r\n type: ['vec4'],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 7,\r\n name: 'Output2',\r\n type: ['vec4'],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 8,\r\n name: 'Output3',\r\n type: ['vec4'],\r\n originType: 'vec4'\r\n },\r\n {\r\n id: 9,\r\n name: 'Output4',\r\n type: ['vec4'],\r\n originType: 'vec4'\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * No additional properties need to be serialized beyond the base node data\r\n * and input connections.\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: VertexBlockNode,\r\n name: 'VertexBlockNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'Output'\r\n *\r\n * @remarks\r\n * This node is typically labeled \"Output\" in the material editor UI\r\n * as it represents the final material output.\r\n */\r\n toString(): string {\r\n return 'VertexOutput';\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * The PBR output node is always valid because:\r\n * - All inputs are optional (have default values)\r\n * - Type conversions are handled automatically (float → vec3, etc.)\r\n * - It's the terminal node with no type inference requirements\r\n */\r\n protected validate(): string {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns Empty string (no outputs)\r\n *\r\n * @remarks\r\n * As a terminal output node, PBRBlockNode has no outputs.\r\n * It consumes the material graph data and provides it to the renderer.\r\n */\r\n protected getType(): string {\r\n return '';\r\n }\r\n}\r\n\r\n/**\r\n * Sprite material output node\r\n *\r\n * @public\r\n */\r\nexport class SpriteBlockNode extends BaseGraphNode {\r\n /**\r\n * Creates a new Sprite material output node\r\n */\r\n constructor() {\r\n super();\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'Color',\r\n type: ['float', 'vec2', 'vec3', 'vec4'],\r\n defaultValue: [1, 1, 1, 1],\r\n originType: 'vec4'\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * No additional properties need to be serialized beyond the base node data\r\n * and input connections.\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: SpriteBlockNode,\r\n name: 'SpriteBlockNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'Output'\r\n *\r\n * @remarks\r\n * This node is typically labeled \"Output\" in the material editor UI\r\n * as it represents the final material output.\r\n */\r\n toString(): string {\r\n return 'Output';\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * The PBR output node is always valid because:\r\n * - All inputs are optional (have default values)\r\n * - Type conversions are handled automatically (float → vec3, etc.)\r\n * - It's the terminal node with no type inference requirements\r\n */\r\n protected validate(): string {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns Empty string (no outputs)\r\n *\r\n * @remarks\r\n * As a terminal output node, PBRBlockNode has no outputs.\r\n * It consumes the material graph data and provides it to the renderer.\r\n */\r\n protected getType(): string {\r\n return '';\r\n }\r\n}\r\n"],"names":["PBRBlockNode","BaseGraphNode","_inputs","id","name","type","defaultValue","originType","getSerializationCls","ctor","getProps","toString","VertexBlockNode","SpriteBlockNode"],"mappings":";;AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgFO,MAAMA,YAAqBC,SAAAA,aAAAA,CAAAA;AAChC;;;;;;;;;;;;;;;;;;;;;;;AAuBC,MACD,WAAc,EAAA;QACZ,KAAK,EAAA;QACL,IAAI,CAACC,OAAO,GAAG;AACb,YAAA;gBACEC,EAAI,EAAA,CAAA;gBACJC,IAAM,EAAA,WAAA;gBACNC,IAAM,EAAA;AAAC,oBAAA,OAAA;AAAS,oBAAA,MAAA;AAAQ,oBAAA,MAAA;AAAQ,oBAAA;AAAO,iBAAA;gBACvCC,YAAc,EAAA;AAAC,oBAAA,CAAA;AAAG,oBAAA,CAAA;AAAG,oBAAA;AAAE,iBAAA;gBACvBC,UAAY,EAAA;AACd,aAAA;AACA,YAAA;gBACEJ,EAAI,EAAA,CAAA;gBACJC,IAAM,EAAA,UAAA;gBACNC,IAAM,EAAA;AAAC,oBAAA;AAAQ,iBAAA;gBACfC,YAAc,EAAA;AAAC,oBAAA;AAAE,iBAAA;gBACjBC,U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;AACA;;;;;;;;AAQC,MACDC,QAAmB,GAAA;QACjB,OAAO,cAAA;AACT;AACA;;;;;;;;;;AAUC,MACD,QAA6B,GAAA;QAC3B,OAAO,EAAA;AACT;AACA;;;;;;;;AAQC,MACD,OAA4B,GAAA;QAC1B,OAAO,EAAA;AACT;AACF;AAEA;;;;IAKO,MAAME,eAAwBZ,SAAAA,aAAAA,CAAAA;AACnC;;AAEC,MACD,WAAc,EAAA;QACZ,KAAK,EAAA;QACL,IAAI,CAACC,OAAO,GAAG;AACb,YAAA;gBACEC,EAAI,EAAA,CAAA;gBACJC,IAAM,EAAA,OAAA;gBACNC,IAAM,EAAA;AAAC,oBAAA,OAAA;AAAS,oBAAA,MAAA;AAAQ,oBAAA,MAAA;AAAQ,oBAAA;AAAO,iBAAA;gBACvCC,YAAc,EAAA;AAAC,oBAAA,CAAA;AAAG,oBAAA,CAAA;AAAG,oBAAA,CAAA;AAAG,oBAAA;AAAE,iBAAA;gBAC1BC,UAAY,EAAA;AACd;AACD,SAAA;AACH;AACA;;;;;;;;AAQC,MACD,OAAOC,mBAAyC,GAAA;QAC9C,OAAO;YACLC,IAAMI,EAAAA,eAAAA;YACNT,IAAM,EAAA,iBAAA;AACNM,YAAAA,QAAAA,CAAAA,GAAAA;AACE,gBAAA,OAAO,EAAE;AACX;AACF,SAAA;AACF;AACA;;;;;;;;AAQC,MACDC,QAAmB,GAAA;QACjB,OAAO,QAAA;AACT;AACA;;;;;;;;;;AAUC,MACD,QAA6B,GAAA;QAC3B,OAAO,EAAA;AACT;AACA;;;;;;;;AAQC,MACD,OAA4B,GAAA;QAC1B,OAAO,EAAA;AACT;AACF;;;;"}
@@ -1076,23 +1076,7 @@ import { defineProps } from '../../serialization/types.js';
1076
1076
  name: 'TextureSampleNode',
1077
1077
  getProps () {
1078
1078
  return defineProps([
1079
- {
1080
- name: 'Name',
1081
- type: 'string',
1082
- isNullable () {
1083
- return false;
1084
- },
1085
- get (value) {
1086
- value.str[0] = this.paramName ? this.paramName.slice(2) : '';
1087
- },
1088
- set (value) {
1089
- if (!/^[A-Za-z0-9_]+$/.test(value.str[0])) {
1090
- console.log(`Invalid parameter name: ${value.str[0]}`);
1091
- } else {
1092
- this.paramName = `u_${value.str[0]}`;
1093
- }
1094
- }
1095
- },
1079
+ ...textureNodeProps,
1096
1080
  {
1097
1081
  name: 'SamplerType',
1098
1082
  type: 'string',
@@ -1 +1 @@
1
- {"version":3,"file":"texture.js","sources":["../../../../src/utility/blueprint/material/texture.ts"],"sourcesContent":["import { BaseGraphNode } from '../node';\r\nimport { getParamName } from '../common';\r\nimport type {\r\n Texture2D,\r\n Texture2DArray,\r\n TextureAddressMode,\r\n TextureCube,\r\n TextureFilterMode\r\n} from '@zephyr3d/device';\r\nimport { DRef } from '@zephyr3d/base';\r\nimport { getDevice } from '../../../app/api';\r\nimport { defineProps, type PropertyAccessor, type SerializableClass } from '../../serialization/types';\r\n\r\n/**\r\n * Default 1x1 white 2D texture reference\r\n * @internal\r\n */\r\nconst defaultTexture2D: DRef<Texture2D> = new DRef();\r\n\r\n/**\r\n * Default 1x1 white cubemap texture reference\r\n * @internal\r\n */\r\nconst defaultTextureCube: DRef<TextureCube> = new DRef();\r\n\r\n/**\r\n * Default 1x1 white 2D array texture reference\r\n * @internal\r\n */\r\nconst defaultTexture2DArray: DRef<Texture2DArray> = new DRef();\r\n\r\n/**\r\n * Gets or creates the default 2D texture\r\n *\r\n * @remarks\r\n * Returns a 1x1 white (255, 255, 255, 255) texture used as a fallback\r\n * when no texture is assigned to a texture node.\r\n *\r\n * @returns A 1x1 white Texture2D instance\r\n *\r\n * @internal\r\n */\r\nexport function getDefaultTexture2D(): Texture2D {\r\n if (!defaultTexture2D.get()) {\r\n const defaultTex = getDevice().createTexture2D('rgba8unorm', 1, 1, {\r\n mipmapping: false\r\n })!;\r\n defaultTex.update(new Uint8Array([255, 255, 255, 255]), 0, 0, 1, 1);\r\n defaultTexture2D.set(defaultTex);\r\n }\r\n return defaultTexture2D.get()!;\r\n}\r\n\r\n/**\r\n * Gets or creates the default 2D array texture\r\n *\r\n * @remarks\r\n * Returns a 1x1x1 white (255, 255, 255, 255) array texture used as a fallback\r\n * when no texture is assigned to a 2D array texture node.\r\n *\r\n * @returns A 1x1x1 white Texture2DArray instance\r\n *\r\n * @internal\r\n */\r\nexport function getDefaultTexture2DArray(): Texture2DArray {\r\n if (!defaultTexture2DArray.get()) {\r\n const defaultTex = getDevice().createTexture2DArray('rgba8unorm', 1, 1, 1, {\r\n mipmapping: false\r\n })!;\r\n defaultTex.update(new Uint8Array([255, 255, 255, 255]), 0, 0, 0, 1, 1, 1);\r\n defaultTexture2DArray.set(defaultTex);\r\n }\r\n return defaultTexture2DArray.get()!;\r\n}\r\n\r\n/**\r\n * Gets or creates the default cubemap texture\r\n *\r\n * @remarks\r\n * Returns a 1x1 white (255, 255, 255, 255) cubemap texture (all 6 faces white)\r\n * used as a fallback when no texture is assigned to a cubemap texture node.\r\n *\r\n * @returns A 1x1 white TextureCube instance\r\n *\r\n * @internal\r\n */\r\nexport function getDefaultTextureCube(): TextureCube {\r\n if (!defaultTextureCube.get()) {\r\n const defaultTex = getDevice().createCubeTexture('rgba8unorm', 1, {\r\n mipmapping: false\r\n })!;\r\n for (let i = 0; i < 6; i++) {\r\n defaultTex.update(new Uint8Array([255, 255, 255, 255]), 0, 0, 1, 1, i);\r\n }\r\n defaultTextureCube.set(defaultTex);\r\n }\r\n return defaultTextureCube.get()!;\r\n}\r\n\r\n/**\r\n * Common property descriptors for texture nodes\r\n *\r\n * @remarks\r\n * Defines serialization properties shared by all texture node types:\r\n * - Name: Shader parameter name for the texture uniform\r\n * - sRGB: Whether texture should be loaded into sRGB color space\r\n * - AddressU: Horizontal texture wrapping mode\r\n * - AddressV: Vertical texture wrapping mode\r\n * - MinFilter: Minification filter mode\r\n * - MagFilter: Magnification filter mode\r\n * - MipFilter: Mipmap filter mode\r\n *\r\n * @internal\r\n */\r\nconst textureNodeProps = (function getTextureNodeProps(): PropertyAccessor<BaseTextureNode>[] {\r\n return defineProps([\r\n {\r\n name: 'Name',\r\n type: 'string',\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.paramName ? this.paramName.slice(2) : '';\r\n },\r\n set(this: BaseTextureNode, value) {\r\n if (!/^[A-Za-z0-9_]+$/.test(value.str[0])) {\r\n console.log(`Invalid parameter name: ${value.str[0]}`);\r\n } else {\r\n this.paramName = `u_${value.str[0]}`;\r\n }\r\n }\r\n },\r\n {\r\n name: 'sRGB',\r\n type: 'bool',\r\n default: true,\r\n get(this: BaseTextureNode, value) {\r\n value.bool[0] = this.sRGB;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.sRGB = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'AddressU',\r\n type: 'string',\r\n default: 'clamp',\r\n options: {\r\n enum: {\r\n labels: ['clamp', 'repeat', 'mirrored-repeat'],\r\n values: ['clamp', 'repeat', 'mirrored-repeat']\r\n }\r\n },\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.addressU;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.addressU = value.str[0] as TextureAddressMode;\r\n }\r\n },\r\n {\r\n name: 'AddressV',\r\n type: 'string',\r\n default: 'clamp',\r\n options: {\r\n enum: {\r\n labels: ['clamp', 'repeat', 'mirrored-repeat'],\r\n values: ['clamp', 'repeat', 'mirrored-repeat']\r\n }\r\n },\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.addressV;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.addressV = value.str[0] as TextureAddressMode;\r\n }\r\n },\r\n {\r\n name: 'MinFilter',\r\n type: 'string',\r\n default: 'linear',\r\n options: {\r\n enum: {\r\n labels: ['nearest', 'linear'],\r\n values: ['nearest', 'linear']\r\n }\r\n },\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.filterMin;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.filterMin = value.str[0] as TextureFilterMode;\r\n }\r\n },\r\n {\r\n name: 'MagFilter',\r\n type: 'string',\r\n default: 'linear',\r\n options: {\r\n enum: {\r\n labels: ['nearest', 'linear'],\r\n values: ['nearest', 'linear']\r\n }\r\n },\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.filterMag;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.filterMag = value.str[0] as TextureFilterMode;\r\n }\r\n },\r\n {\r\n name: 'MipFilter',\r\n type: 'string',\r\n default: 'nearest',\r\n options: {\r\n enum: {\r\n labels: ['nearest', 'linear', 'none'],\r\n values: ['nearest', 'linear', 'none']\r\n }\r\n },\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.filterMip;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.filterMip = value.str[0] as TextureFilterMode;\r\n }\r\n }\r\n ]);\r\n})();\r\n\r\n/**\r\n * Abstract base class for texture nodes\r\n *\r\n * @remarks\r\n * Provides common functionality for all texture types in the material node graph.\r\n * Texture nodes represent shader texture uniforms and their sampling parameters.\r\n *\r\n * Common properties:\r\n * - **paramName**: The shader uniform name for this texture\r\n * - **addressU/V**: Texture coordinate wrapping modes (clamp, repeat, mirrored-repeat)\r\n * - **filterMin**: Minification filter (nearest, linear)\r\n * - **filterMag**: Magnification filter (nearest, linear)\r\n * - **filterMip**: Mipmap filter (nearest, linear, none)\r\n * - **texture**: Reference to the actual GPU texture resource\r\n * - **textureId**: Asset ID for serialization/loading\r\n *\r\n * Texture addressing modes:\r\n * - **clamp**: Coordinates outside [0,1] are clamped to edge colors\r\n * - **repeat**: Texture tiles infinitely (wraps around)\r\n * - **mirrored-repeat**: Texture tiles with alternating mirroring\r\n *\r\n * Filtering modes:\r\n * - **nearest**: Point sampling (sharp, pixelated)\r\n * - **linear**: Bilinear interpolation (smooth)\r\n * - **none**: No mipmap filtering (mip filter only)\r\n *\r\n * @typeParam T - The specific texture type (Texture2D, TextureCube, etc.)\r\n *\r\n * @public\r\n */\r\nexport abstract class BaseTextureNode extends BaseGraphNode {\r\n /** The shader parameter name for this texture uniform */\r\n private _paramName: string;\r\n /** Whether this texture should be loaded in sRGB color space */\r\n sRGB: boolean;\r\n /** Horizontal texture coordinate wrapping mode */\r\n addressU: TextureAddressMode;\r\n /** Vertical texture coordinate wrapping mode */\r\n addressV: TextureAddressMode;\r\n /** Minification filter mode */\r\n filterMin: TextureFilterMode;\r\n /** Magnification filter mode */\r\n filterMag: TextureFilterMode;\r\n /** Mipmap filter mode */\r\n filterMip: TextureFilterMode;\r\n /** Asset ID for the texture (for serialization) */\r\n textureId: string;\r\n /**\r\n * Creates a new texture node\r\n *\r\n * @remarks\r\n * Initializes with default sampling parameters:\r\n * - Auto-generated unique parameter name\r\n * - Clamp addressing mode\r\n * - Nearest filtering (point sampling)\r\n * - No mipmap filtering\r\n * - Empty texture ID\r\n */\r\n constructor() {\r\n super();\r\n this._paramName = getParamName();\r\n this.sRGB = true;\r\n this.addressU = 'clamp';\r\n this.addressV = 'clamp';\r\n this.filterMin = 'linear';\r\n this.filterMag = 'linear';\r\n this.filterMip = 'nearest';\r\n this.textureId = '';\r\n }\r\n /**\r\n * Gets the shader parameter name\r\n *\r\n * @returns The uniform name used in generated shader code\r\n */\r\n get paramName() {\r\n return this._paramName;\r\n }\r\n set paramName(val: string) {\r\n if (this._paramName !== val) {\r\n this._paramName = val;\r\n this.dispatchEvent('changed');\r\n }\r\n }\r\n\r\n /**\r\n * Indicates this node represents a shader uniform\r\n *\r\n * @returns Always true for texture nodes\r\n *\r\n * @remarks\r\n * Texture nodes create uniform declarations in the generated shader code.\r\n */\r\n get isUniform() {\r\n return true;\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns The parameter name\r\n */\r\n toString() {\r\n return this._paramName;\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Texture nodes are always valid as they have no required inputs\r\n * and always have a valid texture (default if none assigned).\r\n */\r\n protected validate(): string {\r\n return this.textureId ? '' : 'Texture not specified';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns Empty string (overridden by subclasses)\r\n *\r\n * @remarks\r\n * Subclasses return texture type identifiers like 'tex2D', 'texCube', etc.\r\n */\r\n protected getType(): string {\r\n return '';\r\n }\r\n}\r\n\r\n/**\r\n * 2D texture constant node\r\n *\r\n * @remarks\r\n * Represents a 2D texture resource in the material node graph.\r\n * This is the most common texture type, used for:\r\n * - Albedo/diffuse maps\r\n * - Normal maps\r\n * - Roughness/metallic maps\r\n * - Emissive maps\r\n * - Any 2D image-based data\r\n *\r\n * The texture can be loaded from various image formats:\r\n * - JPEG (.jpg, .jpeg)\r\n * - PNG (.png)\r\n * - TGA (.tga)\r\n * - HDR/Radiance (.hdr)\r\n * - DDS (.dds)\r\n * - WebP (.webp)\r\n *\r\n * Output:\r\n * - Output 1: Texture sampler (tex2D type)\r\n *\r\n * @example\r\n * ```typescript\r\n * const albedoTex = new ConstantTexture2DNode();\r\n * albedoTex.paramName = 'albedoMap';\r\n * albedoTex.addressU = 'repeat';\r\n * albedoTex.addressV = 'repeat';\r\n * albedoTex.filterMin = 'linear';\r\n * albedoTex.filterMag = 'linear';\r\n *\r\n * // Sample the texture\r\n * const uv = new VertexUVNode();\r\n * const sample = new TextureSampleNode();\r\n * sample.connectInput(1, albedoTex, 1);\r\n * sample.connectInput(2, uv, 1);\r\n *\r\n * // Use in material\r\n * output.connectInput(1, sample, 1); // BaseColor\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ConstantTexture2DNode extends BaseTextureNode {\r\n /**\r\n * Creates a new 2D texture node\r\n *\r\n * @remarks\r\n * Initializes with:\r\n * - One output slot for the texture sampler\r\n * - Default 1x1 white texture\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: ''\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @param manager - The serialization manager for loading textures\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * Includes:\r\n * - Texture asset loading with MIME type validation\r\n * - All common texture parameters (addressing, filtering)\r\n * - Error handling for invalid or missing textures\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: ConstantTexture2DNode,\r\n name: 'Texture2DNode',\r\n noTitle: true,\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'Texture',\r\n type: 'object',\r\n default: null,\r\n options: {\r\n mimeTypes: [\r\n 'image/jpeg',\r\n 'image/png',\r\n 'image/tga',\r\n 'image/vnd.radiance',\r\n 'image/x-dds',\r\n 'image/webp'\r\n ]\r\n },\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: ConstantTexture2DNode, value) {\r\n value.str[0] = this.textureId;\r\n },\r\n async set(this: ConstantTexture2DNode, value) {\r\n const path = value?.str?.[0];\r\n this.textureId = typeof path === 'string' ? path : '';\r\n }\r\n },\r\n ...textureNodeProps\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'tex2D'\r\n */\r\n protected getType(): string {\r\n return this.validate() ? '' : 'tex2D';\r\n }\r\n}\r\n\r\n/**\r\n * 2D texture array constant node\r\n *\r\n * @remarks\r\n * Represents a 2D texture array resource in the material node graph.\r\n * A texture array is a collection of 2D textures with the same size and format,\r\n * accessed using a 3D coordinate (u, v, layer).\r\n *\r\n * Used for:\r\n * - Terrain texture splatting (multiple terrain textures in one array)\r\n * - Animation frames (sprite sheets)\r\n * - Texture atlases with uniform tile sizes\r\n * - Reducing texture bindings (multiple textures in one resource)\r\n *\r\n * Note: Only DDS format supports texture arrays.\r\n *\r\n * Output:\r\n * - Output 1: Texture array sampler (tex2DArray type)\r\n *\r\n * @example\r\n * ```typescript\r\n * const terrainTexArray = new ConstantTexture2DArrayNode();\r\n * terrainTexArray.paramName = 'terrainTextures';\r\n *\r\n * // Sample from layer 2\r\n * const uv = new VertexUVNode();\r\n * const layer = new ConstantScalarNode();\r\n * layer.x = 2.0;\r\n *\r\n * const uvLayer = new MakeVectorNode();\r\n * uvLayer.connectInput(1, uv, 1); // UV (vec2)\r\n * uvLayer.connectInput(2, layer, 1); // Layer (float)\r\n *\r\n * const sample = new TextureSampleNode();\r\n * sample.connectInput(1, terrainTexArray, 1);\r\n * sample.connectInput(2, uvLayer, 1); // vec3 (u, v, layer)\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ConstantTexture2DArrayNode extends BaseTextureNode {\r\n /**\r\n * Creates a new 2D texture array node\r\n *\r\n * @remarks\r\n * Initializes with:\r\n * - One output slot for the texture array sampler\r\n * - Default 1x1x1 white texture array\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: ''\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @param manager - The serialization manager for loading textures\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * Only accepts DDS format, which is the standard format for texture arrays.\r\n * Includes validation to ensure the loaded texture is actually a 2D array.\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: ConstantTexture2DArrayNode,\r\n name: 'Texture2DArrayNode',\r\n noTitle: true,\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'Texture',\r\n type: 'object',\r\n default: null,\r\n options: {\r\n mimeTypes: ['image/x-dds']\r\n },\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: ConstantTexture2DArrayNode, value) {\r\n value.str[0] = this.textureId;\r\n },\r\n async set(this: ConstantTexture2DArrayNode, value) {\r\n const path = value?.str?.[0];\r\n this.textureId = typeof path === 'string' ? path : '';\r\n }\r\n },\r\n ...textureNodeProps\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'tex2DArray'\r\n */\r\n protected getType(): string {\r\n return this.validate() ? '' : 'tex2DArray';\r\n }\r\n}\r\n\r\n/**\r\n * Cubemap texture constant node\r\n *\r\n * @remarks\r\n * Represents a cubemap texture resource in the material node graph.\r\n * A cubemap consists of 6 square textures representing the faces of a cube,\r\n * sampled using a 3D direction vector.\r\n *\r\n * Used for:\r\n * - Environment maps (skyboxes)\r\n * - Reflections (environment reflections on shiny surfaces)\r\n * - Image-based lighting (IBL)\r\n * - Irradiance maps for ambient lighting\r\n * - Prefiltered environment maps for specular reflections\r\n *\r\n * Cubemap faces (standard ordering):\r\n * - +X (right), -X (left)\r\n * - +Y (top), -Y (bottom)\r\n * - +Z (front), -Z (back)\r\n *\r\n * Note: Only DDS format supports cubemap textures.\r\n *\r\n * Output:\r\n * - Output 1: Cubemap sampler (texCube type)\r\n *\r\n * @example\r\n * ```typescript\r\n * const envMap = new ConstantTextureCubeNode();\r\n * envMap.paramName = 'environmentMap';\r\n * envMap.filterMin = 'linear';\r\n * envMap.filterMag = 'linear';\r\n * envMap.filterMip = 'linear';\r\n *\r\n * // Sample environment for reflection\r\n * const normal = new VertexNormalNode();\r\n * const viewDir = new ViewDirectionNode();\r\n *\r\n * const reflectDir = new ReflectNode();\r\n * reflectDir.connectInput(1, viewDir, 1);\r\n * reflectDir.connectInput(2, normal, 1);\r\n *\r\n * const sample = new TextureSampleNode();\r\n * sample.connectInput(1, envMap, 1);\r\n * sample.connectInput(2, reflectDir, 1); // vec3 direction\r\n *\r\n * // Use for reflections\r\n * output.connectInput(1, sample, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ConstantTextureCubeNode extends BaseTextureNode {\r\n /**\r\n * Creates a new cubemap texture node\r\n *\r\n * @remarks\r\n * Initializes with:\r\n * - One output slot for the cubemap sampler\r\n * - Default 1x1 white cubemap (all faces white)\r\n * - No inputs (texture resource only)\r\n */\r\n constructor() {\r\n super();\r\n this._inputs = [];\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: ''\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @param manager - The serialization manager for loading textures\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * Only accepts DDS format, which is the standard format for cubemaps.\r\n * Includes validation to ensure the loaded texture is actually a cubemap.\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: ConstantTextureCubeNode,\r\n name: 'TextureCubeNode',\r\n noTitle: true,\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'Texture',\r\n type: 'object',\r\n default: null,\r\n options: {\r\n mimeTypes: ['image/x-dds']\r\n },\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: ConstantTextureCubeNode, value) {\r\n value.str[0] = this.textureId;\r\n },\r\n async set(this: ConstantTextureCubeNode, value) {\r\n const path = value?.str?.[0];\r\n this.textureId = typeof path === 'string' ? path : '';\r\n }\r\n },\r\n ...textureNodeProps\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'texCube'\r\n */\r\n protected getType(): string {\r\n return this.validate() ? '' : 'texCube';\r\n }\r\n}\r\n\r\n/**\r\n * UV panner node (scrolls UVs over time)\r\n *\r\n * @remarks\r\n * Computes:\r\n * `coord + time * speed`\r\n *\r\n * If `Coordinate` is not connected, the node defaults to mesh UV0 in IR.\r\n * If `Time` is not connected, the node defaults to elapsed time in IR.\r\n *\r\n * Inputs:\r\n * - Coordinate (vec2)\r\n * - Time (float)\r\n * - Speed (vec2)\r\n *\r\n * Output:\r\n * - Output 1: Panned UV (vec2)\r\n *\r\n * @example\r\n * ```typescript\r\n * const panner = new PannerNode();\r\n * panner.speedX = 0.1;\r\n * panner.speedY = 0.0;\r\n *\r\n * const tex = new ConstantTexture2DNode();\r\n * const sample = new TextureSampleNode();\r\n * sample.connectInput(1, tex, 1);\r\n * sample.connectInput(2, panner, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class PannerNode extends BaseGraphNode {\r\n /** Speed in U direction */\r\n private _speedX: number;\r\n /** Speed in V direction */\r\n private _speedY: number;\r\n /**\r\n * Creates a new panner node\r\n *\r\n * @remarks\r\n * Initializes with optional inputs for coordinate, time, and speed.\r\n */\r\n constructor() {\r\n super();\r\n this._speedX = 0;\r\n this._speedY = 0;\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'Coordinate',\r\n type: ['vec2']\r\n },\r\n {\r\n id: 2,\r\n name: 'Time',\r\n type: ['float']\r\n },\r\n {\r\n id: 3,\r\n name: 'Speed',\r\n type: ['vec2'],\r\n defaultValue: [this._speedX, this._speedY]\r\n }\r\n ];\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: ''\r\n }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'Panner'\r\n */\r\n toString() {\r\n return 'Panner';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: PannerNode,\r\n name: 'PannerNode',\r\n getProps(): PropertyAccessor<PannerNode>[] {\r\n return defineProps([\r\n {\r\n name: 'SpeedX',\r\n type: 'float',\r\n get(this: PannerNode, value) {\r\n value.num[0] = this.speedX;\r\n },\r\n set(this: PannerNode, value) {\r\n this.speedX = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'SpeedY',\r\n type: 'float',\r\n get(this: PannerNode, value) {\r\n value.num[0] = this.speedY;\r\n },\r\n set(this: PannerNode, value) {\r\n this.speedY = value.num[0];\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Gets speed in U direction\r\n */\r\n get speedX() {\r\n return this._speedX;\r\n }\r\n set speedX(val: number) {\r\n if (this._speedX !== val) {\r\n this._speedX = val;\r\n const speedInput = this._inputs.find((input) => input.id === 3);\r\n if (speedInput) {\r\n speedInput.defaultValue = [this._speedX, this._speedY];\r\n }\r\n this.dispatchEvent('changed');\r\n }\r\n }\r\n /**\r\n * Gets speed in V direction\r\n */\r\n get speedY() {\r\n return this._speedY;\r\n }\r\n set speedY(val: number) {\r\n if (this._speedY !== val) {\r\n this._speedY = val;\r\n const speedInput = this._inputs.find((input) => input.id === 3);\r\n if (speedInput) {\r\n speedInput.defaultValue = [this._speedX, this._speedY];\r\n }\r\n this.dispatchEvent('changed');\r\n }\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'vec2'\r\n */\r\n protected getType() {\r\n return 'vec2';\r\n }\r\n}\r\n\r\n/**\r\n * Texture sampling node\r\n *\r\n * @remarks\r\n * Samples a texture at the specified coordinates and returns the color value.\r\n * This is the primary way to read texture data in material shaders.\r\n *\r\n * Supports multiple texture types:\r\n * - **tex2D**: Requires vec2 coordinates (u, v)\r\n * - **tex2DArray**: Requires vec3 coordinates (u, v, layer)\r\n * - **texCube**: Requires vec3 direction vector\r\n *\r\n * Sampler types:\r\n * - **Color**: Standard color sampling (returns RGBA as-is)\r\n * - **Normal**: Normal map sampling (may apply special transformations)\r\n *\r\n * The sampling uses the texture's configured filtering and addressing modes.\r\n * Mipmap level is automatically selected based on screen-space derivatives.\r\n *\r\n * Inputs:\r\n * - Input 1: Texture sampler (tex2D, tex2DArray, or texCube)\r\n * - Input 2: Texture coordinates (vec2 for 2D, vec3 for array/cube)\r\n *\r\n * Output:\r\n * - Output 1: Sampled color (vec4 RGBA)\r\n *\r\n * @example\r\n * ```typescript\r\n * // Basic 2D texture sampling\r\n * const albedoTex = new ConstantTexture2DNode();\r\n * const uv = new VertexUVNode();\r\n *\r\n * const sample = new TextureSampleNode();\r\n * sample.samplerType = 'Color';\r\n * sample.connectInput(1, albedoTex, 1);\r\n * sample.connectInput(2, uv, 1);\r\n *\r\n * output.connectInput(1, sample, 1); // Use as base color\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Normal map sampling\r\n * const normalMap = new ConstantTexture2DNode();\r\n * const uv = new VertexUVNode();\r\n *\r\n * const sample = new TextureSampleNode();\r\n * sample.samplerType = 'Normal';\r\n * sample.connectInput(1, normalMap, 1);\r\n * sample.connectInput(2, uv, 1);\r\n *\r\n * output.connectInput(6, sample, 1); // Use as normal\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Cubemap environment sampling\r\n * const envMap = new ConstantTextureCubeNode();\r\n * const normal = new VertexNormalNode();\r\n * const viewDir = new ViewDirectionNode();\r\n *\r\n * const reflectDir = new ReflectNode();\r\n * reflectDir.connectInput(1, viewDir, 1);\r\n * reflectDir.connectInput(2, normal, 1);\r\n *\r\n * const sample = new TextureSampleNode();\r\n * sample.connectInput(1, envMap, 1);\r\n * sample.connectInput(2, reflectDir, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class TextureSampleNode extends BaseGraphNode {\r\n /** The type of sampling (Color or Normal) */\r\n samplerType: 'Color' | 'Normal';\r\n /** The shader parameter name for fallback texture uniform */\r\n private _paramName: string;\r\n /** Asset ID for fallback texture (used when texture input is not connected) */\r\n textureId: string;\r\n /** Whether fallback texture should be loaded in sRGB color space */\r\n sRGB: boolean;\r\n /** Horizontal texture coordinate wrapping mode for fallback texture */\r\n addressU: TextureAddressMode;\r\n /** Vertical texture coordinate wrapping mode for fallback texture */\r\n addressV: TextureAddressMode;\r\n /** Minification filter mode for fallback texture */\r\n filterMin: TextureFilterMode;\r\n /** Magnification filter mode for fallback texture */\r\n filterMag: TextureFilterMode;\r\n /** Mipmap filter mode for fallback texture */\r\n filterMip: TextureFilterMode;\r\n /**\r\n * Creates a new texture sample node\r\n *\r\n * @remarks\r\n * Initializes with:\r\n * - Two required inputs (texture and coordinates)\r\n * - One output (sampled color)\r\n * - Color sampler type by default\r\n */\r\n constructor() {\r\n super();\r\n this.samplerType = 'Color';\r\n this._paramName = getParamName();\r\n this.textureId = '';\r\n this.sRGB = true;\r\n this.addressU = 'clamp';\r\n this.addressV = 'clamp';\r\n this.filterMin = 'linear';\r\n this.filterMag = 'linear';\r\n this.filterMip = 'nearest';\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: 'RGBA'\r\n },\r\n {\r\n id: 2,\r\n name: 'R',\r\n swizzle: 'r'\r\n },\r\n {\r\n id: 3,\r\n name: 'G',\r\n swizzle: 'g'\r\n },\r\n {\r\n id: 4,\r\n name: 'B',\r\n swizzle: 'b'\r\n },\r\n {\r\n id: 5,\r\n name: 'A',\r\n swizzle: 'a'\r\n },\r\n {\r\n id: 6,\r\n name: 'RGB',\r\n swizzle: 'rgb'\r\n }\r\n ];\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'texture',\r\n type: ['tex2D', 'tex2DArray', 'texCube'],\r\n required: false\r\n },\r\n {\r\n id: 2,\r\n name: 'coord',\r\n type: ['vec2', 'vec3'],\r\n required: false\r\n }\r\n ];\r\n }\r\n /**\r\n * Indicates this node can provide a texture uniform when texture input is not connected.\r\n */\r\n get isUniform() {\r\n return !this._inputs[0].inputNode;\r\n }\r\n /**\r\n * Gets fallback texture uniform parameter name.\r\n */\r\n get paramName() {\r\n return this._paramName;\r\n }\r\n set paramName(val: string) {\r\n if (this._paramName !== val) {\r\n this._paramName = val;\r\n this.dispatchEvent('changed');\r\n }\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * Serializes the sampler type (Color or Normal).\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: TextureSampleNode,\r\n name: 'TextureSampleNode',\r\n getProps(): PropertyAccessor<TextureSampleNode>[] {\r\n return defineProps([\r\n {\r\n name: 'Name',\r\n type: 'string',\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: TextureSampleNode, value) {\r\n value.str[0] = this.paramName ? this.paramName.slice(2) : '';\r\n },\r\n set(this: TextureSampleNode, value) {\r\n if (!/^[A-Za-z0-9_]+$/.test(value.str[0])) {\r\n console.log(`Invalid parameter name: ${value.str[0]}`);\r\n } else {\r\n this.paramName = `u_${value.str[0]}`;\r\n }\r\n }\r\n },\r\n {\r\n name: 'SamplerType',\r\n type: 'string',\r\n options: {\r\n enum: {\r\n labels: ['Color', 'Normal'],\r\n values: ['Color', 'Normal']\r\n }\r\n },\r\n get(this: TextureSampleNode, value) {\r\n value.str[0] = this.samplerType;\r\n },\r\n set(this: TextureSampleNode, value) {\r\n this.samplerType = value.str[0] as any;\r\n }\r\n },\r\n {\r\n name: 'Texture',\r\n type: 'object',\r\n default: null,\r\n options: {\r\n mimeTypes: [\r\n 'image/jpeg',\r\n 'image/png',\r\n 'image/tga',\r\n 'image/vnd.radiance',\r\n 'image/x-dds',\r\n 'image/webp'\r\n ]\r\n },\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: TextureSampleNode, value) {\r\n value.str[0] = this.textureId;\r\n },\r\n async set(this: TextureSampleNode, value) {\r\n const path = value?.str?.[0];\r\n this.textureId = typeof path === 'string' ? path : '';\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'textureSample'\r\n */\r\n toString(): string {\r\n return 'textureSample';\r\n }\r\n /**\r\n * Validates the node state and input type compatibility\r\n *\r\n * @returns Error message if invalid, empty string if valid\r\n *\r\n * @remarks\r\n * Validation ensures:\r\n * - Both inputs are connected\r\n * - Texture input is a valid texture type\r\n * - Coordinate input matches texture dimensionality:\r\n * - tex2D requires vec2\r\n * - tex2DArray requires vec3 (u, v, layer)\r\n * - texCube requires vec3 (direction)\r\n */\r\n protected validate(): string {\r\n const err = super.validate();\r\n if (err) {\r\n return err;\r\n }\r\n const texInput = this._inputs[0];\r\n const coordInput = this._inputs[1];\r\n const type0 = texInput.inputNode ? texInput.inputNode.getOutputType(texInput.inputId!) : 'tex2D';\r\n if (texInput.inputNode) {\r\n if (!type0) {\r\n return `Cannot determine type of argument \\`${texInput.name}\\``;\r\n }\r\n if (!texInput.type.includes(type0)) {\r\n return `Invalid input type of argument \\`${texInput.name}\\`: ${type0}`;\r\n }\r\n } else if (!this.textureId) {\r\n return 'Texture not specified';\r\n }\r\n if (coordInput.inputNode) {\r\n const type1 = coordInput.inputNode.getOutputType(coordInput.inputId!);\r\n if (!type1) {\r\n return `Cannot determine type of argument \\`${coordInput.name}\\``;\r\n }\r\n const expectedType1 = type0 === 'tex2D' ? 'vec2' : 'vec3';\r\n if (type1 !== expectedType1) {\r\n return `Texture coordinate type should be ${expectedType1}`;\r\n }\r\n }\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n */\r\n protected getType(id: number) {\r\n const err = this.validate();\r\n if (err) {\r\n return '';\r\n }\r\n if (id === 1) {\r\n return 'vec4';\r\n } else if (id === 6) {\r\n return 'vec3';\r\n } else {\r\n return 'float';\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Texture sampling with explicit gradients node\r\n *\r\n * @remarks\r\n * Samples a texture using explicitly provided screen-space gradients (derivatives)\r\n * instead of automatically computed ones. This allows precise control over mipmap\r\n * level selection and can be used for advanced effects.\r\n *\r\n * Use cases:\r\n * - Manual mipmap level control\r\n * - Sampling in non-fragment shaders (where automatic derivatives aren't available)\r\n * - Custom anisotropic filtering\r\n * - Texture sampling in control flow that breaks derivatives\r\n * - Advanced procedural effects\r\n *\r\n * Note: The current implementation appears identical to TextureSampleNode.\r\n * Full gradient support would require additional inputs for dPdx and dPdy.\r\n *\r\n * Inputs:\r\n * - Input 1: Texture sampler (tex2D, tex2DArray, or texCube)\r\n * - Input 2: Texture coordinates (vec2 or vec3)\r\n *\r\n * Output:\r\n * - Output 1: Sampled color (vec4 RGBA)\r\n *\r\n * @public\r\n */\r\nexport class TextureSampleGrad extends BaseGraphNode {\r\n /** The type of sampling (Color or Normal) */\r\n samplerType: 'Color' | 'Normal';\r\n /**\r\n * Creates a new texture sample with gradients node\r\n *\r\n * @remarks\r\n * Initializes with:\r\n * - Two required inputs (texture and coordinates)\r\n * - One output (sampled color)\r\n * - Color sampler type by default\r\n *\r\n * TODO: Add gradient inputs (dPdx, dPdy) for full explicit gradient support\r\n */\r\n constructor() {\r\n super();\r\n this.samplerType = 'Color';\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: ''\r\n }\r\n ];\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'texture',\r\n type: ['tex2D', 'tex2DArray', 'texCube'],\r\n required: true\r\n },\r\n {\r\n id: 2,\r\n name: 'coord',\r\n type: ['vec2', 'vec3'],\r\n required: true\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * Currently returns TextureSampleNode serialization (likely needs separate class).\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: TextureSampleNode,\r\n name: 'TextureSampleNode',\r\n getProps(): PropertyAccessor<TextureSampleNode>[] {\r\n return defineProps([\r\n {\r\n name: 'SamplerType',\r\n type: 'string',\r\n options: {\r\n enum: {\r\n labels: ['Color', 'Normal'],\r\n values: ['Color', 'Normal']\r\n }\r\n },\r\n get(this: TextureSampleNode, value) {\r\n value.str[0] = this.samplerType;\r\n },\r\n set(this: TextureSampleNode, value) {\r\n this.samplerType = value.str[0] as any;\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'textureSample'\r\n */\r\n toString(): string {\r\n return 'textureSample';\r\n }\r\n /**\r\n * Validates the node state and input type compatibility\r\n *\r\n * @returns Error message if invalid, empty string if valid\r\n *\r\n * @remarks\r\n * Validation ensures:\r\n * - Both inputs are connected\r\n * - Texture input is a valid texture type\r\n * - Coordinate input matches texture dimensionality\r\n */\r\n protected validate(): string {\r\n const err = super.validate();\r\n if (err) {\r\n return err;\r\n }\r\n const type0 = this._inputs[0].inputNode!.getOutputType(this._inputs[0].inputId!);\r\n if (!type0) {\r\n return `Cannot determine type of argument \\`${this._inputs[0].name}\\``;\r\n }\r\n if (!this._inputs[0].type.includes(type0)) {\r\n return `Invalid input type of argument \\`${this._inputs[0].name}\\`: ${type0}`;\r\n }\r\n const type1 = this._inputs[1].inputNode!.getOutputType(this._inputs[1].inputId!);\r\n if (!type1) {\r\n return `Cannot determine type of argument \\`${this._inputs[1].name}\\``;\r\n }\r\n const expectedType1 = type0 === 'tex2D' ? 'vec2' : 'vec3';\r\n if (type1 !== expectedType1) {\r\n return `Texture coordinate type should be ${expectedType1}`;\r\n }\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'vec4' (RGBA color)\r\n */\r\n protected getType(): string {\r\n return 'vec4';\r\n }\r\n}\r\n"],"names":["defaultTexture2D","DRef","defaultTextureCube","defaultTexture2DArray","getDefaultTexture2D","get","defaultTex","getDevice","createTexture2D","mipmapping","update","Uint8Array","set","getDefaultTexture2DArray","createTexture2DArray","getDefaultTextureCube","createCubeTexture","i","textureNodeProps","getTextureNodeProps","defineProps","name","type","isNullable","value","str","paramName","slice","test","console","log","default","bool","sRGB","options","enum","labels","values","addressU","addressV","filterMin","filterMag","filterMip","BaseTextureNode","BaseGraphNode","textureId","_paramName","getParamName","val","dispatchEvent","isUniform","toString","ConstantTexture2DNode","_outputs","id","getSerializationCls","ctor","noTitle","getProps","mimeTypes","path","validate","ConstantTexture2DArrayNode","ConstantTextureCubeNode","_inputs","PannerNode","_speedX","_speedY","defaultValue","num","speedX","speedY","speedInput","find","input","TextureSampleNode","samplerType","swizzle","required","inputNode","err","texInput","coordInput","type0","getOutputType","inputId","includes","type1","expectedType1","getType","TextureSampleGrad"],"mappings":";;;;;;AAaA;;;IAIA,MAAMA,mBAAoC,IAAIC,IAAAA,EAAAA;AAE9C;;;IAIA,MAAMC,qBAAwC,IAAID,IAAAA,EAAAA;AAElD;;;IAIA,MAAME,wBAA8C,IAAIF,IAAAA,EAAAA;AAExD;;;;;;;;;;AAUC,IACM,SAASG,mBAAAA,GAAAA;IACd,IAAI,CAACJ,gBAAiBK,C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,QAAA,MAAMI,QAAQ,IAAI,CAACvB,OAAO,CAAC,EAAE,CAACe,SAAS,CAAEK,aAAa,CAAC,IAAI,CAACpB,OAAO,CAAC,CAAA,CAAE,CAACqB,OAAO,CAAA;AAC9E,QAAA,IAAI,CAACE,KAAO,EAAA;AACV,YAAA,OAAO,CAAC,oCAAoC,EAAE,IAAI,CAACvB,OAAO,CAAC,CAAA,CAAE,CAAC3C,IAAI,CAAC,EAAE,CAAC;AACxE;QACA,MAAMmE,aAAAA,GAAgBL,KAAU,KAAA,OAAA,GAAU,MAAS,GAAA,MAAA;AACnD,QAAA,IAAII,UAAUC,aAAe,EAAA;YAC3B,OAAO,CAAC,kCAAkC,EAAEA,aAAe,CAAA,CAAA;AAC7D;QACA,OAAO,EAAA;AACT;AACA;;;;AAIC,MACD,OAA4B,GAAA;QAC1B,OAAO,MAAA;AACT;AACF;;;;"}
1
+ {"version":3,"file":"texture.js","sources":["../../../../src/utility/blueprint/material/texture.ts"],"sourcesContent":["import { BaseGraphNode } from '../node';\r\nimport { getParamName } from '../common';\r\nimport type {\r\n Texture2D,\r\n Texture2DArray,\r\n TextureAddressMode,\r\n TextureCube,\r\n TextureFilterMode\r\n} from '@zephyr3d/device';\r\nimport { DRef } from '@zephyr3d/base';\r\nimport { getDevice } from '../../../app/api';\r\nimport { defineProps, type PropertyAccessor, type SerializableClass } from '../../serialization/types';\r\n\r\n/**\r\n * Default 1x1 white 2D texture reference\r\n * @internal\r\n */\r\nconst defaultTexture2D: DRef<Texture2D> = new DRef();\r\n\r\n/**\r\n * Default 1x1 white cubemap texture reference\r\n * @internal\r\n */\r\nconst defaultTextureCube: DRef<TextureCube> = new DRef();\r\n\r\n/**\r\n * Default 1x1 white 2D array texture reference\r\n * @internal\r\n */\r\nconst defaultTexture2DArray: DRef<Texture2DArray> = new DRef();\r\n\r\n/**\r\n * Gets or creates the default 2D texture\r\n *\r\n * @remarks\r\n * Returns a 1x1 white (255, 255, 255, 255) texture used as a fallback\r\n * when no texture is assigned to a texture node.\r\n *\r\n * @returns A 1x1 white Texture2D instance\r\n *\r\n * @internal\r\n */\r\nexport function getDefaultTexture2D(): Texture2D {\r\n if (!defaultTexture2D.get()) {\r\n const defaultTex = getDevice().createTexture2D('rgba8unorm', 1, 1, {\r\n mipmapping: false\r\n })!;\r\n defaultTex.update(new Uint8Array([255, 255, 255, 255]), 0, 0, 1, 1);\r\n defaultTexture2D.set(defaultTex);\r\n }\r\n return defaultTexture2D.get()!;\r\n}\r\n\r\n/**\r\n * Gets or creates the default 2D array texture\r\n *\r\n * @remarks\r\n * Returns a 1x1x1 white (255, 255, 255, 255) array texture used as a fallback\r\n * when no texture is assigned to a 2D array texture node.\r\n *\r\n * @returns A 1x1x1 white Texture2DArray instance\r\n *\r\n * @internal\r\n */\r\nexport function getDefaultTexture2DArray(): Texture2DArray {\r\n if (!defaultTexture2DArray.get()) {\r\n const defaultTex = getDevice().createTexture2DArray('rgba8unorm', 1, 1, 1, {\r\n mipmapping: false\r\n })!;\r\n defaultTex.update(new Uint8Array([255, 255, 255, 255]), 0, 0, 0, 1, 1, 1);\r\n defaultTexture2DArray.set(defaultTex);\r\n }\r\n return defaultTexture2DArray.get()!;\r\n}\r\n\r\n/**\r\n * Gets or creates the default cubemap texture\r\n *\r\n * @remarks\r\n * Returns a 1x1 white (255, 255, 255, 255) cubemap texture (all 6 faces white)\r\n * used as a fallback when no texture is assigned to a cubemap texture node.\r\n *\r\n * @returns A 1x1 white TextureCube instance\r\n *\r\n * @internal\r\n */\r\nexport function getDefaultTextureCube(): TextureCube {\r\n if (!defaultTextureCube.get()) {\r\n const defaultTex = getDevice().createCubeTexture('rgba8unorm', 1, {\r\n mipmapping: false\r\n })!;\r\n for (let i = 0; i < 6; i++) {\r\n defaultTex.update(new Uint8Array([255, 255, 255, 255]), 0, 0, 1, 1, i);\r\n }\r\n defaultTextureCube.set(defaultTex);\r\n }\r\n return defaultTextureCube.get()!;\r\n}\r\n\r\n/**\r\n * Common property descriptors for texture nodes\r\n *\r\n * @remarks\r\n * Defines serialization properties shared by all texture node types:\r\n * - Name: Shader parameter name for the texture uniform\r\n * - sRGB: Whether texture should be loaded into sRGB color space\r\n * - AddressU: Horizontal texture wrapping mode\r\n * - AddressV: Vertical texture wrapping mode\r\n * - MinFilter: Minification filter mode\r\n * - MagFilter: Magnification filter mode\r\n * - MipFilter: Mipmap filter mode\r\n *\r\n * @internal\r\n */\r\nconst textureNodeProps = (function getTextureNodeProps(): PropertyAccessor<BaseTextureNode>[] {\r\n return defineProps([\r\n {\r\n name: 'Name',\r\n type: 'string',\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.paramName ? this.paramName.slice(2) : '';\r\n },\r\n set(this: BaseTextureNode, value) {\r\n if (!/^[A-Za-z0-9_]+$/.test(value.str[0])) {\r\n console.log(`Invalid parameter name: ${value.str[0]}`);\r\n } else {\r\n this.paramName = `u_${value.str[0]}`;\r\n }\r\n }\r\n },\r\n {\r\n name: 'sRGB',\r\n type: 'bool',\r\n default: true,\r\n get(this: BaseTextureNode, value) {\r\n value.bool[0] = this.sRGB;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.sRGB = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'AddressU',\r\n type: 'string',\r\n default: 'clamp',\r\n options: {\r\n enum: {\r\n labels: ['clamp', 'repeat', 'mirrored-repeat'],\r\n values: ['clamp', 'repeat', 'mirrored-repeat']\r\n }\r\n },\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.addressU;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.addressU = value.str[0] as TextureAddressMode;\r\n }\r\n },\r\n {\r\n name: 'AddressV',\r\n type: 'string',\r\n default: 'clamp',\r\n options: {\r\n enum: {\r\n labels: ['clamp', 'repeat', 'mirrored-repeat'],\r\n values: ['clamp', 'repeat', 'mirrored-repeat']\r\n }\r\n },\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.addressV;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.addressV = value.str[0] as TextureAddressMode;\r\n }\r\n },\r\n {\r\n name: 'MinFilter',\r\n type: 'string',\r\n default: 'linear',\r\n options: {\r\n enum: {\r\n labels: ['nearest', 'linear'],\r\n values: ['nearest', 'linear']\r\n }\r\n },\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.filterMin;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.filterMin = value.str[0] as TextureFilterMode;\r\n }\r\n },\r\n {\r\n name: 'MagFilter',\r\n type: 'string',\r\n default: 'linear',\r\n options: {\r\n enum: {\r\n labels: ['nearest', 'linear'],\r\n values: ['nearest', 'linear']\r\n }\r\n },\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.filterMag;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.filterMag = value.str[0] as TextureFilterMode;\r\n }\r\n },\r\n {\r\n name: 'MipFilter',\r\n type: 'string',\r\n default: 'nearest',\r\n options: {\r\n enum: {\r\n labels: ['nearest', 'linear', 'none'],\r\n values: ['nearest', 'linear', 'none']\r\n }\r\n },\r\n isNullable() {\r\n return false;\r\n },\r\n get(this: BaseTextureNode, value) {\r\n value.str[0] = this.filterMip;\r\n },\r\n set(this: BaseTextureNode, value) {\r\n this.filterMip = value.str[0] as TextureFilterMode;\r\n }\r\n }\r\n ]);\r\n})();\r\n\r\n/**\r\n * Abstract base class for texture nodes\r\n *\r\n * @remarks\r\n * Provides common functionality for all texture types in the material node graph.\r\n * Texture nodes represent shader texture uniforms and their sampling parameters.\r\n *\r\n * Common properties:\r\n * - **paramName**: The shader uniform name for this texture\r\n * - **addressU/V**: Texture coordinate wrapping modes (clamp, repeat, mirrored-repeat)\r\n * - **filterMin**: Minification filter (nearest, linear)\r\n * - **filterMag**: Magnification filter (nearest, linear)\r\n * - **filterMip**: Mipmap filter (nearest, linear, none)\r\n * - **texture**: Reference to the actual GPU texture resource\r\n * - **textureId**: Asset ID for serialization/loading\r\n *\r\n * Texture addressing modes:\r\n * - **clamp**: Coordinates outside [0,1] are clamped to edge colors\r\n * - **repeat**: Texture tiles infinitely (wraps around)\r\n * - **mirrored-repeat**: Texture tiles with alternating mirroring\r\n *\r\n * Filtering modes:\r\n * - **nearest**: Point sampling (sharp, pixelated)\r\n * - **linear**: Bilinear interpolation (smooth)\r\n * - **none**: No mipmap filtering (mip filter only)\r\n *\r\n * @typeParam T - The specific texture type (Texture2D, TextureCube, etc.)\r\n *\r\n * @public\r\n */\r\nexport abstract class BaseTextureNode extends BaseGraphNode {\r\n /** The shader parameter name for this texture uniform */\r\n private _paramName: string;\r\n /** Whether this texture should be loaded in sRGB color space */\r\n sRGB: boolean;\r\n /** Horizontal texture coordinate wrapping mode */\r\n addressU: TextureAddressMode;\r\n /** Vertical texture coordinate wrapping mode */\r\n addressV: TextureAddressMode;\r\n /** Minification filter mode */\r\n filterMin: TextureFilterMode;\r\n /** Magnification filter mode */\r\n filterMag: TextureFilterMode;\r\n /** Mipmap filter mode */\r\n filterMip: TextureFilterMode;\r\n /** Asset ID for the texture (for serialization) */\r\n textureId: string;\r\n /**\r\n * Creates a new texture node\r\n *\r\n * @remarks\r\n * Initializes with default sampling parameters:\r\n * - Auto-generated unique parameter name\r\n * - Clamp addressing mode\r\n * - Nearest filtering (point sampling)\r\n * - No mipmap filtering\r\n * - Empty texture ID\r\n */\r\n constructor() {\r\n super();\r\n this._paramName = getParamName();\r\n this.sRGB = true;\r\n this.addressU = 'clamp';\r\n this.addressV = 'clamp';\r\n this.filterMin = 'linear';\r\n this.filterMag = 'linear';\r\n this.filterMip = 'nearest';\r\n this.textureId = '';\r\n }\r\n /**\r\n * Gets the shader parameter name\r\n *\r\n * @returns The uniform name used in generated shader code\r\n */\r\n get paramName() {\r\n return this._paramName;\r\n }\r\n set paramName(val: string) {\r\n if (this._paramName !== val) {\r\n this._paramName = val;\r\n this.dispatchEvent('changed');\r\n }\r\n }\r\n\r\n /**\r\n * Indicates this node represents a shader uniform\r\n *\r\n * @returns Always true for texture nodes\r\n *\r\n * @remarks\r\n * Texture nodes create uniform declarations in the generated shader code.\r\n */\r\n get isUniform() {\r\n return true;\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns The parameter name\r\n */\r\n toString() {\r\n return this._paramName;\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Texture nodes are always valid as they have no required inputs\r\n * and always have a valid texture (default if none assigned).\r\n */\r\n protected validate(): string {\r\n return this.textureId ? '' : 'Texture not specified';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns Empty string (overridden by subclasses)\r\n *\r\n * @remarks\r\n * Subclasses return texture type identifiers like 'tex2D', 'texCube', etc.\r\n */\r\n protected getType(): string {\r\n return '';\r\n }\r\n}\r\n\r\n/**\r\n * 2D texture constant node\r\n *\r\n * @remarks\r\n * Represents a 2D texture resource in the material node graph.\r\n * This is the most common texture type, used for:\r\n * - Albedo/diffuse maps\r\n * - Normal maps\r\n * - Roughness/metallic maps\r\n * - Emissive maps\r\n * - Any 2D image-based data\r\n *\r\n * The texture can be loaded from various image formats:\r\n * - JPEG (.jpg, .jpeg)\r\n * - PNG (.png)\r\n * - TGA (.tga)\r\n * - HDR/Radiance (.hdr)\r\n * - DDS (.dds)\r\n * - WebP (.webp)\r\n *\r\n * Output:\r\n * - Output 1: Texture sampler (tex2D type)\r\n *\r\n * @example\r\n * ```typescript\r\n * const albedoTex = new ConstantTexture2DNode();\r\n * albedoTex.paramName = 'albedoMap';\r\n * albedoTex.addressU = 'repeat';\r\n * albedoTex.addressV = 'repeat';\r\n * albedoTex.filterMin = 'linear';\r\n * albedoTex.filterMag = 'linear';\r\n *\r\n * // Sample the texture\r\n * const uv = new VertexUVNode();\r\n * const sample = new TextureSampleNode();\r\n * sample.connectInput(1, albedoTex, 1);\r\n * sample.connectInput(2, uv, 1);\r\n *\r\n * // Use in material\r\n * output.connectInput(1, sample, 1); // BaseColor\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ConstantTexture2DNode extends BaseTextureNode {\r\n /**\r\n * Creates a new 2D texture node\r\n *\r\n * @remarks\r\n * Initializes with:\r\n * - One output slot for the texture sampler\r\n * - Default 1x1 white texture\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: ''\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @param manager - The serialization manager for loading textures\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * Includes:\r\n * - Texture asset loading with MIME type validation\r\n * - All common texture parameters (addressing, filtering)\r\n * - Error handling for invalid or missing textures\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: ConstantTexture2DNode,\r\n name: 'Texture2DNode',\r\n noTitle: true,\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'Texture',\r\n type: 'object',\r\n default: null,\r\n options: {\r\n mimeTypes: [\r\n 'image/jpeg',\r\n 'image/png',\r\n 'image/tga',\r\n 'image/vnd.radiance',\r\n 'image/x-dds',\r\n 'image/webp'\r\n ]\r\n },\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: ConstantTexture2DNode, value) {\r\n value.str[0] = this.textureId;\r\n },\r\n async set(this: ConstantTexture2DNode, value) {\r\n const path = value?.str?.[0];\r\n this.textureId = typeof path === 'string' ? path : '';\r\n }\r\n },\r\n ...textureNodeProps\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'tex2D'\r\n */\r\n protected getType(): string {\r\n return this.validate() ? '' : 'tex2D';\r\n }\r\n}\r\n\r\n/**\r\n * 2D texture array constant node\r\n *\r\n * @remarks\r\n * Represents a 2D texture array resource in the material node graph.\r\n * A texture array is a collection of 2D textures with the same size and format,\r\n * accessed using a 3D coordinate (u, v, layer).\r\n *\r\n * Used for:\r\n * - Terrain texture splatting (multiple terrain textures in one array)\r\n * - Animation frames (sprite sheets)\r\n * - Texture atlases with uniform tile sizes\r\n * - Reducing texture bindings (multiple textures in one resource)\r\n *\r\n * Note: Only DDS format supports texture arrays.\r\n *\r\n * Output:\r\n * - Output 1: Texture array sampler (tex2DArray type)\r\n *\r\n * @example\r\n * ```typescript\r\n * const terrainTexArray = new ConstantTexture2DArrayNode();\r\n * terrainTexArray.paramName = 'terrainTextures';\r\n *\r\n * // Sample from layer 2\r\n * const uv = new VertexUVNode();\r\n * const layer = new ConstantScalarNode();\r\n * layer.x = 2.0;\r\n *\r\n * const uvLayer = new MakeVectorNode();\r\n * uvLayer.connectInput(1, uv, 1); // UV (vec2)\r\n * uvLayer.connectInput(2, layer, 1); // Layer (float)\r\n *\r\n * const sample = new TextureSampleNode();\r\n * sample.connectInput(1, terrainTexArray, 1);\r\n * sample.connectInput(2, uvLayer, 1); // vec3 (u, v, layer)\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ConstantTexture2DArrayNode extends BaseTextureNode {\r\n /**\r\n * Creates a new 2D texture array node\r\n *\r\n * @remarks\r\n * Initializes with:\r\n * - One output slot for the texture array sampler\r\n * - Default 1x1x1 white texture array\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: ''\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @param manager - The serialization manager for loading textures\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * Only accepts DDS format, which is the standard format for texture arrays.\r\n * Includes validation to ensure the loaded texture is actually a 2D array.\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: ConstantTexture2DArrayNode,\r\n name: 'Texture2DArrayNode',\r\n noTitle: true,\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'Texture',\r\n type: 'object',\r\n default: null,\r\n options: {\r\n mimeTypes: ['image/x-dds']\r\n },\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: ConstantTexture2DArrayNode, value) {\r\n value.str[0] = this.textureId;\r\n },\r\n async set(this: ConstantTexture2DArrayNode, value) {\r\n const path = value?.str?.[0];\r\n this.textureId = typeof path === 'string' ? path : '';\r\n }\r\n },\r\n ...textureNodeProps\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'tex2DArray'\r\n */\r\n protected getType(): string {\r\n return this.validate() ? '' : 'tex2DArray';\r\n }\r\n}\r\n\r\n/**\r\n * Cubemap texture constant node\r\n *\r\n * @remarks\r\n * Represents a cubemap texture resource in the material node graph.\r\n * A cubemap consists of 6 square textures representing the faces of a cube,\r\n * sampled using a 3D direction vector.\r\n *\r\n * Used for:\r\n * - Environment maps (skyboxes)\r\n * - Reflections (environment reflections on shiny surfaces)\r\n * - Image-based lighting (IBL)\r\n * - Irradiance maps for ambient lighting\r\n * - Prefiltered environment maps for specular reflections\r\n *\r\n * Cubemap faces (standard ordering):\r\n * - +X (right), -X (left)\r\n * - +Y (top), -Y (bottom)\r\n * - +Z (front), -Z (back)\r\n *\r\n * Note: Only DDS format supports cubemap textures.\r\n *\r\n * Output:\r\n * - Output 1: Cubemap sampler (texCube type)\r\n *\r\n * @example\r\n * ```typescript\r\n * const envMap = new ConstantTextureCubeNode();\r\n * envMap.paramName = 'environmentMap';\r\n * envMap.filterMin = 'linear';\r\n * envMap.filterMag = 'linear';\r\n * envMap.filterMip = 'linear';\r\n *\r\n * // Sample environment for reflection\r\n * const normal = new VertexNormalNode();\r\n * const viewDir = new ViewDirectionNode();\r\n *\r\n * const reflectDir = new ReflectNode();\r\n * reflectDir.connectInput(1, viewDir, 1);\r\n * reflectDir.connectInput(2, normal, 1);\r\n *\r\n * const sample = new TextureSampleNode();\r\n * sample.connectInput(1, envMap, 1);\r\n * sample.connectInput(2, reflectDir, 1); // vec3 direction\r\n *\r\n * // Use for reflections\r\n * output.connectInput(1, sample, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ConstantTextureCubeNode extends BaseTextureNode {\r\n /**\r\n * Creates a new cubemap texture node\r\n *\r\n * @remarks\r\n * Initializes with:\r\n * - One output slot for the cubemap sampler\r\n * - Default 1x1 white cubemap (all faces white)\r\n * - No inputs (texture resource only)\r\n */\r\n constructor() {\r\n super();\r\n this._inputs = [];\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: ''\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @param manager - The serialization manager for loading textures\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * Only accepts DDS format, which is the standard format for cubemaps.\r\n * Includes validation to ensure the loaded texture is actually a cubemap.\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: ConstantTextureCubeNode,\r\n name: 'TextureCubeNode',\r\n noTitle: true,\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'Texture',\r\n type: 'object',\r\n default: null,\r\n options: {\r\n mimeTypes: ['image/x-dds']\r\n },\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: ConstantTextureCubeNode, value) {\r\n value.str[0] = this.textureId;\r\n },\r\n async set(this: ConstantTextureCubeNode, value) {\r\n const path = value?.str?.[0];\r\n this.textureId = typeof path === 'string' ? path : '';\r\n }\r\n },\r\n ...textureNodeProps\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'texCube'\r\n */\r\n protected getType(): string {\r\n return this.validate() ? '' : 'texCube';\r\n }\r\n}\r\n\r\n/**\r\n * UV panner node (scrolls UVs over time)\r\n *\r\n * @remarks\r\n * Computes:\r\n * `coord + time * speed`\r\n *\r\n * If `Coordinate` is not connected, the node defaults to mesh UV0 in IR.\r\n * If `Time` is not connected, the node defaults to elapsed time in IR.\r\n *\r\n * Inputs:\r\n * - Coordinate (vec2)\r\n * - Time (float)\r\n * - Speed (vec2)\r\n *\r\n * Output:\r\n * - Output 1: Panned UV (vec2)\r\n *\r\n * @example\r\n * ```typescript\r\n * const panner = new PannerNode();\r\n * panner.speedX = 0.1;\r\n * panner.speedY = 0.0;\r\n *\r\n * const tex = new ConstantTexture2DNode();\r\n * const sample = new TextureSampleNode();\r\n * sample.connectInput(1, tex, 1);\r\n * sample.connectInput(2, panner, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class PannerNode extends BaseGraphNode {\r\n /** Speed in U direction */\r\n private _speedX: number;\r\n /** Speed in V direction */\r\n private _speedY: number;\r\n /**\r\n * Creates a new panner node\r\n *\r\n * @remarks\r\n * Initializes with optional inputs for coordinate, time, and speed.\r\n */\r\n constructor() {\r\n super();\r\n this._speedX = 0;\r\n this._speedY = 0;\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'Coordinate',\r\n type: ['vec2']\r\n },\r\n {\r\n id: 2,\r\n name: 'Time',\r\n type: ['float']\r\n },\r\n {\r\n id: 3,\r\n name: 'Speed',\r\n type: ['vec2'],\r\n defaultValue: [this._speedX, this._speedY]\r\n }\r\n ];\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: ''\r\n }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'Panner'\r\n */\r\n toString() {\r\n return 'Panner';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: PannerNode,\r\n name: 'PannerNode',\r\n getProps(): PropertyAccessor<PannerNode>[] {\r\n return defineProps([\r\n {\r\n name: 'SpeedX',\r\n type: 'float',\r\n get(this: PannerNode, value) {\r\n value.num[0] = this.speedX;\r\n },\r\n set(this: PannerNode, value) {\r\n this.speedX = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'SpeedY',\r\n type: 'float',\r\n get(this: PannerNode, value) {\r\n value.num[0] = this.speedY;\r\n },\r\n set(this: PannerNode, value) {\r\n this.speedY = value.num[0];\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Gets speed in U direction\r\n */\r\n get speedX() {\r\n return this._speedX;\r\n }\r\n set speedX(val: number) {\r\n if (this._speedX !== val) {\r\n this._speedX = val;\r\n const speedInput = this._inputs.find((input) => input.id === 3);\r\n if (speedInput) {\r\n speedInput.defaultValue = [this._speedX, this._speedY];\r\n }\r\n this.dispatchEvent('changed');\r\n }\r\n }\r\n /**\r\n * Gets speed in V direction\r\n */\r\n get speedY() {\r\n return this._speedY;\r\n }\r\n set speedY(val: number) {\r\n if (this._speedY !== val) {\r\n this._speedY = val;\r\n const speedInput = this._inputs.find((input) => input.id === 3);\r\n if (speedInput) {\r\n speedInput.defaultValue = [this._speedX, this._speedY];\r\n }\r\n this.dispatchEvent('changed');\r\n }\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'vec2'\r\n */\r\n protected getType() {\r\n return 'vec2';\r\n }\r\n}\r\n\r\n/**\r\n * Texture sampling node\r\n *\r\n * @remarks\r\n * Samples a texture at the specified coordinates and returns the color value.\r\n * This is the primary way to read texture data in material shaders.\r\n *\r\n * Supports multiple texture types:\r\n * - **tex2D**: Requires vec2 coordinates (u, v)\r\n * - **tex2DArray**: Requires vec3 coordinates (u, v, layer)\r\n * - **texCube**: Requires vec3 direction vector\r\n *\r\n * Sampler types:\r\n * - **Color**: Standard color sampling (returns RGBA as-is)\r\n * - **Normal**: Normal map sampling (may apply special transformations)\r\n *\r\n * The sampling uses the texture's configured filtering and addressing modes.\r\n * Mipmap level is automatically selected based on screen-space derivatives.\r\n *\r\n * Inputs:\r\n * - Input 1: Texture sampler (tex2D, tex2DArray, or texCube)\r\n * - Input 2: Texture coordinates (vec2 for 2D, vec3 for array/cube)\r\n *\r\n * Output:\r\n * - Output 1: Sampled color (vec4 RGBA)\r\n *\r\n * @example\r\n * ```typescript\r\n * // Basic 2D texture sampling\r\n * const albedoTex = new ConstantTexture2DNode();\r\n * const uv = new VertexUVNode();\r\n *\r\n * const sample = new TextureSampleNode();\r\n * sample.samplerType = 'Color';\r\n * sample.connectInput(1, albedoTex, 1);\r\n * sample.connectInput(2, uv, 1);\r\n *\r\n * output.connectInput(1, sample, 1); // Use as base color\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Normal map sampling\r\n * const normalMap = new ConstantTexture2DNode();\r\n * const uv = new VertexUVNode();\r\n *\r\n * const sample = new TextureSampleNode();\r\n * sample.samplerType = 'Normal';\r\n * sample.connectInput(1, normalMap, 1);\r\n * sample.connectInput(2, uv, 1);\r\n *\r\n * output.connectInput(6, sample, 1); // Use as normal\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Cubemap environment sampling\r\n * const envMap = new ConstantTextureCubeNode();\r\n * const normal = new VertexNormalNode();\r\n * const viewDir = new ViewDirectionNode();\r\n *\r\n * const reflectDir = new ReflectNode();\r\n * reflectDir.connectInput(1, viewDir, 1);\r\n * reflectDir.connectInput(2, normal, 1);\r\n *\r\n * const sample = new TextureSampleNode();\r\n * sample.connectInput(1, envMap, 1);\r\n * sample.connectInput(2, reflectDir, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class TextureSampleNode extends BaseGraphNode {\r\n /** The type of sampling (Color or Normal) */\r\n samplerType: 'Color' | 'Normal';\r\n /** The shader parameter name for fallback texture uniform */\r\n private _paramName: string;\r\n /** Asset ID for fallback texture (used when texture input is not connected) */\r\n textureId: string;\r\n /** Whether fallback texture should be loaded in sRGB color space */\r\n sRGB: boolean;\r\n /** Horizontal texture coordinate wrapping mode for fallback texture */\r\n addressU: TextureAddressMode;\r\n /** Vertical texture coordinate wrapping mode for fallback texture */\r\n addressV: TextureAddressMode;\r\n /** Minification filter mode for fallback texture */\r\n filterMin: TextureFilterMode;\r\n /** Magnification filter mode for fallback texture */\r\n filterMag: TextureFilterMode;\r\n /** Mipmap filter mode for fallback texture */\r\n filterMip: TextureFilterMode;\r\n /**\r\n * Creates a new texture sample node\r\n *\r\n * @remarks\r\n * Initializes with:\r\n * - Two required inputs (texture and coordinates)\r\n * - One output (sampled color)\r\n * - Color sampler type by default\r\n */\r\n constructor() {\r\n super();\r\n this.samplerType = 'Color';\r\n this._paramName = getParamName();\r\n this.textureId = '';\r\n this.sRGB = true;\r\n this.addressU = 'clamp';\r\n this.addressV = 'clamp';\r\n this.filterMin = 'linear';\r\n this.filterMag = 'linear';\r\n this.filterMip = 'nearest';\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: 'RGBA'\r\n },\r\n {\r\n id: 2,\r\n name: 'R',\r\n swizzle: 'r'\r\n },\r\n {\r\n id: 3,\r\n name: 'G',\r\n swizzle: 'g'\r\n },\r\n {\r\n id: 4,\r\n name: 'B',\r\n swizzle: 'b'\r\n },\r\n {\r\n id: 5,\r\n name: 'A',\r\n swizzle: 'a'\r\n },\r\n {\r\n id: 6,\r\n name: 'RGB',\r\n swizzle: 'rgb'\r\n }\r\n ];\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'texture',\r\n type: ['tex2D', 'tex2DArray', 'texCube'],\r\n required: false\r\n },\r\n {\r\n id: 2,\r\n name: 'coord',\r\n type: ['vec2', 'vec3'],\r\n required: false\r\n }\r\n ];\r\n }\r\n /**\r\n * Indicates this node can provide a texture uniform when texture input is not connected.\r\n */\r\n get isUniform() {\r\n return !this._inputs[0].inputNode;\r\n }\r\n /**\r\n * Gets fallback texture uniform parameter name.\r\n */\r\n get paramName() {\r\n return this._paramName;\r\n }\r\n set paramName(val: string) {\r\n if (this._paramName !== val) {\r\n this._paramName = val;\r\n this.dispatchEvent('changed');\r\n }\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * Serializes the sampler type (Color or Normal).\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: TextureSampleNode,\r\n name: 'TextureSampleNode',\r\n getProps(): PropertyAccessor<TextureSampleNode>[] {\r\n return defineProps([\r\n ...(textureNodeProps as unknown as PropertyAccessor<TextureSampleNode>[]),\r\n {\r\n name: 'SamplerType',\r\n type: 'string',\r\n options: {\r\n enum: {\r\n labels: ['Color', 'Normal'],\r\n values: ['Color', 'Normal']\r\n }\r\n },\r\n get(this: TextureSampleNode, value) {\r\n value.str[0] = this.samplerType;\r\n },\r\n set(this: TextureSampleNode, value) {\r\n this.samplerType = value.str[0] as any;\r\n }\r\n },\r\n {\r\n name: 'Texture',\r\n type: 'object',\r\n default: null,\r\n options: {\r\n mimeTypes: [\r\n 'image/jpeg',\r\n 'image/png',\r\n 'image/tga',\r\n 'image/vnd.radiance',\r\n 'image/x-dds',\r\n 'image/webp'\r\n ]\r\n },\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: TextureSampleNode, value) {\r\n value.str[0] = this.textureId;\r\n },\r\n async set(this: TextureSampleNode, value) {\r\n const path = value?.str?.[0];\r\n this.textureId = typeof path === 'string' ? path : '';\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'textureSample'\r\n */\r\n toString(): string {\r\n return 'textureSample';\r\n }\r\n /**\r\n * Validates the node state and input type compatibility\r\n *\r\n * @returns Error message if invalid, empty string if valid\r\n *\r\n * @remarks\r\n * Validation ensures:\r\n * - Both inputs are connected\r\n * - Texture input is a valid texture type\r\n * - Coordinate input matches texture dimensionality:\r\n * - tex2D requires vec2\r\n * - tex2DArray requires vec3 (u, v, layer)\r\n * - texCube requires vec3 (direction)\r\n */\r\n protected validate(): string {\r\n const err = super.validate();\r\n if (err) {\r\n return err;\r\n }\r\n const texInput = this._inputs[0];\r\n const coordInput = this._inputs[1];\r\n const type0 = texInput.inputNode ? texInput.inputNode.getOutputType(texInput.inputId!) : 'tex2D';\r\n if (texInput.inputNode) {\r\n if (!type0) {\r\n return `Cannot determine type of argument \\`${texInput.name}\\``;\r\n }\r\n if (!texInput.type.includes(type0)) {\r\n return `Invalid input type of argument \\`${texInput.name}\\`: ${type0}`;\r\n }\r\n } else if (!this.textureId) {\r\n return 'Texture not specified';\r\n }\r\n if (coordInput.inputNode) {\r\n const type1 = coordInput.inputNode.getOutputType(coordInput.inputId!);\r\n if (!type1) {\r\n return `Cannot determine type of argument \\`${coordInput.name}\\``;\r\n }\r\n const expectedType1 = type0 === 'tex2D' ? 'vec2' : 'vec3';\r\n if (type1 !== expectedType1) {\r\n return `Texture coordinate type should be ${expectedType1}`;\r\n }\r\n }\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n */\r\n protected getType(id: number) {\r\n const err = this.validate();\r\n if (err) {\r\n return '';\r\n }\r\n if (id === 1) {\r\n return 'vec4';\r\n } else if (id === 6) {\r\n return 'vec3';\r\n } else {\r\n return 'float';\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Texture sampling with explicit gradients node\r\n *\r\n * @remarks\r\n * Samples a texture using explicitly provided screen-space gradients (derivatives)\r\n * instead of automatically computed ones. This allows precise control over mipmap\r\n * level selection and can be used for advanced effects.\r\n *\r\n * Use cases:\r\n * - Manual mipmap level control\r\n * - Sampling in non-fragment shaders (where automatic derivatives aren't available)\r\n * - Custom anisotropic filtering\r\n * - Texture sampling in control flow that breaks derivatives\r\n * - Advanced procedural effects\r\n *\r\n * Note: The current implementation appears identical to TextureSampleNode.\r\n * Full gradient support would require additional inputs for dPdx and dPdy.\r\n *\r\n * Inputs:\r\n * - Input 1: Texture sampler (tex2D, tex2DArray, or texCube)\r\n * - Input 2: Texture coordinates (vec2 or vec3)\r\n *\r\n * Output:\r\n * - Output 1: Sampled color (vec4 RGBA)\r\n *\r\n * @public\r\n */\r\nexport class TextureSampleGrad extends BaseGraphNode {\r\n /** The type of sampling (Color or Normal) */\r\n samplerType: 'Color' | 'Normal';\r\n /**\r\n * Creates a new texture sample with gradients node\r\n *\r\n * @remarks\r\n * Initializes with:\r\n * - Two required inputs (texture and coordinates)\r\n * - One output (sampled color)\r\n * - Color sampler type by default\r\n *\r\n * TODO: Add gradient inputs (dPdx, dPdy) for full explicit gradient support\r\n */\r\n constructor() {\r\n super();\r\n this.samplerType = 'Color';\r\n this._outputs = [\r\n {\r\n id: 1,\r\n name: ''\r\n }\r\n ];\r\n this._inputs = [\r\n {\r\n id: 1,\r\n name: 'texture',\r\n type: ['tex2D', 'tex2DArray', 'texCube'],\r\n required: true\r\n },\r\n {\r\n id: 2,\r\n name: 'coord',\r\n type: ['vec2', 'vec3'],\r\n required: true\r\n }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n *\r\n * @remarks\r\n * Currently returns TextureSampleNode serialization (likely needs separate class).\r\n */\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: TextureSampleNode,\r\n name: 'TextureSampleNode',\r\n getProps(): PropertyAccessor<TextureSampleNode>[] {\r\n return defineProps([\r\n {\r\n name: 'SamplerType',\r\n type: 'string',\r\n options: {\r\n enum: {\r\n labels: ['Color', 'Normal'],\r\n values: ['Color', 'Normal']\r\n }\r\n },\r\n get(this: TextureSampleNode, value) {\r\n value.str[0] = this.samplerType;\r\n },\r\n set(this: TextureSampleNode, value) {\r\n this.samplerType = value.str[0] as any;\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'textureSample'\r\n */\r\n toString(): string {\r\n return 'textureSample';\r\n }\r\n /**\r\n * Validates the node state and input type compatibility\r\n *\r\n * @returns Error message if invalid, empty string if valid\r\n *\r\n * @remarks\r\n * Validation ensures:\r\n * - Both inputs are connected\r\n * - Texture input is a valid texture type\r\n * - Coordinate input matches texture dimensionality\r\n */\r\n protected validate(): string {\r\n const err = super.validate();\r\n if (err) {\r\n return err;\r\n }\r\n const type0 = this._inputs[0].inputNode!.getOutputType(this._inputs[0].inputId!);\r\n if (!type0) {\r\n return `Cannot determine type of argument \\`${this._inputs[0].name}\\``;\r\n }\r\n if (!this._inputs[0].type.includes(type0)) {\r\n return `Invalid input type of argument \\`${this._inputs[0].name}\\`: ${type0}`;\r\n }\r\n const type1 = this._inputs[1].inputNode!.getOutputType(this._inputs[1].inputId!);\r\n if (!type1) {\r\n return `Cannot determine type of argument \\`${this._inputs[1].name}\\``;\r\n }\r\n const expectedType1 = type0 === 'tex2D' ? 'vec2' : 'vec3';\r\n if (type1 !== expectedType1) {\r\n return `Texture coordinate type should be ${expectedType1}`;\r\n }\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'vec4' (RGBA color)\r\n */\r\n protected getType(): string {\r\n return 'vec4';\r\n }\r\n}\r\n"],"names":["defaultTexture2D","DRef","defaultTextureCube","defaultTexture2DArray","getDefaultTexture2D","get","defaultTex","getDevice","createTexture2D","mipmapping","update","Uint8Array","set","getDefaultTexture2DArray","createTexture2DArray","getDefaultTextureCube","createCubeTexture","i","textureNodeProps","getTextureNodeProps","defineProps","name","type","isNullable","value","str","paramName","slice","test","console","log","default","bool","sRGB","options","enum","labels","values","addressU","addressV","filterMin","filterMag","filterMip","BaseTextureNode","BaseGraphNode","textureId","_paramName","getParamName","val","dispatchEvent","isUniform","toString","ConstantTexture2DNode","_outputs","id","getSerializationCls","ctor","noTitle","getProps","mimeTypes","path","validate","ConstantTexture2DArrayNode","ConstantTextureCubeNode","_inputs","PannerNode","_speedX","_speedY","defaultValue","num","speedX","speedY","speedInput","find","input","TextureSampleNode","samplerType","swizzle","required","inputNode","err","texInput","coordInput","type0","getOutputType","inputId","includes","type1","expectedType1","getType","TextureSampleGrad"],"mappings":";;;;;;AAaA;;;IAIA,MAAMA,mBAAoC,IAAIC,IAAAA,EAAAA;AAE9C;;;IAIA,MAAMC,qBAAwC,IAAID,IAAAA,EAAAA;AAElD;;;IAIA,MAAME,wBAA8C,IAAIF,IAAAA,EAAAA;AAExD;;;;;;;;;;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