@zephyr3d/scene 0.8.2 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/dist/animation/animationset.js +473 -60
  2. package/dist/animation/animationset.js.map +1 -1
  3. package/dist/animation/cloth/gpu_cloth_system.js +2516 -0
  4. package/dist/animation/cloth/gpu_cloth_system.js.map +1 -0
  5. package/dist/animation/fixed_geometry_cache_track.js +138 -0
  6. package/dist/animation/fixed_geometry_cache_track.js.map +1 -0
  7. package/dist/animation/geometry_cache_utils.js +120 -0
  8. package/dist/animation/geometry_cache_utils.js.map +1 -0
  9. package/dist/animation/ik_modifier.js +9 -1
  10. package/dist/animation/ik_modifier.js.map +1 -1
  11. package/dist/animation/joint_dynamics/collision.js +469 -0
  12. package/dist/animation/joint_dynamics/collision.js.map +1 -0
  13. package/dist/animation/joint_dynamics/constraints.js +329 -0
  14. package/dist/animation/joint_dynamics/constraints.js.map +1 -0
  15. package/dist/animation/joint_dynamics/controller.js +699 -0
  16. package/dist/animation/joint_dynamics/controller.js.map +1 -0
  17. package/dist/animation/joint_dynamics/joint_dynamics_system.js +393 -0
  18. package/dist/animation/joint_dynamics/joint_dynamics_system.js.map +1 -0
  19. package/dist/animation/joint_dynamics/solver.js +794 -0
  20. package/dist/animation/joint_dynamics/solver.js.map +1 -0
  21. package/dist/animation/joint_dynamics/types.js +19 -0
  22. package/dist/animation/joint_dynamics/types.js.map +1 -0
  23. package/dist/animation/joint_dynamics/vrm_spring_bone.js +46 -0
  24. package/dist/animation/joint_dynamics/vrm_spring_bone.js.map +1 -0
  25. package/dist/animation/joint_dynamics_modifier.js +51 -0
  26. package/dist/animation/joint_dynamics_modifier.js.map +1 -0
  27. package/dist/animation/pca_geometry_cache_track.js +222 -0
  28. package/dist/animation/pca_geometry_cache_track.js.map +1 -0
  29. package/dist/animation/skeleton.js +2011 -139
  30. package/dist/animation/skeleton.js.map +1 -1
  31. package/dist/animation/skeleton_modifier.js +3 -5
  32. package/dist/animation/skeleton_modifier.js.map +1 -1
  33. package/dist/animation/spring/multi_chain_spring_system.js +2 -0
  34. package/dist/animation/spring/multi_chain_spring_system.js.map +1 -1
  35. package/dist/animation/spring/spring_chain.js +3 -2
  36. package/dist/animation/spring/spring_chain.js.map +1 -1
  37. package/dist/animation/spring/spring_collider.js +35 -5
  38. package/dist/animation/spring/spring_collider.js.map +1 -1
  39. package/dist/animation/spring/spring_particle.js +1 -0
  40. package/dist/animation/spring/spring_particle.js.map +1 -1
  41. package/dist/animation/spring/spring_system.js +325 -28
  42. package/dist/animation/spring/spring_system.js.map +1 -1
  43. package/dist/animation/spring2/collision.js +469 -0
  44. package/dist/animation/spring2/collision.js.map +1 -0
  45. package/dist/animation/spring2/constraints.js +329 -0
  46. package/dist/animation/spring2/constraints.js.map +1 -0
  47. package/dist/animation/spring2/controller.js +434 -0
  48. package/dist/animation/spring2/controller.js.map +1 -0
  49. package/dist/animation/spring2/math.js +16 -0
  50. package/dist/animation/spring2/math.js.map +1 -0
  51. package/dist/animation/spring2/solver.js +624 -0
  52. package/dist/animation/spring2/solver.js.map +1 -0
  53. package/dist/animation/spring2/spring_system.js +118 -0
  54. package/dist/animation/spring2/spring_system.js.map +1 -0
  55. package/dist/animation/spring2/types.js +19 -0
  56. package/dist/animation/spring2/types.js.map +1 -0
  57. package/dist/animation/spring_modifier.js +17 -1
  58. package/dist/animation/spring_modifier.js.map +1 -1
  59. package/dist/app/engine.js +42 -15
  60. package/dist/app/engine.js.map +1 -1
  61. package/dist/app/runtimescript.js +132 -1
  62. package/dist/app/runtimescript.js.map +1 -1
  63. package/dist/app/screen.js +3 -3
  64. package/dist/app/screen.js.map +1 -1
  65. package/dist/app/scriptingsystem.js +69 -37
  66. package/dist/app/scriptingsystem.js.map +1 -1
  67. package/dist/app/scriptregistry.js +157 -146
  68. package/dist/app/scriptregistry.js.map +1 -1
  69. package/dist/asset/assetmanager.js +2 -1
  70. package/dist/asset/assetmanager.js.map +1 -1
  71. package/dist/asset/loaders/zabc/zabc_loader.js +570 -0
  72. package/dist/asset/loaders/zabc/zabc_loader.js.map +1 -0
  73. package/dist/asset/model.js +192 -0
  74. package/dist/asset/model.js.map +1 -1
  75. package/dist/camera/base.js +26 -7
  76. package/dist/camera/base.js.map +1 -1
  77. package/dist/camera/camera.js +146 -24
  78. package/dist/camera/camera.js.map +1 -1
  79. package/dist/camera/fps.js +2 -2
  80. package/dist/camera/fps.js.map +1 -1
  81. package/dist/camera/orbit.js +2 -2
  82. package/dist/camera/orbit.js.map +1 -1
  83. package/dist/index.d.ts +11728 -8535
  84. package/dist/index.js +29 -8
  85. package/dist/index.js.map +1 -1
  86. package/dist/material/lambert.js +1 -1
  87. package/dist/material/lambert.js.map +1 -1
  88. package/dist/material/material.js +9 -3
  89. package/dist/material/material.js.map +1 -1
  90. package/dist/material/meshmaterial.js +54 -7
  91. package/dist/material/meshmaterial.js.map +1 -1
  92. package/dist/material/mixins/lightmodel/blinnphong.js +17 -7
  93. package/dist/material/mixins/lightmodel/blinnphong.js.map +1 -1
  94. package/dist/material/mixins/lightmodel/lambert.js +7 -2
  95. package/dist/material/mixins/lightmodel/lambert.js.map +1 -1
  96. package/dist/material/mixins/lightmodel/pbrblueprintmixin.js +108 -16
  97. package/dist/material/mixins/lightmodel/pbrblueprintmixin.js.map +1 -1
  98. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +222 -14
  99. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
  100. package/dist/material/mixins/lightmodel/pbrspecularglossness.js +24 -12
  101. package/dist/material/mixins/lightmodel/pbrspecularglossness.js.map +1 -1
  102. package/dist/material/mixins/lit.js +11 -8
  103. package/dist/material/mixins/lit.js.map +1 -1
  104. package/dist/material/mixins/pbr/common.js +72 -5
  105. package/dist/material/mixins/pbr/common.js.map +1 -1
  106. package/dist/material/pbrblueprint.js +148 -1
  107. package/dist/material/pbrblueprint.js.map +1 -1
  108. package/dist/material/pbrmr.js +125 -2
  109. package/dist/material/pbrmr.js.map +1 -1
  110. package/dist/material/shader/helper.js +10 -4
  111. package/dist/material/shader/helper.js.map +1 -1
  112. package/dist/material/water.js +2 -2
  113. package/dist/material/water.js.map +1 -1
  114. package/dist/posteffect/coloradjust.js +145 -0
  115. package/dist/posteffect/coloradjust.js.map +1 -0
  116. package/dist/posteffect/taa.js +68 -32
  117. package/dist/posteffect/taa.js.map +1 -1
  118. package/dist/render/cluster_light.js +17 -12
  119. package/dist/render/cluster_light.js.map +1 -1
  120. package/dist/render/deferredlightpass.js +510 -0
  121. package/dist/render/deferredlightpass.js.map +1 -0
  122. package/dist/render/deferredshadowlightpass.js +428 -0
  123. package/dist/render/deferredshadowlightpass.js.map +1 -0
  124. package/dist/render/drawable.js.map +1 -1
  125. package/dist/render/drawable_mixin.js +21 -12
  126. package/dist/render/drawable_mixin.js.map +1 -1
  127. package/dist/render/envlight.js +20 -22
  128. package/dist/render/envlight.js.map +1 -1
  129. package/dist/render/gbufferpass.js +50 -0
  130. package/dist/render/gbufferpass.js.map +1 -0
  131. package/dist/render/lightpass.js +1 -2
  132. package/dist/render/lightpass.js.map +1 -1
  133. package/dist/render/primitive.js +1 -1
  134. package/dist/render/primitive.js.map +1 -1
  135. package/dist/render/render_queue.js +3 -2
  136. package/dist/render/render_queue.js.map +1 -1
  137. package/dist/render/renderer.js +5 -358
  138. package/dist/render/renderer.js.map +1 -1
  139. package/dist/render/rendergraph/executor.js +15 -12
  140. package/dist/render/rendergraph/executor.js.map +1 -1
  141. package/dist/render/rendergraph/forward_plus_builder.js +144 -88
  142. package/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
  143. package/dist/render/rendergraph/history_resource_manager.js +178 -0
  144. package/dist/render/rendergraph/history_resource_manager.js.map +1 -0
  145. package/dist/render/rendergraph/rendergraph.js +12 -1
  146. package/dist/render/rendergraph/rendergraph.js.map +1 -1
  147. package/dist/render/rendergraph/types.js +2 -2
  148. package/dist/render/rendergraph/types.js.map +1 -1
  149. package/dist/render/sky.js +26 -9
  150. package/dist/render/sky.js.map +1 -1
  151. package/dist/scene/basesprite.js +4 -3
  152. package/dist/scene/basesprite.js.map +1 -1
  153. package/dist/scene/batchgroup.js +4 -4
  154. package/dist/scene/environment.js +7 -4
  155. package/dist/scene/environment.js.map +1 -1
  156. package/dist/scene/light.js +184 -18
  157. package/dist/scene/light.js.map +1 -1
  158. package/dist/scene/mesh.js +30 -0
  159. package/dist/scene/mesh.js.map +1 -1
  160. package/dist/scene/particlesys.js +3 -2
  161. package/dist/scene/particlesys.js.map +1 -1
  162. package/dist/scene/raycast_visitor.js +29 -3
  163. package/dist/scene/raycast_visitor.js.map +1 -1
  164. package/dist/scene/scene.js +86 -19
  165. package/dist/scene/scene.js.map +1 -1
  166. package/dist/scene/scene_node.js +87 -31
  167. package/dist/scene/scene_node.js.map +1 -1
  168. package/dist/scene/script_attachment.js +59 -0
  169. package/dist/scene/script_attachment.js.map +1 -0
  170. package/dist/scene/terrain-cm/grass.js +3 -2
  171. package/dist/scene/terrain-cm/grass.js.map +1 -1
  172. package/dist/scene/terrain-cm/terrain-cm.js +4 -3
  173. package/dist/scene/terrain-cm/terrain-cm.js.map +1 -1
  174. package/dist/scene/water.js +3 -2
  175. package/dist/scene/water.js.map +1 -1
  176. package/dist/shaders/shadow.js +2 -2
  177. package/dist/shaders/shadow.js.map +1 -1
  178. package/dist/shadow/shadowmapper.js +74 -4
  179. package/dist/shadow/shadowmapper.js.map +1 -1
  180. package/dist/shapes/box.js +163 -0
  181. package/dist/shapes/box.js.map +1 -1
  182. package/dist/shapes/capsule.js +216 -0
  183. package/dist/shapes/capsule.js.map +1 -0
  184. package/dist/shapes/cylinder.js +91 -0
  185. package/dist/shapes/cylinder.js.map +1 -1
  186. package/dist/shapes/plane.js +32 -0
  187. package/dist/shapes/plane.js.map +1 -1
  188. package/dist/shapes/tetrahedron.js +211 -0
  189. package/dist/shapes/tetrahedron.js.map +1 -1
  190. package/dist/shapes/torus.js +173 -0
  191. package/dist/shapes/torus.js.map +1 -1
  192. package/dist/utility/blueprint/common/math.js +111 -1
  193. package/dist/utility/blueprint/common/math.js.map +1 -1
  194. package/dist/utility/blueprint/material/inputs.js +235 -1
  195. package/dist/utility/blueprint/material/inputs.js.map +1 -1
  196. package/dist/utility/blueprint/material/ir.js +154 -10
  197. package/dist/utility/blueprint/material/ir.js.map +1 -1
  198. package/dist/utility/blueprint/material/texture.js +273 -19
  199. package/dist/utility/blueprint/material/texture.js.map +1 -1
  200. package/dist/utility/serialization/json.js +12 -2
  201. package/dist/utility/serialization/json.js.map +1 -1
  202. package/dist/utility/serialization/manager.js +30 -11
  203. package/dist/utility/serialization/manager.js.map +1 -1
  204. package/dist/utility/serialization/scene/animation.js +250 -7
  205. package/dist/utility/serialization/scene/animation.js.map +1 -1
  206. package/dist/utility/serialization/scene/batch.js +4 -2
  207. package/dist/utility/serialization/scene/batch.js.map +1 -1
  208. package/dist/utility/serialization/scene/camera.js +154 -2
  209. package/dist/utility/serialization/scene/camera.js.map +1 -1
  210. package/dist/utility/serialization/scene/cloth_script.js +834 -0
  211. package/dist/utility/serialization/scene/cloth_script.js.map +1 -0
  212. package/dist/utility/serialization/scene/common.js +7 -0
  213. package/dist/utility/serialization/scene/common.js.map +1 -1
  214. package/dist/utility/serialization/scene/light.js +120 -4
  215. package/dist/utility/serialization/scene/light.js.map +1 -1
  216. package/dist/utility/serialization/scene/material.js +453 -1
  217. package/dist/utility/serialization/scene/material.js.map +1 -1
  218. package/dist/utility/serialization/scene/mesh.js +4 -2
  219. package/dist/utility/serialization/scene/mesh.js.map +1 -1
  220. package/dist/utility/serialization/scene/node.js +298 -10
  221. package/dist/utility/serialization/scene/node.js.map +1 -1
  222. package/dist/utility/serialization/scene/particle.js +4 -2
  223. package/dist/utility/serialization/scene/particle.js.map +1 -1
  224. package/dist/utility/serialization/scene/primitive.js +100 -3
  225. package/dist/utility/serialization/scene/primitive.js.map +1 -1
  226. package/dist/utility/serialization/scene/scene.js +130 -3
  227. package/dist/utility/serialization/scene/scene.js.map +1 -1
  228. package/dist/utility/serialization/scene/script.js +66 -0
  229. package/dist/utility/serialization/scene/script.js.map +1 -0
  230. package/dist/utility/serialization/scene/spring_script.js +596 -0
  231. package/dist/utility/serialization/scene/spring_script.js.map +1 -0
  232. package/dist/utility/serialization/scene/sprite.js +5 -3
  233. package/dist/utility/serialization/scene/sprite.js.map +1 -1
  234. package/dist/utility/serialization/scene/terrain.js +4 -2
  235. package/dist/utility/serialization/scene/terrain.js.map +1 -1
  236. package/dist/utility/serialization/scene/water.js +4 -2
  237. package/dist/utility/serialization/scene/water.js.map +1 -1
  238. package/dist/utility/serialization/types.js.map +1 -1
  239. package/dist/values.js +5 -1
  240. package/dist/values.js.map +1 -1
  241. package/package.json +3 -3
