three-stdlib 2.8.9 → 2.8.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (318) hide show
  1. package/Nodes-607e9ed8.js +471 -0
  2. package/Nodes-627a8bdf.js +1 -0
  3. package/index.cjs.js +1 -1
  4. package/index.d.ts +0 -75
  5. package/index.js +70 -76
  6. package/loaders/NodeMaterialLoader.cjs.js +1 -1
  7. package/loaders/NodeMaterialLoader.js +2 -136
  8. package/nodes/Nodes.cjs.js +1 -1
  9. package/nodes/Nodes.js +203 -76
  10. package/nodes/ShaderNode.cjs.js +1 -0
  11. package/nodes/ShaderNode.js +308 -0
  12. package/nodes/accessors/BufferNode.cjs.js +1 -0
  13. package/nodes/accessors/BufferNode.js +18 -0
  14. package/nodes/accessors/CameraNode.cjs.js +1 -1
  15. package/nodes/accessors/CameraNode.js +32 -138
  16. package/nodes/accessors/CubeTextureNode.cjs.js +1 -0
  17. package/nodes/accessors/CubeTextureNode.js +53 -0
  18. package/nodes/accessors/MaterialNode.cjs.js +1 -0
  19. package/nodes/accessors/MaterialNode.js +80 -0
  20. package/nodes/accessors/MaterialReferenceNode.cjs.js +1 -0
  21. package/nodes/accessors/MaterialReferenceNode.js +16 -0
  22. package/nodes/accessors/ModelNode.cjs.js +1 -0
  23. package/nodes/accessors/ModelNode.js +10 -0
  24. package/nodes/accessors/ModelViewProjectionNode.cjs.js +1 -0
  25. package/nodes/accessors/ModelViewProjectionNode.js +22 -0
  26. package/nodes/accessors/NormalNode.cjs.js +1 -1
  27. package/nodes/accessors/NormalNode.js +48 -78
  28. package/nodes/accessors/Object3DNode.cjs.js +1 -0
  29. package/nodes/accessors/Object3DNode.js +85 -0
  30. package/nodes/accessors/PointUVNode.cjs.js +1 -0
  31. package/nodes/accessors/PointUVNode.js +16 -0
  32. package/nodes/accessors/PositionNode.cjs.js +1 -1
  33. package/nodes/accessors/PositionNode.js +49 -87
  34. package/nodes/accessors/ReferenceNode.cjs.js +1 -0
  35. package/nodes/accessors/ReferenceNode.js +43 -0
  36. package/nodes/accessors/ReflectNode.cjs.js +1 -1
  37. package/nodes/accessors/ReflectNode.js +35 -98
  38. package/nodes/accessors/SkinningNode.cjs.js +1 -0
  39. package/nodes/accessors/SkinningNode.js +59 -0
  40. package/nodes/accessors/TextureNode.cjs.js +1 -0
  41. package/nodes/accessors/TextureNode.js +68 -0
  42. package/nodes/accessors/UVNode.cjs.js +1 -1
  43. package/nodes/accessors/UVNode.js +20 -38
  44. package/nodes/core/ArrayUniformNode.cjs.js +1 -0
  45. package/nodes/core/ArrayUniformNode.js +17 -0
  46. package/nodes/core/AttributeNode.cjs.js +1 -1
  47. package/nodes/core/AttributeNode.js +31 -40
  48. package/nodes/core/BypassNode.cjs.js +1 -0
  49. package/nodes/core/BypassNode.js +28 -0
  50. package/nodes/core/CodeNode.cjs.js +1 -0
  51. package/nodes/core/CodeNode.js +35 -0
  52. package/nodes/core/ConstNode.cjs.js +1 -1
  53. package/nodes/core/ConstNode.js +10 -78
  54. package/nodes/core/ContextNode.cjs.js +1 -0
  55. package/nodes/core/ContextNode.js +26 -0
  56. package/nodes/core/ExpressionNode.cjs.js +1 -1
  57. package/nodes/core/ExpressionNode.js +19 -8
  58. package/nodes/core/FunctionCallNode.cjs.js +1 -1
  59. package/nodes/core/FunctionCallNode.js +31 -60
  60. package/nodes/core/FunctionNode.cjs.js +1 -1
  61. package/nodes/core/FunctionNode.js +45 -166
  62. package/nodes/core/InputNode.cjs.js +1 -1
  63. package/nodes/core/InputNode.js +43 -57
  64. package/nodes/core/Node.cjs.js +1 -1
  65. package/nodes/core/Node.js +155 -113
  66. package/nodes/core/NodeAttribute.cjs.js +1 -0
  67. package/nodes/core/NodeAttribute.js +11 -0
  68. package/nodes/core/NodeBuilder.cjs.js +1 -1
  69. package/nodes/core/NodeBuilder.js +422 -548
  70. package/nodes/core/NodeCode.cjs.js +1 -0
  71. package/nodes/core/NodeCode.js +13 -0
  72. package/nodes/core/NodeFrame.cjs.js +1 -1
  73. package/nodes/core/NodeFrame.js +34 -27
  74. package/nodes/core/NodeFunction.cjs.js +1 -0
  75. package/nodes/core/NodeFunction.js +17 -0
  76. package/nodes/core/NodeFunctionInput.cjs.js +1 -0
  77. package/nodes/core/NodeFunctionInput.js +14 -0
  78. package/nodes/core/NodeKeywords.cjs.js +1 -0
  79. package/nodes/core/NodeKeywords.js +54 -0
  80. package/nodes/core/NodeParser.cjs.js +1 -0
  81. package/nodes/core/NodeParser.js +8 -0
  82. package/nodes/core/NodeUniform.cjs.js +1 -1
  83. package/nodes/core/NodeUniform.js +18 -17
  84. package/nodes/core/NodeUtils.cjs.js +1 -1
  85. package/nodes/core/NodeUtils.js +55 -35
  86. package/nodes/core/NodeVar.cjs.js +1 -0
  87. package/nodes/core/NodeVar.js +11 -0
  88. package/nodes/core/NodeVary.cjs.js +1 -0
  89. package/nodes/core/NodeVary.js +11 -0
  90. package/nodes/core/PropertyNode.cjs.js +1 -0
  91. package/nodes/core/PropertyNode.js +26 -0
  92. package/nodes/core/TempNode.cjs.js +1 -1
  93. package/nodes/core/TempNode.js +21 -88
  94. package/nodes/core/UniformNode.cjs.js +1 -0
  95. package/nodes/core/UniformNode.js +28 -0
  96. package/nodes/core/VarNode.cjs.js +1 -1
  97. package/nodes/core/VarNode.js +28 -35
  98. package/nodes/core/VaryNode.cjs.js +1 -0
  99. package/nodes/core/VaryNode.js +38 -0
  100. package/nodes/core/constants.cjs.js +1 -0
  101. package/nodes/core/constants.js +11 -0
  102. package/nodes/display/ColorSpaceNode.cjs.js +1 -0
  103. package/nodes/display/ColorSpaceNode.js +67 -0
  104. package/nodes/display/NormalMapNode.cjs.js +1 -0
  105. package/nodes/display/NormalMapNode.js +71 -0
  106. package/nodes/fog/FogNode.cjs.js +1 -0
  107. package/nodes/fog/FogNode.js +18 -0
  108. package/nodes/fog/FogRangeNode.cjs.js +1 -0
  109. package/nodes/fog/FogRangeNode.js +20 -0
  110. package/nodes/functions/BSDFs.cjs.js +1 -0
  111. package/nodes/functions/BSDFs.js +121 -0
  112. package/nodes/functions/PhysicalMaterialFunctions.cjs.js +1 -0
  113. package/nodes/functions/PhysicalMaterialFunctions.js +57 -0
  114. package/nodes/lights/LightContextNode.cjs.js +1 -0
  115. package/nodes/lights/LightContextNode.js +43 -0
  116. package/nodes/lights/LightNode.cjs.js +1 -0
  117. package/nodes/lights/LightNode.js +61 -0
  118. package/nodes/lights/LightsNode.cjs.js +1 -0
  119. package/nodes/lights/LightsNode.js +77 -0
  120. package/nodes/loaders/NodeLoader.cjs.js +1 -0
  121. package/nodes/loaders/NodeLoader.js +80 -0
  122. package/nodes/loaders/NodeMaterialLoader.cjs.js +1 -0
  123. package/nodes/loaders/NodeMaterialLoader.js +29 -0
  124. package/nodes/loaders/NodeObjectLoader.cjs.js +1 -0
  125. package/nodes/loaders/NodeObjectLoader.js +49 -0
  126. package/nodes/materials/LineBasicNodeMaterial.cjs.js +1 -0
  127. package/nodes/materials/LineBasicNodeMaterial.js +31 -0
  128. package/nodes/materials/Materials.cjs.js +1 -0
  129. package/nodes/materials/Materials.js +27 -0
  130. package/nodes/materials/MeshBasicNodeMaterial.cjs.js +1 -0
  131. package/nodes/materials/MeshBasicNodeMaterial.js +32 -0
  132. package/nodes/materials/MeshStandardNodeMaterial.cjs.js +1 -1
  133. package/nodes/materials/MeshStandardNodeMaterial.js +41 -13
  134. package/nodes/materials/NodeMaterial.cjs.js +1 -1
  135. package/nodes/materials/NodeMaterial.js +67 -140
  136. package/nodes/materials/PointsNodeMaterial.cjs.js +1 -0
  137. package/nodes/materials/PointsNodeMaterial.js +34 -0
  138. package/nodes/math/CondNode.cjs.js +1 -1
  139. package/nodes/math/CondNode.js +33 -74
  140. package/nodes/math/MathNode.cjs.js +1 -1
  141. package/nodes/math/MathNode.js +193 -193
  142. package/nodes/math/OperatorNode.cjs.js +1 -1
  143. package/nodes/math/OperatorNode.js +116 -52
  144. package/nodes/parsers/GLSLNodeFunction.cjs.js +1 -0
  145. package/nodes/parsers/GLSLNodeFunction.js +101 -0
  146. package/nodes/parsers/GLSLNodeParser.cjs.js +1 -0
  147. package/nodes/parsers/GLSLNodeParser.js +13 -0
  148. package/nodes/parsers/WGSLNodeFunction.cjs.js +1 -0
  149. package/nodes/parsers/WGSLNodeFunction.js +71 -0
  150. package/nodes/parsers/WGSLNodeParser.cjs.js +1 -0
  151. package/nodes/parsers/WGSLNodeParser.js +13 -0
  152. package/nodes/procedural/CheckerNode.cjs.js +1 -1
  153. package/nodes/procedural/CheckerNode.js +22 -40
  154. package/nodes/utils/ArrayElementNode.cjs.js +1 -0
  155. package/nodes/utils/ArrayElementNode.js +22 -0
  156. package/nodes/utils/ConvertNode.cjs.js +1 -0
  157. package/nodes/utils/ConvertNode.js +29 -0
  158. package/nodes/utils/JoinNode.cjs.js +1 -1
  159. package/nodes/utils/JoinNode.js +19 -69
  160. package/nodes/utils/MatcapUVNode.cjs.js +1 -0
  161. package/nodes/utils/MatcapUVNode.js +18 -0
  162. package/nodes/utils/OscNode.cjs.js +1 -0
  163. package/nodes/utils/OscNode.js +55 -0
  164. package/nodes/utils/SplitNode.cjs.js +1 -0
  165. package/nodes/utils/SplitNode.js +58 -0
  166. package/nodes/utils/SpriteSheetUVNode.cjs.js +1 -0
  167. package/nodes/utils/SpriteSheetUVNode.js +39 -0
  168. package/nodes/utils/TimerNode.cjs.js +1 -1
  169. package/nodes/utils/TimerNode.js +38 -56
  170. package/package.json +1 -1
  171. package/Nodes-894ac9dc.js +0 -1
  172. package/Nodes-af575af7.js +0 -157
  173. package/nodes/accessors/ColorsNode.cjs.js +0 -1
  174. package/nodes/accessors/ColorsNode.d.ts +0 -10
  175. package/nodes/accessors/ColorsNode.js +0 -40
  176. package/nodes/accessors/LightNode.cjs.js +0 -1
  177. package/nodes/accessors/LightNode.d.ts +0 -12
  178. package/nodes/accessors/LightNode.js +0 -41
  179. package/nodes/accessors/ResolutionNode.cjs.js +0 -1
  180. package/nodes/accessors/ResolutionNode.d.ts +0 -14
  181. package/nodes/accessors/ResolutionNode.js +0 -41
  182. package/nodes/accessors/ScreenUVNode.cjs.js +0 -1
  183. package/nodes/accessors/ScreenUVNode.d.ts +0 -11
  184. package/nodes/accessors/ScreenUVNode.js +0 -43
  185. package/nodes/core/NodeLib.cjs.js +0 -1
  186. package/nodes/core/NodeLib.d.ts +0 -22
  187. package/nodes/core/NodeLib.js +0 -37
  188. package/nodes/core/StructNode.cjs.js +0 -1
  189. package/nodes/core/StructNode.d.ts +0 -19
  190. package/nodes/core/StructNode.js +0 -72
  191. package/nodes/effects/BlurNode.cjs.js +0 -1
  192. package/nodes/effects/BlurNode.d.ts +0 -31
  193. package/nodes/effects/BlurNode.js +0 -100
  194. package/nodes/effects/ColorAdjustmentNode.cjs.js +0 -1
  195. package/nodes/effects/ColorAdjustmentNode.d.ts +0 -27
  196. package/nodes/effects/ColorAdjustmentNode.js +0 -73
  197. package/nodes/effects/LuminanceNode.cjs.js +0 -1
  198. package/nodes/effects/LuminanceNode.d.ts +0 -18
  199. package/nodes/effects/LuminanceNode.js +0 -46
  200. package/nodes/inputs/BoolNode.cjs.js +0 -1
  201. package/nodes/inputs/BoolNode.d.ts +0 -19
  202. package/nodes/inputs/BoolNode.js +0 -36
  203. package/nodes/inputs/ColorNode.cjs.js +0 -1
  204. package/nodes/inputs/ColorNode.d.ts +0 -21
  205. package/nodes/inputs/ColorNode.js +0 -41
  206. package/nodes/inputs/CubeTextureNode.cjs.js +0 -1
  207. package/nodes/inputs/CubeTextureNode.d.ts +0 -17
  208. package/nodes/inputs/CubeTextureNode.js +0 -79
  209. package/nodes/inputs/FloatNode.cjs.js +0 -1
  210. package/nodes/inputs/FloatNode.d.ts +0 -19
  211. package/nodes/inputs/FloatNode.js +0 -36
  212. package/nodes/inputs/IntNode.cjs.js +0 -1
  213. package/nodes/inputs/IntNode.d.ts +0 -19
  214. package/nodes/inputs/IntNode.js +0 -36
  215. package/nodes/inputs/Matrix3Node.cjs.js +0 -1
  216. package/nodes/inputs/Matrix3Node.d.ts +0 -22
  217. package/nodes/inputs/Matrix3Node.js +0 -46
  218. package/nodes/inputs/Matrix4Node.cjs.js +0 -1
  219. package/nodes/inputs/Matrix4Node.d.ts +0 -22
  220. package/nodes/inputs/Matrix4Node.js +0 -46
  221. package/nodes/inputs/PropertyNode.cjs.js +0 -1
  222. package/nodes/inputs/PropertyNode.d.ts +0 -10
  223. package/nodes/inputs/PropertyNode.js +0 -35
  224. package/nodes/inputs/RTTNode.cjs.js +0 -1
  225. package/nodes/inputs/RTTNode.d.ts +0 -27
  226. package/nodes/inputs/RTTNode.js +0 -103
  227. package/nodes/inputs/ReflectorNode.cjs.js +0 -1
  228. package/nodes/inputs/ReflectorNode.d.ts +0 -21
  229. package/nodes/inputs/ReflectorNode.js +0 -60
  230. package/nodes/inputs/ScreenNode.cjs.js +0 -1
  231. package/nodes/inputs/ScreenNode.d.ts +0 -11
  232. package/nodes/inputs/ScreenNode.js +0 -20
  233. package/nodes/inputs/TextureNode.cjs.js +0 -1
  234. package/nodes/inputs/TextureNode.d.ts +0 -20
  235. package/nodes/inputs/TextureNode.js +0 -83
  236. package/nodes/inputs/Vector2Node.cjs.js +0 -1
  237. package/nodes/inputs/Vector2Node.d.ts +0 -21
  238. package/nodes/inputs/Vector2Node.js +0 -40
  239. package/nodes/inputs/Vector3Node.cjs.js +0 -1
  240. package/nodes/inputs/Vector3Node.d.ts +0 -21
  241. package/nodes/inputs/Vector3Node.js +0 -41
  242. package/nodes/inputs/Vector4Node.cjs.js +0 -1
  243. package/nodes/inputs/Vector4Node.d.ts +0 -21
  244. package/nodes/inputs/Vector4Node.js +0 -42
  245. package/nodes/materials/BasicNodeMaterial.cjs.js +0 -1
  246. package/nodes/materials/BasicNodeMaterial.d.ts +0 -11
  247. package/nodes/materials/BasicNodeMaterial.js +0 -15
  248. package/nodes/materials/PhongNodeMaterial.cjs.js +0 -1
  249. package/nodes/materials/PhongNodeMaterial.d.ts +0 -21
  250. package/nodes/materials/PhongNodeMaterial.js +0 -15
  251. package/nodes/materials/SpriteNodeMaterial.cjs.js +0 -1
  252. package/nodes/materials/SpriteNodeMaterial.d.ts +0 -12
  253. package/nodes/materials/SpriteNodeMaterial.js +0 -15
  254. package/nodes/materials/StandardNodeMaterial.cjs.js +0 -1
  255. package/nodes/materials/StandardNodeMaterial.d.ts +0 -25
  256. package/nodes/materials/StandardNodeMaterial.js +0 -15
  257. package/nodes/materials/nodes/BasicNode.cjs.js +0 -1
  258. package/nodes/materials/nodes/BasicNode.d.ts +0 -15
  259. package/nodes/materials/nodes/BasicNode.js +0 -91
  260. package/nodes/materials/nodes/MeshStandardNode.cjs.js +0 -1
  261. package/nodes/materials/nodes/MeshStandardNode.d.ts +0 -25
  262. package/nodes/materials/nodes/MeshStandardNode.js +0 -81
  263. package/nodes/materials/nodes/PhongNode.cjs.js +0 -1
  264. package/nodes/materials/nodes/PhongNode.d.ts +0 -14
  265. package/nodes/materials/nodes/PhongNode.js +0 -212
  266. package/nodes/materials/nodes/RawNode.cjs.js +0 -1
  267. package/nodes/materials/nodes/RawNode.d.ts +0 -10
  268. package/nodes/materials/nodes/RawNode.js +0 -42
  269. package/nodes/materials/nodes/SpriteNode.cjs.js +0 -1
  270. package/nodes/materials/nodes/SpriteNode.d.ts +0 -13
  271. package/nodes/materials/nodes/SpriteNode.js +0 -113
  272. package/nodes/materials/nodes/StandardNode.cjs.js +0 -1
  273. package/nodes/materials/nodes/StandardNode.d.ts +0 -15
  274. package/nodes/materials/nodes/StandardNode.js +0 -336
  275. package/nodes/misc/BumpMapNode.cjs.js +0 -1
  276. package/nodes/misc/BumpMapNode.d.ts +0 -21
  277. package/nodes/misc/BumpMapNode.js +0 -80
  278. package/nodes/misc/NormalMapNode.cjs.js +0 -1
  279. package/nodes/misc/NormalMapNode.d.ts +0 -19
  280. package/nodes/misc/NormalMapNode.js +0 -102
  281. package/nodes/misc/TextureCubeNode.cjs.js +0 -1
  282. package/nodes/misc/TextureCubeNode.d.ts +0 -21
  283. package/nodes/misc/TextureCubeNode.js +0 -52
  284. package/nodes/misc/TextureCubeUVNode.cjs.js +0 -1
  285. package/nodes/misc/TextureCubeUVNode.d.ts +0 -18
  286. package/nodes/misc/TextureCubeUVNode.js +0 -229
  287. package/nodes/postprocessing/NodePass.cjs.js +0 -1
  288. package/nodes/postprocessing/NodePass.d.ts +0 -15
  289. package/nodes/postprocessing/NodePass.js +0 -61
  290. package/nodes/postprocessing/NodePostProcessing.cjs.js +0 -1
  291. package/nodes/postprocessing/NodePostProcessing.d.ts +0 -26
  292. package/nodes/postprocessing/NodePostProcessing.js +0 -91
  293. package/nodes/procedural/NoiseNode.cjs.js +0 -1
  294. package/nodes/procedural/NoiseNode.d.ts +0 -17
  295. package/nodes/procedural/NoiseNode.js +0 -43
  296. package/nodes/utils/BypassNode.cjs.js +0 -1
  297. package/nodes/utils/BypassNode.d.ts +0 -11
  298. package/nodes/utils/BypassNode.js +0 -55
  299. package/nodes/utils/ColorSpaceNode.cjs.js +0 -1
  300. package/nodes/utils/ColorSpaceNode.d.ts +0 -55
  301. package/nodes/utils/ColorSpaceNode.js +0 -106
  302. package/nodes/utils/MaxMIPLevelNode.cjs.js +0 -1
  303. package/nodes/utils/MaxMIPLevelNode.d.ts +0 -11
  304. package/nodes/utils/MaxMIPLevelNode.js +0 -38
  305. package/nodes/utils/SpecularMIPLevelNode.cjs.js +0 -1
  306. package/nodes/utils/SpecularMIPLevelNode.d.ts +0 -17
  307. package/nodes/utils/SpecularMIPLevelNode.js +0 -61
  308. package/nodes/utils/SubSlotNode.cjs.js +0 -1
  309. package/nodes/utils/SubSlotNode.js +0 -53
  310. package/nodes/utils/SwitchNode.cjs.js +0 -1
  311. package/nodes/utils/SwitchNode.d.ts +0 -11
  312. package/nodes/utils/SwitchNode.js +0 -69
  313. package/nodes/utils/UVTransformNode.cjs.js +0 -1
  314. package/nodes/utils/UVTransformNode.d.ts +0 -15
  315. package/nodes/utils/UVTransformNode.js +0 -46
  316. package/nodes/utils/VelocityNode.cjs.js +0 -1
  317. package/nodes/utils/VelocityNode.d.ts +0 -28
  318. package/nodes/utils/VelocityNode.js +0 -115
