Nodes.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. // core
  2. import ArrayUniformNode from './core/ArrayUniformNode.js';
  3. import AttributeNode from './core/AttributeNode.js';
  4. import BypassNode from './core/BypassNode.js';
  5. import CodeNode from './core/CodeNode.js';
  6. import ConstNode from './core/ConstNode.js';
  7. import ContextNode from './core/ContextNode.js';
  8. import ExpressionNode from './core/ExpressionNode.js';
  9. import FunctionCallNode from './core/FunctionCallNode.js';
  10. import FunctionNode from './core/FunctionNode.js';
  11. import InstanceIndexNode from './core/InstanceIndexNode.js';
  12. import Node from './core/Node.js';
  13. import NodeAttribute from './core/NodeAttribute.js';
  14. import NodeBuilder from './core/NodeBuilder.js';
  15. import NodeCode from './core/NodeCode.js';
  16. import NodeFrame from './core/NodeFrame.js';
  17. import NodeFunctionInput from './core/NodeFunctionInput.js';
  18. import NodeKeywords from './core/NodeKeywords.js';
  19. import NodeUniform from './core/NodeUniform.js';
  20. import NodeVar from './core/NodeVar.js';
  21. import NodeVarying from './core/NodeVarying.js';
  22. import PropertyNode from './core/PropertyNode.js';
  23. import TempNode from './core/TempNode.js';
  24. import UniformNode from './core/UniformNode.js';
  25. import VarNode from './core/VarNode.js';
  26. import VaryingNode from './core/VaryingNode.js';
  27. // accessors
  28. import BufferNode from './accessors/BufferNode.js';
  29. import CameraNode from './accessors/CameraNode.js';
  30. import CubeTextureNode from './accessors/CubeTextureNode.js';
  31. import InstanceNode from './accessors/InstanceNode.js';
  32. import MaterialNode from './accessors/MaterialNode.js';
  33. import MaterialReferenceNode from './accessors/MaterialReferenceNode.js';
  34. import ModelNode from './accessors/ModelNode.js';
  35. import ModelViewProjectionNode from './accessors/ModelViewProjectionNode.js';
  36. import NormalNode from './accessors/NormalNode.js';
  37. import Object3DNode from './accessors/Object3DNode.js';
  38. import PointUVNode from './accessors/PointUVNode.js';
  39. import PositionNode from './accessors/PositionNode.js';
  40. import ReferenceNode from './accessors/ReferenceNode.js';
  41. import ReflectVectorNode from './accessors/ReflectVectorNode.js';
  42. import SkinningNode from './accessors/SkinningNode.js';
  43. import TextureNode from './accessors/TextureNode.js';
  44. import UVNode from './accessors/UVNode.js';
  45. import UserDataNode from './accessors/UserDataNode.js';
  46. // geometry
  47. import RangeNode from './geometry/RangeNode.js';
  48. // gpgpu
  49. import ComputeNode from './gpgpu/ComputeNode.js';
  50. // display
  51. import ColorAdjustmentNode from './display/ColorAdjustmentNode.js';
  52. import ColorSpaceNode from './display/ColorSpaceNode.js';
  53. import FrontFacingNode from './display/FrontFacingNode.js';
  54. import NormalMapNode from './display/NormalMapNode.js';
  55. import ToneMappingNode from './display/ToneMappingNode.js';
  56. // math
  57. import MathNode from './math/MathNode.js';
  58. import OperatorNode from './math/OperatorNode.js';
  59. import CondNode from './math/CondNode.js';
  60. // lighting
  61. import PunctualLightNode from './lighting/PunctualLightNode.js';
  62. import LightsNode from './lighting/LightsNode.js';
  63. import LightingNode from './lighting/LightingNode.js';
  64. import LightingContextNode from './lighting/LightingContextNode.js';
  65. import HemisphereLightNode from './lighting/HemisphereLightNode.js';
  66. import EnvironmentNode from './lighting/EnvironmentNode.js';
  67. import AONode from './lighting/AONode.js';
  68. import AnalyticLightNode from './lighting/AnalyticLightNode.js';
  69. // utils
  70. import ArrayElementNode from './utils/ArrayElementNode.js';
  71. import ConvertNode from './utils/ConvertNode.js';
  72. import JoinNode from './utils/JoinNode.js';
  73. import MatcapUVNode from './utils/MatcapUVNode.js';
  74. import MaxMipLevelNode from './utils/MaxMipLevelNode.js';
  75. import OscNode from './utils/OscNode.js';
  76. import RotateUVNode from './utils/RotateUVNode.js';
  77. import SplitNode from './utils/SplitNode.js';
  78. import SpriteSheetUVNode from './utils/SpriteSheetUVNode.js';
  79. import TimerNode from './utils/TimerNode.js';
  80. // loaders
  81. import NodeLoader from './loaders/NodeLoader.js';
  82. import NodeObjectLoader from './loaders/NodeObjectLoader.js';
  83. import NodeMaterialLoader from './loaders/NodeMaterialLoader.js';
  84. // parsers
  85. import WGSLNodeParser from './parsers/WGSLNodeParser.js';
  86. import GLSLNodeParser from './parsers/GLSLNodeParser.js';
  87. // procedural
  88. import CheckerNode from './procedural/CheckerNode.js';
  89. // fog
  90. import FogNode from './fog/FogNode.js';
  91. import FogRangeNode from './fog/FogRangeNode.js';
  92. // core
  93. export * from './core/constants.js';
  94. // materials
  95. export * from './materials/Materials.js';
  96. // shader node
  97. export * from './shadernode/ShaderNodeElements.js';
  98. // shader stages
  99. export { defaultShaderStages } from './core/NodeBuilder.js';
  100. const nodeLib = {
  101. // core
  102. ArrayUniformNode,
  103. AttributeNode,
  104. BypassNode,
  105. CodeNode,
  106. ContextNode,
  107. ConstNode,
  108. ExpressionNode,
  109. FunctionCallNode,
  110. FunctionNode,
  111. InstanceIndexNode,
  112. Node,
  113. NodeAttribute,
  114. NodeBuilder,
  115. NodeCode,
  116. NodeFrame,
  117. NodeFunctionInput,
  118. NodeKeywords,
  119. NodeUniform,
  120. NodeVar,
  121. NodeVarying,
  122. PropertyNode,
  123. TempNode,
  124. UniformNode,
  125. VarNode,
  126. VaryingNode,
  127. // geometry
  128. RangeNode,
  129. // gpgpu
  130. ComputeNode,
  131. // accessors
  132. BufferNode,
  133. CameraNode,
  134. CubeTextureNode,
  135. InstanceNode,
  136. MaterialNode,
  137. MaterialReferenceNode,
  138. ModelNode,
  139. ModelViewProjectionNode,
  140. NormalNode,
  141. Object3DNode,
  142. PointUVNode,
  143. PositionNode,
  144. ReferenceNode,
  145. ReflectVectorNode,
  146. SkinningNode,
  147. TextureNode,
  148. UVNode,
  149. UserDataNode,
  150. // display
  151. ColorAdjustmentNode,
  152. ColorSpaceNode,
  153. FrontFacingNode,
  154. NormalMapNode,
  155. ToneMappingNode,
  156. // math
  157. MathNode,
  158. OperatorNode,
  159. CondNode,
  160. // lighting
  161. PunctualLightNode,
  162. LightsNode,
  163. LightingNode,
  164. LightingContextNode,
  165. HemisphereLightNode,
  166. EnvironmentNode,
  167. AONode,
  168. AnalyticLightNode,
  169. // utils
  170. ArrayElementNode,
  171. ConvertNode,
  172. JoinNode,
  173. MatcapUVNode,
  174. MaxMipLevelNode,
  175. OscNode,
  176. RotateUVNode,
  177. SplitNode,
  178. SpriteSheetUVNode,
  179. TimerNode,
  180. // procedural
  181. CheckerNode,
  182. // fog
  183. FogNode,
  184. FogRangeNode,
  185. // loaders
  186. NodeLoader,
  187. NodeObjectLoader,
  188. NodeMaterialLoader,
  189. // parsers
  190. WGSLNodeParser,
  191. GLSLNodeParser,
  192. };
  193. export const fromType = ( type ) => {
  194. return new nodeLib[ type ]();
  195. };
  196. export {
  197. // core
  198. ArrayUniformNode,
  199. AttributeNode,
  200. BypassNode,
  201. CodeNode,
  202. ContextNode,
  203. ConstNode,
  204. ExpressionNode,
  205. FunctionCallNode,
  206. FunctionNode,
  207. InstanceIndexNode,
  208. Node,
  209. NodeAttribute,
  210. NodeBuilder,
  211. NodeCode,
  212. NodeFrame,
  213. NodeFunctionInput,
  214. NodeKeywords,
  215. NodeUniform,
  216. NodeVar,
  217. NodeVarying,
  218. PropertyNode,
  219. TempNode,
  220. UniformNode,
  221. VarNode,
  222. VaryingNode,
  223. // geometry
  224. RangeNode,
  225. // gpgpu
  226. ComputeNode,
  227. // accessors
  228. BufferNode,
  229. CameraNode,
  230. CubeTextureNode,
  231. InstanceNode,
  232. MaterialNode,
  233. MaterialReferenceNode,
  234. ModelNode,
  235. ModelViewProjectionNode,
  236. NormalNode,
  237. Object3DNode,
  238. PointUVNode,
  239. PositionNode,
  240. ReferenceNode,
  241. ReflectVectorNode,
  242. SkinningNode,
  243. TextureNode,
  244. UVNode,
  245. UserDataNode,
  246. // display
  247. ColorAdjustmentNode,
  248. ColorSpaceNode,
  249. FrontFacingNode,
  250. NormalMapNode,
  251. ToneMappingNode,
  252. // math
  253. MathNode,
  254. OperatorNode,
  255. CondNode,
  256. // lighting
  257. PunctualLightNode,
  258. LightsNode,
  259. LightingNode,
  260. LightingContextNode,
  261. HemisphereLightNode,
  262. EnvironmentNode,
  263. AONode,
  264. AnalyticLightNode,
  265. // utils
  266. ArrayElementNode,
  267. ConvertNode,
  268. JoinNode,
  269. MatcapUVNode,
  270. MaxMipLevelNode,
  271. OscNode,
  272. RotateUVNode,
  273. SplitNode,
  274. SpriteSheetUVNode,
  275. TimerNode,
  276. // procedural
  277. CheckerNode,
  278. // fog
  279. FogNode,
  280. FogRangeNode,
  281. // loaders
  282. NodeLoader,
  283. NodeObjectLoader,
  284. NodeMaterialLoader,
  285. // parsers
  286. WGSLNodeParser,
  287. GLSLNodeParser,
  288. };