@@ -485,7 +485,8 @@ import { defineProps } from '../../serialization/types.js';
485
485
  value.str[0] = this.textureId;
486
486
  },
487
487
  async set (value) {
488
- this.textureId = value.str[0] ?? '';
488
+ const path = value?.str?.[0];
489
+ this.textureId = typeof path === 'string' ? path : '';
489
490
  }
490
491
  },
491
492
  ...textureNodeProps
@@ -589,7 +590,8 @@ import { defineProps } from '../../serialization/types.js';
589
590
  value.str[0] = this.textureId;
590
591
  },
591
592
  async set (value) {
592
- this.textureId = value.str[0] ?? '';
593
+ const path = value?.str?.[0];
594
+ this.textureId = typeof path === 'string' ? path : '';
593
595
  }
594
596
  },
595
597
  ...textureNodeProps
@@ -706,7 +708,8 @@ import { defineProps } from '../../serialization/types.js';
706
708
  value.str[0] = this.textureId;
707
709
  },
708
710
  async set (value) {
709
- this.textureId = value.str[0] ?? '';
711
+ const path = value?.str?.[0];
712
+ this.textureId = typeof path === 'string' ? path : '';
710
713
  }
711
714
  },
712
715
  ...textureNodeProps
@@ -722,6 +725,175 @@ import { defineProps } from '../../serialization/types.js';
722
725
  return this.validate() ? '' : 'texCube';