@@ -0,0 +1 @@
1
+ "use strict";module.exports=class{constructor(e,t,s=""){this.name=e,this.type=t,this.code=s,Object.defineProperty(this,"isNodeCode",{value:!0})}};
@@ -0,0 +1,13 @@
1
+ class NodeCode {
2
+ constructor(name, type, code = '') {
3
+ this.name = name;
4
+ this.type = type;
5
+ this.code = code;
6
+ Object.defineProperty(this, 'isNodeCode', {
7
+ value: true
8
+ });
9
+ }
10
+
11
+ }
12
+
13
+ export default NodeCode;
@@ -1 +1 @@
1
- "use strict";function e(e){this.time=void 0!==e?e:0,this.id=0}Object.defineProperty(exports,"__esModule",{value:!0}),e.prototype={constructor:e,update:function(e){return++this.id,this.time+=e,this.delta=e,this},setRenderer:function(e){return this.renderer=e,this},setRenderTexture:function(e){return this.renderTexture=e,this},updateNode:function(e){return e.frameId===this.id||(e.updateFrame(this),e.frameId=this.id),this}},exports.NodeFrame=e;
1
+ "use strict";var e=require("./constants.cjs.js");module.exports=class{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.startTime=null,this.updateMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null}updateNode(t){t.updateType===e.NodeUpdateType.Frame?this.updateMap.get(t)!==this.frameId&&(this.updateMap.set(t,this.frameId),t.update(this)):t.updateType===e.NodeUpdateType.Object&&t.update(this)}update(){this.frameId++,void 0===this.lastTime&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}};
@@ -1,30 +1,37 @@
1
- function NodeFrame(time) {
2
- this.time = time !== undefined ? time : 0;
3
- this.id = 0;
4
- }
1
+ import { NodeUpdateType } from './constants.js';
2
+
3
+ class NodeFrame {
4
+ constructor() {
5
+ this.time = 0;
6
+ this.deltaTime = 0;
7
+ this.frameId = 0;
8
+ this.startTime = null;
9
+ this.updateMap = new WeakMap();
10
+ this.renderer = null;
11
+ this.material = null;
12
+ this.camera = null;
13
+ this.object = null;
14
+ }
5
15
 
6
- NodeFrame.prototype = {
7
- constructor: NodeFrame,
8
- update: function (delta) {
9
- ++this.id;
10
- this.time += delta;
11
- this.delta = delta;
12
- return this;
13
- },
14
- setRenderer: function (renderer) {
15
- this.renderer = renderer;
16
- return this;
17
- },
18
- setRenderTexture: function (renderTexture) {
19
- this.renderTexture = renderTexture;
20
- return this;
21
- },
22
- updateNode: function (node) {
23
- if (node.frameId === this.id) return this;
24
- node.updateFrame(this);
25
- node.frameId = this.id;
26
- return this;
16
+ updateNode(node) {
17
+ if (node.updateType === NodeUpdateType.Frame) {
18
+ if (this.updateMap.get(node) !== this.frameId) {
19
+ this.updateMap.set(node, this.frameId);
20
+ node.update(this);
21
+ }
22
+ } else if (node.updateType === NodeUpdateType.Object) {
23
+ node.update(this);
24
+ }
27
25
  }
28
- };
29
26
 
30
- export { NodeFrame };
27
+ update() {
28
+ this.frameId++;
29
+ if (this.lastTime === undefined) this.lastTime = performance.now();
30
+ this.deltaTime = (performance.now() - this.lastTime) / 1000;
31
+ this.lastTime = performance.now();
32
+ this.time += this.deltaTime;
33
+ }
34
+
35
+ }
36
+
37
+ export default NodeFrame;
@@ -0,0 +1 @@
1
+ "use strict";class t{constructor(t,s,i="",o=""){this.type=t,this.inputs=s,this.name=i,this.presicion=o}getCode(){console.warn("Abstract function.")}}t.isNodeFunction=!0,module.exports=t;
@@ -0,0 +1,17 @@
1
+ class NodeFunction {
2
+ constructor(type, inputs, name = '', presicion = '') {
3
+ this.type = type;
4
+ this.inputs = inputs;
5
+ this.name = name;
6
+ this.presicion = presicion;
7
+ }
8
+
9
+ getCode() {
10
+ console.warn('Abstract function.');
11
+ }
12
+
13
+ }
14
+
15
+ NodeFunction.isNodeFunction = true;
16
+
17
+ export default NodeFunction;
@@ -0,0 +1 @@
1
+ "use strict";class t{constructor(t,s,i=null,n="",o=!1){this.type=t,this.name=s,this.count=i,this.qualifier=n,this.isConst=o}}t.isNodeFunctionInput=!0,module.exports=t;
@@ -0,0 +1,14 @@
1
+ class NodeFunctionInput {
2
+ constructor(type, name, count = null, qualifier = '', isConst = false) {
3
+ this.type = type;
4
+ this.name = name;
5
+ this.count = count;
6
+ this.qualifier = qualifier;
7
+ this.isConst = isConst;
8
+ }
9
+
10
+ }
11
+
12
+ NodeFunctionInput.isNodeFunctionInput = true;
13
+
14
+ export default NodeFunctionInput;
@@ -0,0 +1 @@
1
+ "use strict";module.exports=class{constructor(){this.keywords=[],this.nodes=[],this.keywordsCallback={}}getNode(s){let o=this.nodes[s];return void 0===o&&void 0!==this.keywordsCallback[s]&&(o=this.keywordsCallback[s](s),this.nodes[s]=o),o}addKeyword(s,o){return this.keywords.push(s),this.keywordsCallback[s]=o,this}parse(s){const o=this.keywords,t=new RegExp(`\\b${o.join("\\b|\\b")}\\b`,"g"),e=s.match(t),d=[];if(null!==e)for(const s of e){const o=this.getNode(s);void 0!==o&&-1===d.indexOf(o)&&d.push(o)}return d}include(s,o){const t=this.parse(o);for(const o of t)o.build(s)}};
@@ -0,0 +1,54 @@
1
+ class NodeKeywords {
2
+ constructor() {
3
+ this.keywords = [];
4
+ this.nodes = [];
5
+ this.keywordsCallback = {};
6
+ }
7
+
8
+ getNode(name) {
9
+ let node = this.nodes[name];
10
+
11
+ if (node === undefined && this.keywordsCallback[name] !== undefined) {
12
+ node = this.keywordsCallback[name](name);
13
+ this.nodes[name] = node;
14
+ }
15
+
16
+ return node;
17
+ }
18
+
19
+ addKeyword(name, callback) {
20
+ this.keywords.push(name);
21
+ this.keywordsCallback[name] = callback;
22
+ return this;
23
+ }
24
+
25
+ parse(code) {
26
+ const keywordNames = this.keywords;
27
+ const regExp = new RegExp(`\\b${keywordNames.join('\\b|\\b')}\\b`, 'g');
28
+ const codeKeywords = code.match(regExp);
29
+ const keywordNodes = [];
30
+
31
+ if (codeKeywords !== null) {
32
+ for (const keyword of codeKeywords) {
33
+ const node = this.getNode(keyword);
34
+
35
+ if (node !== undefined && keywordNodes.indexOf(node) === -1) {
36
+ keywordNodes.push(node);
37
+ }
38
+ }
39
+ }
40
+
41
+ return keywordNodes;
42
+ }
43
+
44
+ include(builder, code) {
45
+ const keywordNodes = this.parse(code);
46
+
47
+ for (const keywordNode of keywordNodes) {
48
+ keywordNode.build(builder);
49
+ }
50
+ }
51
+
52
+ }
53
+
54
+ export default NodeKeywords;
@@ -0,0 +1 @@
1
+ "use strict";module.exports=class{parseFunction(){console.warn("Abstract function.")}};
@@ -0,0 +1,8 @@
1
+ class NodeParser {
2
+ parseFunction() {
3
+ console.warn('Abstract function.');
4
+ }
5
+
6
+ }
7
+
8
+ export default NodeParser;
@@ -1 +1 @@
1
- "use strict";function e(e){e=e||{},this.name=e.name,this.type=e.type,this.node=e.node,this.needsUpdate=e.needsUpdate}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperties(e.prototype,{value:{get:function(){return this.node.value},set:function(e){this.node.value=e}}}),exports.NodeUniform=e;
1
+ "use strict";class e{constructor(e,t,s,o){this.name=e,this.type=t,this.node=s,this.needsUpdate=o}get value(){return this.node.value}set value(e){this.node.value=e}}e.prototype.isNodeUniform=!0,module.exports=e;
@@ -1,20 +1,21 @@
1
- function NodeUniform(params) {
2
- params = params || {};
3
- this.name = params.name;
4
- this.type = params.type;
5
- this.node = params.node;
6
- this.needsUpdate = params.needsUpdate;
7
- }
1
+ class NodeUniform {
2
+ constructor(name, type, node, needsUpdate = undefined) {
3
+ this.name = name;
4
+ this.type = type;
5
+ this.node = node;
6
+ this.needsUpdate = needsUpdate;
7
+ }
8
+
9
+ get value() {
10
+ return this.node.value;
11
+ }
8
12
 
9
- Object.defineProperties(NodeUniform.prototype, {
10
- value: {
11
- get: function () {
12
- return this.node.value;
13
- },
14
- set: function (val) {
15
- this.node.value = val;
16
- }
13
+ set value(val) {
14
+ this.node.value = val;
17
15
  }
18
- });
19
16
 
20
- export { NodeUniform };
17
+ }
18
+
19
+ NodeUniform.prototype.isNodeUniform = true;
20
+
21
+ export default NodeUniform;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t={elements:["x","y","z","w"],addShortcuts:function(){function t(t,e,n){return n?{get:function(){return this[t][e][n]},set:function(r){this[t][e][n]=r}}:{get:function(){return this[t][e]},set:function(n){this[t][e]=n}}}return function(e,n,r){var i={};for(let e=0;e<r.length;++e){var s=r[e].split("."),o=s[0],u=s[1];i[o]=t(n,o,u)}Object.defineProperties(e,i)}}()};exports.NodeUtils=t;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");exports.getNodesKeys=e=>{const o=[];for(const t in e){const l=e[t];l&&!0===l.isNode&&o.push(t)}return o},exports.getValueFromType=(o,...t)=>{const l=null==o?void 0:o.slice(-4);return"color"===o?new e.Color(...t):"vec2"===l?new e.Vector2(...t):"vec3"===l?new e.Vector3(...t):"vec4"===l?new e.Vector4(...t):"mat3"===l?new e.Matrix3(...t):"mat4"===l?new e.Matrix4(...t):"bool"!==o&&("float"===o||"int"===o||"uint"===o?0:null)},exports.getValueType=e=>"number"==typeof e?"float":"boolean"==typeof e?"bool":!0===(null==e?void 0:e.isVector2)?"vec2":!0===(null==e?void 0:e.isVector3)?"vec3":!0===(null==e?void 0:e.isVector4)?"vec4":!0===(null==e?void 0:e.isMatrix3)?"mat3":!0===(null==e?void 0:e.isMatrix4)?"mat4":!0===(null==e?void 0:e.isColor)?"color":null;
@@ -1,41 +1,61 @@
1
- var NodeUtils = {
2
- elements: ['x', 'y', 'z', 'w'],
3
- addShortcuts: function () {
4
- function applyShortcut(proxy, property, subProperty) {
5
- if (subProperty) {
6
- return {
7
- get: function () {
8
- return this[proxy][property][subProperty];
9
- },
10
- set: function (val) {
11
- this[proxy][property][subProperty] = val;
12
- }
13
- };
14
- } else {
15
- return {
16
- get: function () {
17
- return this[proxy][property];
18
- },
19
- set: function (val) {
20
- this[proxy][property] = val;
21
- }
22
- };
23
- }
1
+ import { Color, Vector2, Vector3, Vector4, Matrix3, Matrix4 } from 'three';
2
+
3
+ const getNodesKeys = object => {
4
+ const props = [];
5
+
6
+ for (const name in object) {
7
+ const value = object[name];
8
+
9
+ if (value && value.isNode === true) {
10
+ props.push(name);
24
11
  }
12
+ }
25
13
 
26
- return function addShortcuts(proto, proxy, list) {
27
- var shortcuts = {};
14
+ return props;
15
+ };
16
+ const getValueType = value => {
17
+ if (typeof value === 'number') {
18
+ return 'float';
19
+ } else if (typeof value === 'boolean') {
20
+ return 'bool';
21
+ } else if ((value === null || value === void 0 ? void 0 : value.isVector2) === true) {
22
+ return 'vec2';
23
+ } else if ((value === null || value === void 0 ? void 0 : value.isVector3) === true) {
24
+ return 'vec3';
25
+ } else if ((value === null || value === void 0 ? void 0 : value.isVector4) === true) {
26
+ return 'vec4';
27
+ } else if ((value === null || value === void 0 ? void 0 : value.isMatrix3) === true) {
28
+ return 'mat3';
29
+ } else if ((value === null || value === void 0 ? void 0 : value.isMatrix4) === true) {
30
+ return 'mat4';
31
+ } else if ((value === null || value === void 0 ? void 0 : value.isColor) === true) {
32
+ return 'color';
33
+ }
34
+
35
+ return null;
36
+ };
37
+ const getValueFromType = (type, ...params) => {
38
+ const last4 = type === null || type === void 0 ? void 0 : type.slice(-4);
28
39
 
29
- for (let i = 0; i < list.length; ++i) {
30
- var data = list[i].split('.'),
31
- property = data[0],
32
- subProperty = data[1];
33
- shortcuts[property] = applyShortcut(proxy, property, subProperty);
34
- }
40
+ if (type === 'color') {
41
+ return new Color(...params);
42
+ } else if (last4 === 'vec2') {
43
+ return new Vector2(...params);
44
+ } else if (last4 === 'vec3') {
45
+ return new Vector3(...params);
46
+ } else if (last4 === 'vec4') {
47
+ return new Vector4(...params);
48
+ } else if (last4 === 'mat3') {
49
+ return new Matrix3(...params);
50
+ } else if (last4 === 'mat4') {
51
+ return new Matrix4(...params);
52
+ } else if (type === 'bool') {
53
+ return false;
54
+ } else if (type === 'float' || type === 'int' || type === 'uint') {
55
+ return 0;
56
+ }
35
57
 
36
- Object.defineProperties(proto, shortcuts);
37
- };
38
- }()
58
+ return null;
39
59
  };
40
60
 
41
- export { NodeUtils };
61
+ export { getNodesKeys, getValueFromType, getValueType };
@@ -0,0 +1 @@
1
+ "use strict";class t{constructor(t,s){this.name=t,this.type=s}}t.prototype.isNodeVar=!0,module.exports=t;
@@ -0,0 +1,11 @@
1
+ class NodeVar {
2
+ constructor(name, type) {
3
+ this.name = name;
4
+ this.type = type;
5
+ }
6
+
7
+ }
8
+
9
+ NodeVar.prototype.isNodeVar = true;
10
+
11
+ export default NodeVar;
@@ -0,0 +1 @@
1
+ "use strict";class t{constructor(t,s){this.name=t,this.type=s}}t.prototype.isNodeVary=!0,module.exports=t;
@@ -0,0 +1,11 @@
1
+ class NodeVary {
2
+ constructor(name, type) {
3
+ this.name = name;
4
+ this.type = type;
5
+ }
6
+
7
+ }
8
+
9
+ NodeVary.prototype.isNodeVary = true;
10
+
11
+ export default NodeVary;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./Node.cjs.js");require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");module.exports=class extends e{constructor(e=null,s="vec4"){super(s),this.name=e}getHash(e){return this.name||super.getHash(e)}generate(e){const s=e.getVarFromNode(this,this.getNodeType(e)),r=this.name;return null!==r&&(s.name=r),e.getPropertyName(s)}};
@@ -0,0 +1,26 @@
1
+ import Node from './Node.js';
2
+
3
+ class PropertyNode extends Node {
4
+ constructor(name = null, nodeType = 'vec4') {
5
+ super(nodeType);
6
+ this.name = name;
7
+ }
8
+
9
+ getHash(builder) {
10
+ return this.name || super.getHash(builder);
11
+ }
12
+
13
+ generate(builder) {
14
+ const nodeVary = builder.getVarFromNode(this, this.getNodeType(builder));
15
+ const name = this.name;
16
+
17
+ if (name !== null) {
18
+ nodeVary.name = name;
19
+ }
20
+
21
+ return builder.getPropertyName(nodeVary);
22
+ }
23
+
24
+ }
25
+
26
+ export default PropertyNode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("three"),e=require("./Node.cjs.js");function r(t,r){e.Node.call(this,t),r=r||{},this.shared=void 0===r.shared||r.shared,this.unique=void 0!==r.unique&&r.unique}r.prototype=Object.create(e.Node.prototype),r.prototype.constructor=r,r.prototype.build=function(i,o,u,s){if(o=o||this.getType(i),this.getShared(i,o)){var n=this.getUnique(i,o);n&&void 0===this.constructor.uuid&&(this.constructor.uuid=t.MathUtils.generateUUID()),u=i.getUuid(u||this.getUuid(),!n);var a=i.getNodeData(u),p=a.output||this.getType(i);if(i.analyzing)return(a.deps||0)>0||this.getLabel()?(this.appendDepsNode(i,a,o),this.generate(i,o,u)):e.Node.prototype.build.call(this,i,o,u);if(n)return a.name=a.name||e.Node.prototype.build.call(this,i,o,u),a.name;if(!this.getLabel()&&(!this.getShared(i,p)||i.context.ignoreCache||1===a.deps))return e.Node.prototype.build.call(this,i,o,u);u=this.getUuid(!1);var h=this.getTemp(i,u);if(h)return i.format(h,p,o);h=r.prototype.generate.call(this,i,o,u,a.output,s);var d=this.generate(i,p,u);return i.addNodeCode(h+" = "+d+";"),i.format(h,p,o)}return e.Node.prototype.build.call(this,i,o,u)},r.prototype.getShared=function(t,e){return"sampler2D"!==e&&"samplerCube"!==e&&this.shared},r.prototype.getUnique=function(){return this.unique},r.prototype.setLabel=function(t){return this.label=t,this},r.prototype.getLabel=function(){return this.label},r.prototype.getUuid=function(t){var e=(t||null==t)&&this.constructor.uuid||this.uuid;return"string"==typeof this.scope&&(e=this.scope+"-"+e),e},r.prototype.getTemp=function(t,e){e=e||this.uuid;var r=t.getVars()[e];return r?r.name:void 0},r.prototype.generate=function(t,e,r,i,o){return this.getShared(t,e)||console.error("THREE.TempNode is not shared!"),r=r||this.uuid,t.getTempVar(r,i||this.getType(t),o,this.getLabel()).name},exports.TempNode=r;
1
+ "use strict";var e=require("./Node.cjs.js");require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");module.exports=class extends e{constructor(e){super(e)}build(e,t){const r=e.getVectorType(this.getNodeType(e,t)),s=e.getDataFromNode(this);if(!1!==e.context.temp&&"void "!==r&&"void"!==t&&s.dependenciesCount>1){if(void 0===s.snippet){const t=super.build(e,r),o=e.getVarFromNode(this,r),i=e.getPropertyName(o);e.addFlowCode(`${i} = ${t}`),s.snippet=t,s.propertyName=i}return e.format(s.propertyName,r,t)}return super.build(e,t)}};
@@ -1,97 +1,30 @@
1
- import { MathUtils } from 'three';
2
- import { Node } from './Node.js';
1
+ import Node from './Node.js';
3
2
 
4
- function TempNode(type, params) {
5
- Node.call(this, type);
6
- params = params || {};
7
- this.shared = params.shared !== undefined ? params.shared : true;
8
- this.unique = params.unique !== undefined ? params.unique : false;
9
- }
10
-
11
- TempNode.prototype = Object.create(Node.prototype);
12
- TempNode.prototype.constructor = TempNode;
13
-
14
- TempNode.prototype.build = function (builder, output, uuid, ns) {
15
- output = output || this.getType(builder);
16
-
17
- if (this.getShared(builder, output)) {
18
- var isUnique = this.getUnique(builder, output);
19
-
20
- if (isUnique && this.constructor.uuid === undefined) {
21
- this.constructor.uuid = MathUtils.generateUUID();
22
- }
23
-
24
- uuid = builder.getUuid(uuid || this.getUuid(), !isUnique);
25
- var data = builder.getNodeData(uuid),
26
- type = data.output || this.getType(builder);
3
+ class TempNode extends Node {
4
+ constructor(type) {
5
+ super(type);
6
+ }
27
7
 
28
- if (builder.analyzing) {
29
- if ((data.deps || 0) > 0 || this.getLabel()) {
30
- this.appendDepsNode(builder, data, output);
31
- return this.generate(builder, output, uuid);
8
+ build(builder, output) {
9
+ const type = builder.getVectorType(this.getNodeType(builder, output));
10
+ const nodeData = builder.getDataFromNode(this);
11
+
12
+ if (builder.context.temp !== false && type !== 'void ' && output !== 'void' && nodeData.dependenciesCount > 1) {
13
+ if (nodeData.snippet === undefined) {
14
+ const snippet = super.build(builder, type);
15
+ const nodeVar = builder.getVarFromNode(this, type);
16
+ const propertyName = builder.getPropertyName(nodeVar);
17
+ builder.addFlowCode(`${propertyName} = ${snippet}`);
18
+ nodeData.snippet = snippet;
19
+ nodeData.propertyName = propertyName;
32
20
  }
33
21
 
34
- return Node.prototype.build.call(this, builder, output, uuid);
35
- } else if (isUnique) {
36
- data.name = data.name || Node.prototype.build.call(this, builder, output, uuid);
37
- return data.name;
38
- } else if (!this.getLabel() && (!this.getShared(builder, type) || builder.context.ignoreCache || data.deps === 1)) {
39
- return Node.prototype.build.call(this, builder, output, uuid);
22
+ return builder.format(nodeData.propertyName, type, output);
40
23
  }
41
24
 
42
- uuid = this.getUuid(false);
43
- var name = this.getTemp(builder, uuid);
44
-
45
- if (name) {
46
- return builder.format(name, type, output);
47
- } else {
48
- name = TempNode.prototype.generate.call(this, builder, output, uuid, data.output, ns);
49
- var code = this.generate(builder, type, uuid);
50
- builder.addNodeCode(name + ' = ' + code + ';');
51
- return builder.format(name, type, output);
52
- }
25
+ return super.build(builder, output);
53
26
  }
54
27
 
55
- return Node.prototype.build.call(this, builder, output, uuid);
56
- };
57
-
58
- TempNode.prototype.getShared = function (builder, output) {
59
- return output !== 'sampler2D' && output !== 'samplerCube' && this.shared;
60
- };
61
-
62
- TempNode.prototype.getUnique = function
63
- /* builder, output */
64
- () {
65
- return this.unique;
66
- };
67
-
68
- TempNode.prototype.setLabel = function (name) {
69
- this.label = name;
70
- return this;
71
- };
72
-
73
- TempNode.prototype.getLabel = function
74
- /* builder */
75
- () {
76
- return this.label;
77
- };
78
-
79
- TempNode.prototype.getUuid = function (unique) {
80
- var uuid = unique || unique == undefined ? this.constructor.uuid || this.uuid : this.uuid;
81
- if (typeof this.scope === 'string') uuid = this.scope + '-' + uuid;
82
- return uuid;
83
- };
84
-
85
- TempNode.prototype.getTemp = function (builder, uuid) {
86
- uuid = uuid || this.uuid;
87
- var tempVar = builder.getVars()[uuid];
88
- return tempVar ? tempVar.name : undefined;
89
- };
90
-
91
- TempNode.prototype.generate = function (builder, output, uuid, type, ns) {
92
- if (!this.getShared(builder, output)) console.error('THREE.TempNode is not shared!');
93
- uuid = uuid || this.uuid;
94
- return builder.getTempVar(uuid, type || this.getType(builder), ns, this.getLabel()).name;
95
- };
28
+ }
96
29
 
97
- export { TempNode };
30
+ export default TempNode;
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./InputNode.cjs.js");require("./Node.cjs.js"),require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");class t extends e{getUniformHash(e){return this.getHash(e)}generate(e,t){const s=this.getNodeType(e),r=this.getUniformHash(e);let o=e.getNodeFromHash(r);void 0===o&&(e.setHashNode(this,r),o=this);const i=o.getInputType(e),n=e.getUniformFromNode(o,e.shaderStage,i),a=e.getPropertyName(n);return e.format(a,s,t)}}t.prototype.isUniformNode=!0,module.exports=t;
@@ -0,0 +1,28 @@
1
+ import InputNode from './InputNode.js';
2
+
3
+ class UniformNode extends InputNode {
4
+ getUniformHash(builder) {
5
+ return this.getHash(builder);
6
+ }
7
+
8
+ generate(builder, output) {
9
+ const type = this.getNodeType(builder);
10
+ const hash = this.getUniformHash(builder);
11
+ let sharedNode = builder.getNodeFromHash(hash);
12
+
13
+ if (sharedNode === undefined) {
14
+ builder.setHashNode(this, hash);
15
+ sharedNode = this;
16
+ }
17
+
18
+ const sharedNodeType = sharedNode.getInputType(builder);
19
+ const nodeUniform = builder.getUniformFromNode(sharedNode, builder.shaderStage, sharedNodeType);
20
+ const propertyName = builder.getPropertyName(nodeUniform);
21
+ return builder.format(propertyName, type, output);
22
+ }
23
+
24
+ }
25
+
26
+ UniformNode.prototype.isUniformNode = true;
27
+
28
+ export default UniformNode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./Node.cjs.js");function t(t,o){e.Node.call(this,t),this.value=o}require("three"),t.prototype=Object.create(e.Node.prototype),t.prototype.constructor=t,t.prototype.nodeType="Var",t.prototype.getType=function(e){return e.getTypeByFormat(this.type)},t.prototype.generate=function(e,t){var o=e.getVar(this.uuid,this.type);return this.value&&e.isShader("vertex")&&e.addNodeCode(o.name+" = "+this.value.build(e,this.getType(e))+";"),e.format(o.name,this.getType(e),t)},t.prototype.copy=function(t){return e.Node.prototype.copy.call(this,t),this.type=t.type,this.value=t.value,this},t.prototype.toJSON=function(e){var t=this.getJSONNode(e);return t||((t=this.createJSONNode(e)).type=this.type,this.value&&(t.value=this.value.toJSON(e).uuid)),t},exports.VarNode=t;
1
+ "use strict";var e=require("./Node.cjs.js");require("./constants.cjs.js"),require("./NodeUtils.cjs.js"),require("three");class t extends e{constructor(e,t=null,s=null){super(s),this.node=e,this.name=t}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return super.getNodeType(e)||this.node.getNodeType(e)}generate(e){const t=e.getVectorType(this.getNodeType(e)),s=this.node,r=this.name,o=s.build(e,t),n=e.getVarFromNode(this,t);null!==r&&(n.name=r);const d=e.getPropertyName(n);return e.addFlowCode(`${d} = ${o}`),d}}t.prototype.isVarNode=!0,module.exports=t;