723
726
  }
724
727
  }
728
+ /**
729
+ * UV panner node (scrolls UVs over time)
730
+ *
731
+ * @remarks
732
+ * Computes:
733
+ * `coord + time * speed`
734
+ *
735
+ * If `Coordinate` is not connected, the node defaults to mesh UV0 in IR.
736
+ * If `Time` is not connected, the node defaults to elapsed time in IR.
737
+ *
738
+ * Inputs:
739
+ * - Coordinate (vec2)
740
+ * - Time (float)
741
+ * - Speed (vec2)
742
+ *
743
+ * Output:
744
+ * - Output 1: Panned UV (vec2)
745
+ *
746
+ * @example
747
+ * ```typescript
748
+ * const panner = new PannerNode();
749
+ * panner.speedX = 0.1;
750
+ * panner.speedY = 0.0;
751
+ *
752
+ * const tex = new ConstantTexture2DNode();
753
+ * const sample = new TextureSampleNode();
754
+ * sample.connectInput(1, tex, 1);
755
+ * sample.connectInput(2, panner, 1);
756
+ * ```
757
+ *
758
+ * @public
759
+ */ class PannerNode extends BaseGraphNode {
760
+ /** Speed in U direction */ _speedX;
761
+ /** Speed in V direction */ _speedY;
762
+ /**
763
+ * Creates a new panner node
764
+ *
765
+ * @remarks
766
+ * Initializes with optional inputs for coordinate, time, and speed.
767
+ */ constructor(){
768
+ super();
769
+ this._speedX = 0;
770
+ this._speedY = 0;
771
+ this._inputs = [
772
+ {
773
+ id: 1,
774
+ name: 'Coordinate',
775
+ type: [
776
+ 'vec2'
777
+ ]
778
+ },
779
+ {
780
+ id: 2,
781
+ name: 'Time',
782
+ type: [
783
+ 'float'
784
+ ]
785
+ },
786
+ {
787
+ id: 3,
788
+ name: 'Speed',
789
+ type: [
790
+ 'vec2'
791
+ ],
792
+ defaultValue: [
793
+ this._speedX,
794
+ this._speedY
795
+ ]
796
+ }
797
+ ];
798
+ this._outputs = [
799
+ {
800
+ id: 1,
801
+ name: ''
802
+ }
803
+ ];
804
+ }
805
+ /**
806
+ * Generates a string representation of this node
807
+ *
808
+ * @returns 'Panner'
809
+ */ toString() {
810
+ return 'Panner';
811
+ }
812
+ /**
813
+ * Gets the serialization descriptor for this node type
814
+ *
815
+ * @returns Serialization class descriptor
816
+ */ static getSerializationCls() {
817
+ return {
818
+ ctor: PannerNode,
819
+ name: 'PannerNode',
820
+ getProps () {
821
+ return defineProps([
822
+ {
823
+ name: 'SpeedX',
824
+ type: 'float',
825
+ get (value) {
826
+ value.num[0] = this.speedX;
827
+ },
828
+ set (value) {
829
+ this.speedX = value.num[0];
830
+ }
831
+ },
832
+ {
833
+ name: 'SpeedY',
834
+ type: 'float',
835
+ get (value) {
836
+ value.num[0] = this.speedY;
837
+ },
838
+ set (value) {
839
+ this.speedY = value.num[0];
840
+ }
841
+ }
842
+ ]);
843
+ }
844
+ };
845
+ }
846
+ /**
847
+ * Gets speed in U direction
848
+ */ get speedX() {
849
+ return this._speedX;
850
+ }
851
+ set speedX(val) {
852
+ if (this._speedX !== val) {
853
+ this._speedX = val;
854
+ const speedInput = this._inputs.find((input)=>input.id === 3);
855
+ if (speedInput) {
856
+ speedInput.defaultValue = [
857
+ this._speedX,
858
+ this._speedY
859
+ ];
860
+ }
861
+ this.dispatchEvent('changed');
862
+ }
863
+ }
864
+ /**
865
+ * Gets speed in V direction
866
+ */ get speedY() {
867
+ return this._speedY;
868
+ }
869
+ set speedY(val) {
870
+ if (this._speedY !== val) {
871
+ this._speedY = val;
872
+ const speedInput = this._inputs.find((input)=>input.id === 3);
873
+ if (speedInput) {
874
+ speedInput.defaultValue = [
875
+ this._speedX,
876
+ this._speedY
877
+ ];
878
+ }
879
+ this.dispatchEvent('changed');
880
+ }
881
+ }
882
+ /**
883
+ * Validates the node state
884
+ *
885
+ * @returns Empty string (always valid)
886
+ */ validate() {
887
+ return '';
888
+ }
889
+ /**
890
+ * Gets the output type
891
+ *
892
+ * @returns 'vec2'
893
+ */ getType() {
894
+ return 'vec2';
895
+ }
896
+ }
725
897
  /**
726
898
  * Texture sampling node
727
899
  *
@@ -795,6 +967,14 @@ import { defineProps } from '../../serialization/types.js';
795
967
  * @public
796
968
  */ class TextureSampleNode extends BaseGraphNode {
797
969
  /** The type of sampling (Color or Normal) */ samplerType;
970
+ /** The shader parameter name for fallback texture uniform */ _paramName;
971
+ /** Asset ID for fallback texture (used when texture input is not connected) */ textureId;
972
+ /** Whether fallback texture should be loaded in sRGB color space */ sRGB;
973
+ /** Horizontal texture coordinate wrapping mode for fallback texture */ addressU;
974
+ /** Vertical texture coordinate wrapping mode for fallback texture */ addressV;
975
+ /** Minification filter mode for fallback texture */ filterMin;
976
+ /** Magnification filter mode for fallback texture */ filterMag;
977
+ /** Mipmap filter mode for fallback texture */ filterMip;
798
978
  /**
799
979
  * Creates a new texture sample node
800
980
  *
@@ -806,6 +986,14 @@ import { defineProps } from '../../serialization/types.js';
806
986
  */ constructor(){
807
987
  super();
808
988
  this.samplerType = 'Color';
989
+ this._paramName = getParamName();
990
+ this.textureId = '';
991
+ this.sRGB = true;
992
+ this.addressU = 'clamp';
993
+ this.addressV = 'clamp';
994
+ this.filterMin = 'linear';
995
+ this.filterMag = 'linear';
996
+ this.filterMip = 'nearest';
809
997
  this._outputs = [
810
998
  {
811
999
  id: 1,
@@ -846,7 +1034,7 @@ import { defineProps } from '../../serialization/types.js';
846
1034
  'tex2DArray',
847
1035
  'texCube'
848
1036
  ],
849
- required: true
1037
+ required: false
850
1038
  },
851
1039
  {
852
1040
  id: 2,
@@ -855,11 +1043,27 @@ import { defineProps } from '../../serialization/types.js';
855
1043
  'vec2',
856
1044
  'vec3'
857
1045
  ],
858
- required: true
1046
+ required: false
859
1047
  }
860
1048
  ];
861
1049
  }
862
1050
  /**
1051
+ * Indicates this node can provide a texture uniform when texture input is not connected.
1052
+ */ get isUniform() {
1053
+ return !this._inputs[0].inputNode;
1054
+ }
1055
+ /**
1056
+ * Gets fallback texture uniform parameter name.
1057
+ */ get paramName() {
1058
+ return this._paramName;
1059
+ }
1060
+ set paramName(val) {
1061
+ if (this._paramName !== val) {
1062
+ this._paramName = val;
1063
+ this.dispatchEvent('changed');
1064
+ }
1065
+ }
1066
+ /**
863
1067
  * Gets the serialization descriptor for this node type
864
1068
  *
865
1069
  * @returns Serialization class descriptor
@@ -872,6 +1076,23 @@ import { defineProps } from '../../serialization/types.js';
872
1076
  name: 'TextureSampleNode',
873
1077
  getProps () {
874
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
+ },
875
1096
  {
876
1097
  name: 'SamplerType',
877
1098
  type: 'string',
@@ -893,6 +1114,31 @@ import { defineProps } from '../../serialization/types.js';
893
1114
  set (value) {
894
1115
  this.samplerType = value.str[0];
895
1116
  }
1117
+ },
1118
+ {
1119
+ name: 'Texture',
1120
+ type: 'object',
1121
+ default: null,
1122
+ options: {
1123
+ mimeTypes: [
1124
+ 'image/jpeg',
1125
+ 'image/png',
1126
+ 'image/tga',
1127
+ 'image/vnd.radiance',
1128
+ 'image/x-dds',
1129
+ 'image/webp'
1130
+ ]
1131
+ },
1132
+ isNullable () {
1133
+ return true;
1134
+ },
1135
+ get (value) {
1136
+ value.str[0] = this.textureId;
1137
+ },
1138
+ async set (value) {
1139
+ const path = value?.str?.[0];
1140
+ this.textureId = typeof path === 'string' ? path : '';
1141
+ }
896
1142
  }
897
1143
  ]);
898
1144
  }
@@ -923,20 +1169,28 @@ import { defineProps } from '../../serialization/types.js';
923
1169
  if (err) {
924
1170
  return err;
925
1171
  }
926
- const type0 = this._inputs[0].inputNode.getOutputType(this._inputs[0].inputId);
927
- if (!type0) {
928
- return `Cannot determine type of argument \`${this._inputs[0].name}\``;
929
- }
930
- if (!this._inputs[0].type.includes(type0)) {
931
- return `Invalid input type of argument \`${this._inputs[0].name}\`: ${type0}`;
932
- }
933
- const type1 = this._inputs[1].inputNode.getOutputType(this._inputs[1].inputId);
934
- if (!type1) {
935
- return `Cannot determine type of argument \`${this._inputs[1].name}\``;
1172
+ const texInput = this._inputs[0];
1173
+ const coordInput = this._inputs[1];
1174
+ const type0 = texInput.inputNode ? texInput.inputNode.getOutputType(texInput.inputId) : 'tex2D';
1175
+ if (texInput.inputNode) {
1176
+ if (!type0) {
1177
+ return `Cannot determine type of argument \`${texInput.name}\``;
1178
+ }
1179
+ if (!texInput.type.includes(type0)) {
1180
+ return `Invalid input type of argument \`${texInput.name}\`: ${type0}`;
1181
+ }
1182
+ } else if (!this.textureId) {
1183
+ return 'Texture not specified';
936
1184
  }
937
- const expectedType1 = type0 === 'tex2D' ? 'vec2' : 'vec3';
938
- if (type1 !== expectedType1) {
939
- return `Texture coordinate type should be ${expectedType1}`;
1185
+ if (coordInput.inputNode) {
1186
+ const type1 = coordInput.inputNode.getOutputType(coordInput.inputId);
1187
+ if (!type1) {
1188
+ return `Cannot determine type of argument \`${coordInput.name}\``;
1189
+ }
1190
+ const expectedType1 = type0 === 'tex2D' ? 'vec2' : 'vec3';
1191
+ if (type1 !== expectedType1) {
1192
+ return `Texture coordinate type should be ${expectedType1}`;
1193
+ }
940
1194
  }
941
1195
  return '';
942
1196
  }
@@ -1112,5 +1366,5 @@ import { defineProps } from '../../serialization/types.js';
1112
1366
  }
1113
1367
  }
1114
1368
 
1115
- export { BaseTextureNode, ConstantTexture2DArrayNode, ConstantTexture2DNode, ConstantTextureCubeNode, TextureSampleGrad, TextureSampleNode, getDefaultTexture2D, getDefaultTexture2DArray, getDefaultTextureCube };
1369
+ export { BaseTextureNode, ConstantTexture2DArrayNode, ConstantTexture2DNode, ConstantTextureCubeNode, PannerNode, TextureSampleGrad, TextureSampleNode, getDefaultTexture2D, getDefaultTexture2DArray, getDefaultTextureCube };
1116
1370
  //# sourceMappingURL=texture.js.map
@@ -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 this.textureId = value.str[0] ?? '';\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 this.textureId = value.str[0] ?? '';\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 this.textureId = value.str[0] ?? '';\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 * 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 /**\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._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: 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 * 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: '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 * - 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 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 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","validate","ConstantTexture2DArrayNode","ConstantTextureCubeNode","_inputs","TextureSampleNode","samplerType","swizzle","required","err","type0","inputNode","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,CAAAA,GAAG,EAAI,EAAA;AAC3B,QAAA,MAAMC,aAAaC,SAAYC,EAAAA,CAAAA,eAAe,CAAC,YAAA,EAAc,GAAG,CAAG,EAAA;YACjEC,UAAY,EAAA;AACd,SAAA,CAAA;QACAH,UAAWI,CAAAA,MAAM,CAAC,IAAIC,UAAW,CAAA;AAAC,YAAA,GAAA;AAAK,YAAA,GAAA;AAAK,YAAA,GAAA;AAAK,YAAA;SAAI,CAAG,EAAA,CAAA,EAAG,GAAG,CAAG,EAAA,CAAA,CAAA;AACjEX,QAAAA,gBAAAA,CAAiBY,GAAG,CAACN,UAAAA,CAAAA;AACvB;AACA,IAAA,OAAON,iBAAiBK,GAAG,EAAA;AAC7B;AAEA;;;;;;;;;;AAUC,IACM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AC,CAAA,CAAE,CAAC1C,IAAI,CAAC,IAAI,EAAEgD,KAAO,CAAA,CAAA;AAC/E;AACA,QAAA,MAAMK,QAAQ,IAAI,CAACX,OAAO,CAAC,EAAE,CAACO,SAAS,CAAEC,aAAa,CAAC,IAAI,CAACR,OAAO,CAAC,CAAA,CAAE,CAACS,OAAO,CAAA;AAC9E,QAAA,IAAI,CAACE,KAAO,EAAA;AACV,YAAA,OAAO,CAAC,oCAAoC,EAAE,IAAI,CAACX,OAAO,CAAC,CAAA,CAAE,CAAC1C,IAAI,CAAC,EAAE,CAAC;AACxE;QACA,MAAMsD,aAAAA,GAAgBN,KAAU,KAAA,OAAA,GAAU,MAAS,GAAA,MAAA;AACnD,QAAA,IAAIK,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 {\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,CAAAA,GAAG,EAAI,EAAA;AAC3B,QAAA,MAAMC,aAAaC,SAAYC,EAAAA,CAAAA,eAAe,CAAC,YAAA,EAAc,GAAG,CAAG,EAAA;YACjEC,UAAY,EAAA;AACd,SAAA,CAAA;QACAH,UAAWI,CAAAA,MAAM,CAAC,IAAIC,UAAW,CAAA;AAAC,YAAA,GAAA;AAAK,YAAA,GAAA;AAAK,YAAA,GAAA;AAAK,YAAA;SAAI,CAAG,EAAA,CAAA,EAAG,GAAG,CAAG,EAAA,CAAA,CAAA;AACjEX,QAAAA,gBAAAA,CAAiBY,GAAG,CAACN,UAAAA,CAAAA;AACvB;AACA,IAAA,OAAON,iBAAiBK,GAAG,EAAA;AAC7B;AAEA;;;;;;;;;;AAUC,IACM,SAASQ,wBAAAA,GAAAA;IACd,IAAI,CAACV,qBAAsBE,CAAAA,GAAG,EAAI,EAAA;AAChC,QAAA,MAAMC,aAAaC,SAAYO,EAAAA,CAAAA,oBAAoB,CAAC,YAAc,EAAA,CAAA,EAAG,GAAG,CAAG,EAAA;YACzEL,UAAY,EAAA;AACd,SAAA,CAAA;QACAH,UAAWI,CAAAA,MAAM,CAAC,IAAIC,UAAW,CAAA;AAAC,YAAA,GAAA;AAAK,YAAA,GAAA;AAAK,YAAA,GAAA;AAAK,YAAA;AAAI,SAAA,CAAA,EAAG,CAAG,EAAA,CAAA,EAAG,CAAG,EAAA,C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