@babylonjs/core 7.2.3 → 7.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +2 -0
  2. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +2 -0
  3. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  4. package/Engines/abstractEngine.d.ts +7 -0
  5. package/Engines/abstractEngine.js +10 -2
  6. package/Engines/abstractEngine.js.map +1 -1
  7. package/Engines/thinEngine.d.ts +0 -7
  8. package/Engines/thinEngine.js +1 -9
  9. package/Engines/thinEngine.js.map +1 -1
  10. package/Engines/webgpuEngine.d.ts +4 -2
  11. package/Engines/webgpuEngine.js +5 -2
  12. package/Engines/webgpuEngine.js.map +1 -1
  13. package/Materials/Node/Blocks/Dual/clipPlanesBlock.d.ts +1 -1
  14. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +6 -6
  15. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
  16. package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +2 -3
  17. package/Materials/Node/Blocks/Dual/currentScreenBlock.js +5 -5
  18. package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
  19. package/Materials/Node/Blocks/Dual/fogBlock.d.ts +1 -1
  20. package/Materials/Node/Blocks/Dual/fogBlock.js +4 -4
  21. package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
  22. package/Materials/Node/Blocks/Dual/lightBlock.js +4 -4
  23. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  24. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +1 -1
  25. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +8 -7
  26. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  27. package/Materials/Node/Blocks/Dual/sceneDepthBlock.d.ts +1 -1
  28. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +9 -5
  29. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  30. package/Materials/Node/Blocks/Dual/textureBlock.d.ts +4 -2
  31. package/Materials/Node/Blocks/Dual/textureBlock.js +43 -21
  32. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  33. package/Materials/Node/Blocks/Fragment/TBNBlock.js +3 -3
  34. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  35. package/Materials/Node/Blocks/Fragment/derivativeBlock.js +9 -2
  36. package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
  37. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +1 -1
  38. package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
  39. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.d.ts +1 -1
  40. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +16 -8
  41. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  42. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js +1 -1
  43. package/Materials/Node/Blocks/Fragment/frontFacingBlock.js.map +1 -1
  44. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +2 -2
  45. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  46. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +3 -3
  47. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  48. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +1 -1
  49. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -4
  50. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  51. package/Materials/Node/Blocks/Fragment/screenSizeBlock.d.ts +1 -1
  52. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +2 -2
  53. package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
  54. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js +3 -3
  55. package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
  56. package/Materials/Node/Blocks/Fragment/shadowMapBlock.d.ts +1 -1
  57. package/Materials/Node/Blocks/Fragment/shadowMapBlock.js +4 -4
  58. package/Materials/Node/Blocks/Fragment/shadowMapBlock.js.map +1 -1
  59. package/Materials/Node/Blocks/Fragment/twirlBlock.js +9 -9
  60. package/Materials/Node/Blocks/Fragment/twirlBlock.js.map +1 -1
  61. package/Materials/Node/Blocks/Input/inputBlock.d.ts +6 -1
  62. package/Materials/Node/Blocks/Input/inputBlock.js +36 -12
  63. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  64. package/Materials/Node/Blocks/PBR/anisotropyBlock.d.ts +1 -1
  65. package/Materials/Node/Blocks/PBR/anisotropyBlock.js +1 -1
  66. package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
  67. package/Materials/Node/Blocks/PBR/clearCoatBlock.d.ts +1 -1
  68. package/Materials/Node/Blocks/PBR/clearCoatBlock.js +3 -3
  69. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  70. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +1 -1
  71. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +9 -9
  72. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  73. package/Materials/Node/Blocks/PBR/reflectionBlock.d.ts +1 -1
  74. package/Materials/Node/Blocks/PBR/reflectionBlock.js +21 -21
  75. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  76. package/Materials/Node/Blocks/PBR/refractionBlock.d.ts +1 -1
  77. package/Materials/Node/Blocks/PBR/refractionBlock.js +6 -6
  78. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  79. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +5 -0
  80. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  81. package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js +2 -2
  82. package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js.map +1 -1
  83. package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js +3 -3
  84. package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js.map +1 -1
  85. package/Materials/Node/Blocks/Particle/particleTextureBlock.js +1 -1
  86. package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
  87. package/Materials/Node/Blocks/Teleport/teleportOutBlock.js +1 -1
  88. package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
  89. package/Materials/Node/Blocks/Vertex/bonesBlock.js +2 -2
  90. package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
  91. package/Materials/Node/Blocks/Vertex/instancesBlock.js +5 -5
  92. package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
  93. package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +1 -1
  94. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +12 -12
  95. package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
  96. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +7 -7
  97. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  98. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.d.ts +1 -1
  99. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js +10 -3
  100. package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
  101. package/Materials/Node/Blocks/addBlock.js +2 -1
  102. package/Materials/Node/Blocks/addBlock.js.map +1 -1
  103. package/Materials/Node/Blocks/arcTan2Block.js +3 -1
  104. package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
  105. package/Materials/Node/Blocks/clampBlock.js +1 -1
  106. package/Materials/Node/Blocks/clampBlock.js.map +1 -1
  107. package/Materials/Node/Blocks/cloudBlock.js +1 -1
  108. package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
  109. package/Materials/Node/Blocks/colorMergerBlock.js +9 -7
  110. package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
  111. package/Materials/Node/Blocks/colorSplitterBlock.js +5 -5
  112. package/Materials/Node/Blocks/colorSplitterBlock.js.map +1 -1
  113. package/Materials/Node/Blocks/conditionalBlock.js +18 -12
  114. package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
  115. package/Materials/Node/Blocks/crossBlock.js +1 -1
  116. package/Materials/Node/Blocks/crossBlock.js.map +1 -1
  117. package/Materials/Node/Blocks/curveBlock.js +48 -53
  118. package/Materials/Node/Blocks/curveBlock.js.map +1 -1
  119. package/Materials/Node/Blocks/customBlock.js +1 -1
  120. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  121. package/Materials/Node/Blocks/desaturateBlock.js +5 -4
  122. package/Materials/Node/Blocks/desaturateBlock.js.map +1 -1
  123. package/Materials/Node/Blocks/distanceBlock.js +1 -1
  124. package/Materials/Node/Blocks/distanceBlock.js.map +1 -1
  125. package/Materials/Node/Blocks/divideBlock.js +2 -1
  126. package/Materials/Node/Blocks/divideBlock.js.map +1 -1
  127. package/Materials/Node/Blocks/dotBlock.js +1 -1
  128. package/Materials/Node/Blocks/dotBlock.js.map +1 -1
  129. package/Materials/Node/Blocks/elbowBlock.js +1 -1
  130. package/Materials/Node/Blocks/elbowBlock.js.map +1 -1
  131. package/Materials/Node/Blocks/fresnelBlock.js +1 -1
  132. package/Materials/Node/Blocks/fresnelBlock.js.map +1 -1
  133. package/Materials/Node/Blocks/gradientBlock.js +8 -7
  134. package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
  135. package/Materials/Node/Blocks/lengthBlock.js +1 -1
  136. package/Materials/Node/Blocks/lengthBlock.js.map +1 -1
  137. package/Materials/Node/Blocks/lerpBlock.js +1 -1
  138. package/Materials/Node/Blocks/lerpBlock.js.map +1 -1
  139. package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -1
  140. package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
  141. package/Materials/Node/Blocks/matrixDeterminantBlock.js +1 -1
  142. package/Materials/Node/Blocks/matrixDeterminantBlock.js.map +1 -1
  143. package/Materials/Node/Blocks/matrixTransposeBlock.js +1 -1
  144. package/Materials/Node/Blocks/matrixTransposeBlock.js.map +1 -1
  145. package/Materials/Node/Blocks/maxBlock.js +1 -1
  146. package/Materials/Node/Blocks/maxBlock.js.map +1 -1
  147. package/Materials/Node/Blocks/meshAttributeExistsBlock.js +1 -1
  148. package/Materials/Node/Blocks/meshAttributeExistsBlock.js.map +1 -1
  149. package/Materials/Node/Blocks/minBlock.js +1 -1
  150. package/Materials/Node/Blocks/minBlock.js.map +1 -1
  151. package/Materials/Node/Blocks/modBlock.js +1 -1
  152. package/Materials/Node/Blocks/modBlock.js.map +1 -1
  153. package/Materials/Node/Blocks/multiplyBlock.js +2 -1
  154. package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
  155. package/Materials/Node/Blocks/nLerpBlock.js +1 -1
  156. package/Materials/Node/Blocks/nLerpBlock.js.map +1 -1
  157. package/Materials/Node/Blocks/negateBlock.js +1 -1
  158. package/Materials/Node/Blocks/negateBlock.js.map +1 -1
  159. package/Materials/Node/Blocks/normalBlendBlock.js +1 -1
  160. package/Materials/Node/Blocks/normalBlendBlock.js.map +1 -1
  161. package/Materials/Node/Blocks/normalizeBlock.js +1 -1
  162. package/Materials/Node/Blocks/normalizeBlock.js.map +1 -1
  163. package/Materials/Node/Blocks/oneMinusBlock.js +1 -1
  164. package/Materials/Node/Blocks/oneMinusBlock.js.map +1 -1
  165. package/Materials/Node/Blocks/posterizeBlock.js +1 -1
  166. package/Materials/Node/Blocks/posterizeBlock.js.map +1 -1
  167. package/Materials/Node/Blocks/powBlock.js +1 -1
  168. package/Materials/Node/Blocks/powBlock.js.map +1 -1
  169. package/Materials/Node/Blocks/randomNumberBlock.js +1 -1
  170. package/Materials/Node/Blocks/randomNumberBlock.js.map +1 -1
  171. package/Materials/Node/Blocks/reciprocalBlock.js +2 -2
  172. package/Materials/Node/Blocks/reciprocalBlock.js.map +1 -1
  173. package/Materials/Node/Blocks/reflectBlock.js +1 -1
  174. package/Materials/Node/Blocks/reflectBlock.js.map +1 -1
  175. package/Materials/Node/Blocks/refractBlock.js +1 -1
  176. package/Materials/Node/Blocks/refractBlock.js.map +1 -1
  177. package/Materials/Node/Blocks/remapBlock.js +1 -1
  178. package/Materials/Node/Blocks/remapBlock.js.map +1 -1
  179. package/Materials/Node/Blocks/replaceColorBlock.js +1 -1
  180. package/Materials/Node/Blocks/replaceColorBlock.js.map +1 -1
  181. package/Materials/Node/Blocks/rotate2dBlock.js +1 -1
  182. package/Materials/Node/Blocks/rotate2dBlock.js.map +1 -1
  183. package/Materials/Node/Blocks/scaleBlock.js +1 -1
  184. package/Materials/Node/Blocks/scaleBlock.js.map +1 -1
  185. package/Materials/Node/Blocks/simplexPerlin3DBlock.js +1 -1
  186. package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
  187. package/Materials/Node/Blocks/smoothStepBlock.js +3 -2
  188. package/Materials/Node/Blocks/smoothStepBlock.js.map +1 -1
  189. package/Materials/Node/Blocks/stepBlock.js +1 -1
  190. package/Materials/Node/Blocks/stepBlock.js.map +1 -1
  191. package/Materials/Node/Blocks/subtractBlock.js +2 -1
  192. package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
  193. package/Materials/Node/Blocks/transformBlock.js +18 -10
  194. package/Materials/Node/Blocks/transformBlock.js.map +1 -1
  195. package/Materials/Node/Blocks/triPlanarBlock.d.ts +1 -1
  196. package/Materials/Node/Blocks/triPlanarBlock.js +2 -2
  197. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  198. package/Materials/Node/Blocks/trigonometryBlock.js +1 -1
  199. package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
  200. package/Materials/Node/Blocks/vectorMergerBlock.js +30 -27
  201. package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
  202. package/Materials/Node/Blocks/vectorSplitterBlock.js +9 -8
  203. package/Materials/Node/Blocks/vectorSplitterBlock.js.map +1 -1
  204. package/Materials/Node/Blocks/viewDirectionBlock.js +1 -1
  205. package/Materials/Node/Blocks/viewDirectionBlock.js.map +1 -1
  206. package/Materials/Node/Blocks/voronoiNoiseBlock.js +19 -8
  207. package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
  208. package/Materials/Node/Blocks/waveBlock.js +3 -3
  209. package/Materials/Node/Blocks/waveBlock.js.map +1 -1
  210. package/Materials/Node/Blocks/worleyNoise3DBlock.js +3 -3
  211. package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
  212. package/Materials/Node/nodeMaterial.d.ts +9 -3
  213. package/Materials/Node/nodeMaterial.js +29 -4
  214. package/Materials/Node/nodeMaterial.js.map +1 -1
  215. package/Materials/Node/nodeMaterialBlock.d.ts +0 -1
  216. package/Materials/Node/nodeMaterialBlock.js +6 -6
  217. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  218. package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +4 -0
  219. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +12 -0
  220. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  221. package/Materials/Node/nodeMaterialBuildState.d.ts +35 -3
  222. package/Materials/Node/nodeMaterialBuildState.js +169 -16
  223. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  224. package/Materials/PBR/pbrSubSurfaceConfiguration.d.ts +18 -4
  225. package/Materials/PBR/pbrSubSurfaceConfiguration.js +60 -9
  226. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  227. package/Materials/materialFlags.d.ts +6 -0
  228. package/Materials/materialFlags.js +15 -1
  229. package/Materials/materialFlags.js.map +1 -1
  230. package/Materials/materialHelper.d.ts +2 -2
  231. package/Materials/materialHelper.js.map +1 -1
  232. package/Meshes/Compression/meshoptCompression.js +4 -3
  233. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  234. package/Misc/filesInput.d.ts +2 -2
  235. package/Misc/filesInput.js.map +1 -1
  236. package/Misc/screenshotTools.d.ts +6 -6
  237. package/Misc/screenshotTools.js.map +1 -1
  238. package/PostProcesses/postProcess.d.ts +0 -1
  239. package/PostProcesses/postProcess.js.map +1 -1
  240. package/Shaders/ShadersInclude/pbrBlockSubSurface.js +19 -3
  241. package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  242. package/Shaders/ShadersInclude/pbrFragmentDeclaration.js +4 -1
  243. package/Shaders/ShadersInclude/pbrFragmentDeclaration.js.map +1 -1
  244. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
  245. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  246. package/Shaders/ShadersInclude/pbrVertexDeclaration.js +3 -0
  247. package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
  248. package/Shaders/pbr.fragment.js +7 -0
  249. package/Shaders/pbr.fragment.js.map +1 -1
  250. package/Shaders/pbr.vertex.js +2 -0
  251. package/Shaders/pbr.vertex.js.map +1 -1
  252. package/ShadersWGSL/ShadersInclude/fresnelFunction.d.ts +5 -0
  253. package/ShadersWGSL/ShadersInclude/fresnelFunction.js +13 -0
  254. package/ShadersWGSL/ShadersInclude/fresnelFunction.js.map +1 -0
  255. package/ShadersWGSL/ShadersInclude/helperFunctions.d.ts +5 -0
  256. package/ShadersWGSL/ShadersInclude/helperFunctions.js +68 -0
  257. package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -0
  258. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"meshAttributeExistsBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/meshAttributeExistsBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,q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es\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { InputBlock } from \"./Input/inputBlock\";\r\nimport { MorphTargetsBlock } from \"./Vertex/morphTargetsBlock\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nexport enum MeshAttributeExistsBlockTypes {\r\n None,\r\n Normal,\r\n Tangent,\r\n VertexColor,\r\n UV1,\r\n UV2,\r\n UV3,\r\n UV4,\r\n UV5,\r\n UV6,\r\n}\r\n\r\n/**\r\n * Block used to check if Mesh attribute of specified type exists\r\n * and provide an alternative fallback input for to use in such case\r\n */\r\nexport class MeshAttributeExistsBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new MeshAttributeExistsBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"fallback\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n // Try to auto determine attributeType\r\n this._inputs[0].onConnectionObservable.add((other) => {\r\n if (this.attributeType) {\r\n // But only if not already specified\r\n return;\r\n }\r\n const sourceBlock = other.ownerBlock;\r\n if (sourceBlock instanceof InputBlock && sourceBlock.isAttribute) {\r\n switch (sourceBlock.name) {\r\n case \"color\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.VertexColor;\r\n break;\r\n case \"normal\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.Normal;\r\n break;\r\n case \"tangent\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.Tangent;\r\n break;\r\n case \"uv\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV1;\r\n break;\r\n case \"uv2\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV2;\r\n break;\r\n case \"uv3\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV3;\r\n break;\r\n case \"uv4\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV4;\r\n break;\r\n case \"uv5\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV5;\r\n break;\r\n case \"uv6\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV6;\r\n break;\r\n }\r\n } else if (sourceBlock instanceof MorphTargetsBlock) {\r\n switch (this.input.connectedPoint?.name) {\r\n case \"normalOutput\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.Normal;\r\n break;\r\n case \"tangentOutput\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.Tangent;\r\n break;\r\n case \"uvOutput\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV1;\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MeshAttributeExistsBlock\";\r\n }\r\n\r\n /**\r\n * Defines which mesh attribute to use\r\n */\r\n @editableInPropertyPage(\"Attribute lookup\", PropertyTypeForEdition.List, undefined, {\r\n notifiers: { update: true },\r\n options: [\r\n { label: \"(None)\", value: MeshAttributeExistsBlockTypes.None },\r\n { label: \"Normal\", value: MeshAttributeExistsBlockTypes.Normal },\r\n { label: \"Tangent\", value: MeshAttributeExistsBlockTypes.Tangent },\r\n { label: \"Vertex Color\", value: MeshAttributeExistsBlockTypes.VertexColor },\r\n { label: \"UV1\", value: MeshAttributeExistsBlockTypes.UV1 },\r\n { label: \"UV2\", value: MeshAttributeExistsBlockTypes.UV2 },\r\n { label: \"UV3\", value: MeshAttributeExistsBlockTypes.UV3 },\r\n { label: \"UV4\", value: MeshAttributeExistsBlockTypes.UV4 },\r\n { label: \"UV5\", value: MeshAttributeExistsBlockTypes.UV5 },\r\n { label: \"UV6\", value: MeshAttributeExistsBlockTypes.UV6 },\r\n ],\r\n })\r\n public attributeType = MeshAttributeExistsBlockTypes.None;\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the fallback component when speciefied attribute doesn't exist\r\n */\r\n public get fallback(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let attributeDefine: null | string = null;\r\n switch (this.attributeType) {\r\n case MeshAttributeExistsBlockTypes.VertexColor:\r\n attributeDefine = \"VERTEXCOLOR_NME\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.Normal:\r\n attributeDefine = \"NORMAL\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.Tangent:\r\n attributeDefine = \"TANGENT\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV1:\r\n attributeDefine = \"UV1\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV2:\r\n attributeDefine = \"UV2\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV3:\r\n attributeDefine = \"UV3\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV4:\r\n attributeDefine = \"UV4\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV5:\r\n attributeDefine = \"UV5\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV6:\r\n attributeDefine = \"UV6\";\r\n break;\r\n }\r\n\r\n const output = this._declareOutput(this.output, state);\r\n if (attributeDefine) {\r\n state.compilationString += `#ifdef ${attributeDefine}\\n`;\r\n }\r\n\r\n state.compilationString += `${output} = ${this.input.associatedVariableName};\\n`;\r\n\r\n if (attributeDefine) {\r\n state.compilationString += `#else\\n`;\r\n state.compilationString += `${output} = ${this.fallback.associatedVariableName};\\n`;\r\n state.compilationString += `#endif\\n`;\r\n }\r\n return this;\r\n }\r\n\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.attributeType = this.attributeType;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any, scene: Scene, rootUrl: string) {\r\n super._deserialize(serializationObject, scene, rootUrl);\r\n\r\n this.attributeType = serializationObject.attributeType ?? MeshAttributeExistsBlockTypes.None;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode();\r\n\r\n codeString += `${this._codeVariableName}.attributeType = ${this.attributeType};\\n`;\r\n\r\n return codeString;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MeshAttributeExistsBlock\", MeshAttributeExistsBlock);\r\n"]}
1
+ {"version":3,"file":"meshAttributeExistsBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/meshAttributeExistsBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAGnG,MAAM,CAAN,IAAY,6BAWX;AAXD,WAAY,6BAA6B;IACrC,iFAAI,CAAA;IACJ,qFAAM,CAAA;IACN,uFAAO,CAAA;I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AE;YAChE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,6BAA6B,CAAC,OAAO,EAAE;YAClE,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,6BAA6B,CAAC,WAAW,EAAE;YAC3E,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,CAAC,GAAG,EAAE;YAC1D,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,CAAC,GAAG,EAAE;YAC1D,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,CAAC,GAAG,EAAE;YAC1D,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,CAAC,GAAG,EAAE;YAC1D,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,CAAC,GAAG,EAAE;YAC1D,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,6BAA6B,CAAC,GAAG,EAAE;SAC7D;KACJ,CAAC;+DACwD;AA+F9D,aAAa,CAAC,kCAAkC,EAAE,wBAAwB,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { InputBlock } from \"./Input/inputBlock\";\r\nimport { MorphTargetsBlock } from \"./Vertex/morphTargetsBlock\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../Decorators/nodeDecorator\";\r\nimport type { Scene } from \"core/scene\";\r\n\r\nexport enum MeshAttributeExistsBlockTypes {\r\n None,\r\n Normal,\r\n Tangent,\r\n VertexColor,\r\n UV1,\r\n UV2,\r\n UV3,\r\n UV4,\r\n UV5,\r\n UV6,\r\n}\r\n\r\n/**\r\n * Block used to check if Mesh attribute of specified type exists\r\n * and provide an alternative fallback input for to use in such case\r\n */\r\nexport class MeshAttributeExistsBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new MeshAttributeExistsBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"fallback\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n // Try to auto determine attributeType\r\n this._inputs[0].onConnectionObservable.add((other) => {\r\n if (this.attributeType) {\r\n // But only if not already specified\r\n return;\r\n }\r\n const sourceBlock = other.ownerBlock;\r\n if (sourceBlock instanceof InputBlock && sourceBlock.isAttribute) {\r\n switch (sourceBlock.name) {\r\n case \"color\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.VertexColor;\r\n break;\r\n case \"normal\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.Normal;\r\n break;\r\n case \"tangent\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.Tangent;\r\n break;\r\n case \"uv\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV1;\r\n break;\r\n case \"uv2\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV2;\r\n break;\r\n case \"uv3\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV3;\r\n break;\r\n case \"uv4\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV4;\r\n break;\r\n case \"uv5\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV5;\r\n break;\r\n case \"uv6\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV6;\r\n break;\r\n }\r\n } else if (sourceBlock instanceof MorphTargetsBlock) {\r\n switch (this.input.connectedPoint?.name) {\r\n case \"normalOutput\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.Normal;\r\n break;\r\n case \"tangentOutput\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.Tangent;\r\n break;\r\n case \"uvOutput\":\r\n this.attributeType = MeshAttributeExistsBlockTypes.UV1;\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MeshAttributeExistsBlock\";\r\n }\r\n\r\n /**\r\n * Defines which mesh attribute to use\r\n */\r\n @editableInPropertyPage(\"Attribute lookup\", PropertyTypeForEdition.List, undefined, {\r\n notifiers: { update: true },\r\n options: [\r\n { label: \"(None)\", value: MeshAttributeExistsBlockTypes.None },\r\n { label: \"Normal\", value: MeshAttributeExistsBlockTypes.Normal },\r\n { label: \"Tangent\", value: MeshAttributeExistsBlockTypes.Tangent },\r\n { label: \"Vertex Color\", value: MeshAttributeExistsBlockTypes.VertexColor },\r\n { label: \"UV1\", value: MeshAttributeExistsBlockTypes.UV1 },\r\n { label: \"UV2\", value: MeshAttributeExistsBlockTypes.UV2 },\r\n { label: \"UV3\", value: MeshAttributeExistsBlockTypes.UV3 },\r\n { label: \"UV4\", value: MeshAttributeExistsBlockTypes.UV4 },\r\n { label: \"UV5\", value: MeshAttributeExistsBlockTypes.UV5 },\r\n { label: \"UV6\", value: MeshAttributeExistsBlockTypes.UV6 },\r\n ],\r\n })\r\n public attributeType = MeshAttributeExistsBlockTypes.None;\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the fallback component when speciefied attribute doesn't exist\r\n */\r\n public get fallback(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let attributeDefine: null | string = null;\r\n switch (this.attributeType) {\r\n case MeshAttributeExistsBlockTypes.VertexColor:\r\n attributeDefine = \"VERTEXCOLOR_NME\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.Normal:\r\n attributeDefine = \"NORMAL\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.Tangent:\r\n attributeDefine = \"TANGENT\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV1:\r\n attributeDefine = \"UV1\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV2:\r\n attributeDefine = \"UV2\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV3:\r\n attributeDefine = \"UV3\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV4:\r\n attributeDefine = \"UV4\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV5:\r\n attributeDefine = \"UV5\";\r\n break;\r\n case MeshAttributeExistsBlockTypes.UV6:\r\n attributeDefine = \"UV6\";\r\n break;\r\n }\r\n\r\n const output = state._declareOutput(this.output);\r\n if (attributeDefine) {\r\n state.compilationString += `#ifdef ${attributeDefine}\\n`;\r\n }\r\n\r\n state.compilationString += `${output} = ${this.input.associatedVariableName};\\n`;\r\n\r\n if (attributeDefine) {\r\n state.compilationString += `#else\\n`;\r\n state.compilationString += `${output} = ${this.fallback.associatedVariableName};\\n`;\r\n state.compilationString += `#endif\\n`;\r\n }\r\n return this;\r\n }\r\n\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.attributeType = this.attributeType;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any, scene: Scene, rootUrl: string) {\r\n super._deserialize(serializationObject, scene, rootUrl);\r\n\r\n this.attributeType = serializationObject.attributeType ?? MeshAttributeExistsBlockTypes.None;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode();\r\n\r\n codeString += `${this._codeVariableName}.attributeType = ${this.attributeType};\\n`;\r\n\r\n return codeString;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MeshAttributeExistsBlock\", MeshAttributeExistsBlock);\r\n"]}
@@ -46,7 +46,7 @@ export class MinBlock extends NodeMaterialBlock {
46
46
  _buildBlock(state) {
47
47
  super._buildBlock(state);
48
48
  const output = this._outputs[0];
49
- state.compilationString += this._declareOutput(output, state) + ` = min(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`;
49
+ state.compilationString += state._declareOutput(output) + ` = min(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`;
50
50
  return this;
51
51
  }
52
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"minBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/minBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,iBAAiB;IAC3C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,UAAU,IAAI,CAAC,IAAI,CAAC,sBAAsB,KAAK,IAAI,CAAC,KAAK,CAAC,sBAAsB,MAAM,CAAC;QAEvJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the min of 2 values\r\n */\r\nexport class MinBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new MinBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MinBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = min(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MinBlock\", MinBlock);\r\n"]}
1
+ {"version":3,"file":"minBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/minBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAA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;AAED,aAAa,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the min of 2 values\r\n */\r\nexport class MinBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new MinBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MinBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += state._declareOutput(output) + ` = min(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MinBlock\", MinBlock);\r\n"]}
@@ -47,7 +47,7 @@ export class ModBlock extends NodeMaterialBlock {
47
47
  _buildBlock(state) {
48
48
  super._buildBlock(state);
49
49
  const output = this._outputs[0];
50
- state.compilationString += this._declareOutput(output, state) + ` = mod(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\n`;
50
+ state.compilationString += state._declareOutput(output) + ` = (${this.left.associatedVariableName} % ${this.right.associatedVariableName});\n`;
51
51
  return this;
52
52
  }
53
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"modBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/modBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,iBAAiB;IAC3C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEhC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,KAAK,CAAC,CAAC;IACnG,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,UAAU,IAAI,CAAC,IAAI,CAAC,sBAAsB,KAAK,IAAI,CAAC,KAAK,CAAC,sBAAsB,MAAM,CAAC;QAEvJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to compute value of one parameter modulo another\r\n */\r\nexport class ModBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new ModBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[1].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"ModBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = mod(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ModBlock\", ModBlock);\r\n"]}
1
+ {"version":3,"file":"modBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/modBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,C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BAAiB,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC,sBAAsB,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,MAAM,CAAC;QAE/I,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to compute value of one parameter modulo another\r\n */\r\nexport class ModBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new ModBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[1].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"ModBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += state._declareOutput(output) + ` = (${this.left.associatedVariableName} % ${this.right.associatedVariableName});\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ModBlock\", ModBlock);\r\n"]}
@@ -20,7 +20,8 @@ export class MultiplyBlock extends BaseMathBlock {
20
20
  }
21
21
  _buildBlock(state) {
22
22
  super._buildBlock(state);
23
- state.compilationString += this._declareOutput(this.output, state) + ` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};\n`;
23
+ const output = this._outputs[0];
24
+ state.compilationString += state._declareOutput(output) + ` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};\n`;
24
25
  return this;
25
26
  }
26
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"multiplyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/multiplyBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC5C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,eAAe,CAAC;IAC3B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,sBAAsB,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,CAAC;QAExJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { BaseMathBlock } from \"./baseMathBlock\";\r\n\r\n/**\r\n * Block used to multiply 2 values\r\n */\r\nexport class MultiplyBlock extends BaseMathBlock {\r\n /**\r\n * Creates a new MultiplyBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MultiplyBlock\";\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n state.compilationString += this._declareOutput(this.output, state) + ` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MultiplyBlock\", MultiplyBlock);\r\n"]}
1
+ {"version":3,"file":"multiplyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/multiplyBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC5C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,eAAe,CAAC;IAC3B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,sBAAsB,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,CAAC;QAE7I,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { BaseMathBlock } from \"./baseMathBlock\";\r\n\r\n/**\r\n * Block used to multiply 2 values\r\n */\r\nexport class MultiplyBlock extends BaseMathBlock {\r\n /**\r\n * Creates a new MultiplyBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MultiplyBlock\";\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += state._declareOutput(output) + ` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MultiplyBlock\", MultiplyBlock);\r\n"]}
@@ -56,7 +56,7 @@ export class NLerpBlock extends NodeMaterialBlock {
56
56
  super._buildBlock(state);
57
57
  const output = this._outputs[0];
58
58
  state.compilationString +=
59
- this._declareOutput(output, state) +
59
+ state._declareOutput(output) +
60
60
  ` = normalize(mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName}));\n`;
61
61
  return this;
62
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nLerpBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/nLerpBlock.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,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB;YACnB,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC;gBAClC,oBAAoB,IAAI,CAAC,IAAI,CAAC,sBAAsB,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,IAAI,CAAC,QAAQ,CAAC,sBAAsB,OAAO,CAAC;QAEhJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to normalize lerp between 2 values\r\n */\r\nexport class NLerpBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new NLerpBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"gradient\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n this._linkConnectionTypes(1, 2, true);\r\n\r\n this._inputs[2].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"NLerpBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the gradient operand input component\r\n */\r\n public get gradient(): NodeMaterialConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString +=\r\n this._declareOutput(output, state) +\r\n ` = normalize(mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName}));\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NLerpBlock\", NLerpBlock);\r\n"]}
1
+ {"version":3,"file":"nLerpBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/nLerpBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,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,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB;YACnB,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC;gBAC5B,oBAAoB,IAAI,CAAC,IAAI,CAAC,sBAAsB,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,IAAI,CAAC,QAAQ,CAAC,sBAAsB,OAAO,CAAC;QAEhJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to normalize lerp between 2 values\r\n */\r\nexport class NLerpBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new NLerpBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"gradient\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n this._linkConnectionTypes(1, 2, true);\r\n\r\n this._inputs[2].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"NLerpBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the gradient operand input component\r\n */\r\n public get gradient(): NodeMaterialConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString +=\r\n state._declareOutput(output) +\r\n ` = normalize(mix(${this.left.associatedVariableName} , ${this.right.associatedVariableName}, ${this.gradient.associatedVariableName}));\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NLerpBlock\", NLerpBlock);\r\n"]}
@@ -38,7 +38,7 @@ export class NegateBlock extends NodeMaterialBlock {
38
38
  _buildBlock(state) {
39
39
  super._buildBlock(state);
40
40
  const output = this._outputs[0];
41
- state.compilationString += this._declareOutput(output, state) + ` = -1.0 * ${this.value.associatedVariableName};\n`;
41
+ state.compilationString += state._declareOutput(output) + ` = -1.0 * ${this.value.associatedVariableName};\n`;
42
42
  return this;
43
43
  }
44
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"negateBlock.js","sourceRoot":"","sources":["../../../../../../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CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get negative version of a value (i.e. x * -1)\r\n */\r\nexport class NegateBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new NegateBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"value\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"NegateBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = -1.0 * ${this.value.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NegateBlock\", NegateBlock);\r\n"]}
1
+ {"version":3,"file":"negateBlock.js","sourceRoot":"","sources":["../../../../../../dev/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C;CACJ;AAED,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get negative version of a value (i.e. x * -1)\r\n */\r\nexport class NegateBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new NegateBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"value\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"NegateBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += state._declareOutput(output) + ` = -1.0 * ${this.value.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NegateBlock\", NegateBlock);\r\n"]}
@@ -58,7 +58,7 @@ export class NormalBlendBlock extends NodeMaterialBlock {
58
58
  const stepG = state._getFreeVariableName("stepG");
59
59
  state.compilationString += `float ${stepR} = step(0.5, ${input0.associatedVariableName}.r);\n`;
60
60
  state.compilationString += `float ${stepG} = step(0.5, ${input0.associatedVariableName}.g);\n`;
61
- state.compilationString += this._declareOutput(output, state) + `;\n`;
61
+ state.compilationString += state._declareOutput(output) + `;\n`;
62
62
  state.compilationString += `${output.associatedVariableName}.r = (1.0 - ${stepR}) * ${input0.associatedVariableName}.r * ${input1.associatedVariableName}.r * 2.0 + ${stepR} * (1.0 - (1.0 - ${input0.associatedVariableName}.r) * (1.0 - ${input1.associatedVariableName}.r) * 2.0);\n`;
63
63
  state.compilationString += `${output.associatedVariableName}.g = (1.0 - ${stepG}) * ${input0.associatedVariableName}.g * ${input1.associatedVariableName}.g * 2.0 + ${stepG} * (1.0 - (1.0 - ${input0.associatedVariableName}.g) * (1.0 - ${input1.associatedVariableName}.g) * 2.0);\n`;
64
64
  state.compilationString += `${output.associatedVariableName}.b = ${input0.associatedVariableName}.b * ${input1.associatedVariableName}.b;\n`;
@@ -1 +1 @@
1
- {"version":3,"file":"normalBlendBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/normalBlendBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IACnD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QACnF,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,qCAA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C;QAElD,KAAK,CAAC,iBAAiB,IAAI,SAAS,KAAK,gBAAgB,MAAM,CAAC,sBAAsB,QAAQ,CAAC;QAC/F,KAAK,CAAC,iBAAiB,IAAI,SAAS,KAAK,gBAAgB,MAAM,CAAC,sBAAsB,QAAQ,CAAC;QAC/F,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC;QACtE,KAAK,CAAC,iBAAiB,IAAI,GAAG,MAAM,CAAC,sBAAsB,eAAe,KAAK,OAAO,MAAM,CAAC,sBAAsB,QAAQ,MAAM,CAAC,sBAAsB,cAAc,KAAK,oBAAoB,MAAM,CAAC,sBAAsB,gBAAgB,MAAM,CAAC,sBAAsB,eAAe,CAAC;QACzR,KAAK,CAAC,iBAAiB,IAAI,GAAG,MAAM,CAAC,sBAAsB,eAAe,KAAK,OAAO,MAAM,CAAC,sBAAsB,QAAQ,MAAM,CAAC,sBAAsB,cAAc,KAAK,oBAAoB,MAAM,CAAC,sBAAsB,gBAAgB,MAAM,CAAC,sBAAsB,eAAe,CAAC;QACzR,KAAK,CAAC,iBAAiB,IAAI,GAAG,MAAM,CAAC,sBAAsB,QAAQ,MAAM,CAAC,sBAAsB,QAAQ,MAAM,CAAC,sBAAsB,OAAO,CAAC;QAE7I,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to blend normals\r\n */\r\nexport class NormalBlendBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new NormalBlendBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"normalMap0\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"normalMap1\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Vector3);\r\n\r\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4 |\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4\r\n );\r\n\r\n this._inputs[1].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4 |\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4\r\n );\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"NormalBlendBlock\";\r\n }\r\n\r\n /**\r\n * Gets the first input component\r\n */\r\n public get normalMap0(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the second input component\r\n */\r\n public get normalMap1(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n const input0 = this._inputs[0];\r\n const input1 = this._inputs[1];\r\n const stepR = state._getFreeVariableName(\"stepR\");\r\n const stepG = state._getFreeVariableName(\"stepG\");\r\n\r\n state.compilationString += `float ${stepR} = step(0.5, ${input0.associatedVariableName}.r);\\n`;\r\n state.compilationString += `float ${stepG} = step(0.5, ${input0.associatedVariableName}.g);\\n`;\r\n state.compilationString += this._declareOutput(output, state) + `;\\n`;\r\n state.compilationString += `${output.associatedVariableName}.r = (1.0 - ${stepR}) * ${input0.associatedVariableName}.r * ${input1.associatedVariableName}.r * 2.0 + ${stepR} * (1.0 - (1.0 - ${input0.associatedVariableName}.r) * (1.0 - ${input1.associatedVariableName}.r) * 2.0);\\n`;\r\n state.compilationString += `${output.associatedVariableName}.g = (1.0 - ${stepG}) * ${input0.associatedVariableName}.g * ${input1.associatedVariableName}.g * 2.0 + ${stepG} * (1.0 - (1.0 - ${input0.associatedVariableName}.g) * (1.0 - ${input1.associatedVariableName}.g) * 2.0);\\n`;\r\n state.compilationString += `${output.associatedVariableName}.b = ${input0.associatedVariableName}.b * ${input1.associatedVariableName}.b;\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NormalBlendBlock\", NormalBlendBlock);\r\n"]}
1
+ {"version":3,"file":"normalBlendBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/normalBlendBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IACnD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QACnF,IAAI,CAAC,aA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AoB,CAAC,OAAO,CAAC,CAAC;QAElD,KAAK,CAAC,iBAAiB,IAAI,SAAS,KAAK,gBAAgB,MAAM,CAAC,sBAAsB,QAAQ,CAAC;QAC/F,KAAK,CAAC,iBAAiB,IAAI,SAAS,KAAK,gBAAgB,MAAM,CAAC,sBAAsB,QAAQ,CAAC;QAC/F,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;QAChE,KAAK,CAAC,iBAAiB,IAAI,GAAG,MAAM,CAAC,sBAAsB,eAAe,KAAK,OAAO,MAAM,CAAC,sBAAsB,QAAQ,MAAM,CAAC,sBAAsB,cAAc,KAAK,oBAAoB,MAAM,CAAC,sBAAsB,gBAAgB,MAAM,CAAC,sBAAsB,eAAe,CAAC;QACzR,KAAK,CAAC,iBAAiB,IAAI,GAAG,MAAM,CAAC,sBAAsB,eAAe,KAAK,OAAO,MAAM,CAAC,sBAAsB,QAAQ,MAAM,CAAC,sBAAsB,cAAc,KAAK,oBAAoB,MAAM,CAAC,sBAAsB,gBAAgB,MAAM,CAAC,sBAAsB,eAAe,CAAC;QACzR,KAAK,CAAC,iBAAiB,IAAI,GAAG,MAAM,CAAC,sBAAsB,QAAQ,MAAM,CAAC,sBAAsB,QAAQ,MAAM,CAAC,sBAAsB,OAAO,CAAC;QAE7I,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to blend normals\r\n */\r\nexport class NormalBlendBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new NormalBlendBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"normalMap0\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"normalMap1\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Vector3);\r\n\r\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4 |\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4\r\n );\r\n\r\n this._inputs[1].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4 |\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4\r\n );\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"NormalBlendBlock\";\r\n }\r\n\r\n /**\r\n * Gets the first input component\r\n */\r\n public get normalMap0(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the second input component\r\n */\r\n public get normalMap1(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n const input0 = this._inputs[0];\r\n const input1 = this._inputs[1];\r\n const stepR = state._getFreeVariableName(\"stepR\");\r\n const stepG = state._getFreeVariableName(\"stepG\");\r\n\r\n state.compilationString += `float ${stepR} = step(0.5, ${input0.associatedVariableName}.r);\\n`;\r\n state.compilationString += `float ${stepG} = step(0.5, ${input0.associatedVariableName}.g);\\n`;\r\n state.compilationString += state._declareOutput(output) + `;\\n`;\r\n state.compilationString += `${output.associatedVariableName}.r = (1.0 - ${stepR}) * ${input0.associatedVariableName}.r * ${input1.associatedVariableName}.r * 2.0 + ${stepR} * (1.0 - (1.0 - ${input0.associatedVariableName}.r) * (1.0 - ${input1.associatedVariableName}.r) * 2.0);\\n`;\r\n state.compilationString += `${output.associatedVariableName}.g = (1.0 - ${stepG}) * ${input0.associatedVariableName}.g * ${input1.associatedVariableName}.g * 2.0 + ${stepG} * (1.0 - (1.0 - ${input0.associatedVariableName}.g) * (1.0 - ${input1.associatedVariableName}.g) * 2.0);\\n`;\r\n state.compilationString += `${output.associatedVariableName}.b = ${input0.associatedVariableName}.b * ${input1.associatedVariableName}.b;\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NormalBlendBlock\", NormalBlendBlock);\r\n"]}
@@ -41,7 +41,7 @@ export class NormalizeBlock extends NodeMaterialBlock {
41
41
  super._buildBlock(state);
42
42
  const output = this._outputs[0];
43
43
  const input = this._inputs[0];
44
- state.compilationString += this._declareOutput(output, state) + ` = normalize(${input.associatedVariableName});\n`;
44
+ state.compilationString += state._declareOutput(output) + ` = normalize(${input.associatedVariableName});\n`;
45
45
  return this;
46
46
  }
47
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/normalizeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE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AsB,MAAM,CAAC;QAEnH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to normalize a vector\r\n */\r\nexport class NormalizeBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new NormalizeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"NormalizeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n const input = this._inputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = normalize(${input.associatedVariableName});\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NormalizeBlock\", NormalizeBlock);\r\n"]}
1
+ {"version":3,"file":"normalizeBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/normalizeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB;IACjD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAEzD,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAC/F,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;IACpG,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAE9B,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,gBAAgB,KAAK,CAAC,sBAAsB,MAAM,CAAC;QAE7G,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to normalize a vector\r\n */\r\nexport class NormalizeBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new NormalizeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"NormalizeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n const input = this._inputs[0];\r\n\r\n state.compilationString += state._declareOutput(output) + ` = normalize(${input.associatedVariableName});\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NormalizeBlock\", NormalizeBlock);\r\n"]}
@@ -39,7 +39,7 @@ export class OneMinusBlock extends NodeMaterialBlock {
39
39
  _buildBlock(state) {
40
40
  super._buildBlock(state);
41
41
  const output = this._outputs[0];
42
- state.compilationString += this._declareOutput(output, state) + ` = 1. - ${this.input.associatedVariableName};\n`;
42
+ state.compilationString += state._declareOutput(output) + ` = 1. - ${this.input.associatedVariableName};\n`;
43
43
  return this;
44
44
  }
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"oneMinusBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/oneMinusBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAChD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;IACrG,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,eAAe,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,WAAW,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,CAAC;QAElH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC;AACtD,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC,CAAC,yBAAyB","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the opposite (1 - x) of a value\r\n */\r\nexport class OneMinusBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new OneMinusBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._outputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"OneMinusBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = 1. - ${this.input.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.OneMinusBlock\", OneMinusBlock);\r\nRegisterClass(\"BABYLON.OppositeBlock\", OneMinusBlock); // Backward compatibility\r\n"]}
1
+ {"version":3,"file":"oneMinusBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/oneMinusBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,C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AAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC;AACtD,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC,CAAC,yBAAyB","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the opposite (1 - x) of a value\r\n */\r\nexport class OneMinusBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new OneMinusBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._outputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"OneMinusBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += state._declareOutput(output) + ` = 1. - ${this.input.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.OneMinusBlock\", OneMinusBlock);\r\nRegisterClass(\"BABYLON.OppositeBlock\", OneMinusBlock); // Backward compatibility\r\n"]}
@@ -51,7 +51,7 @@ export class PosterizeBlock extends NodeMaterialBlock {
51
51
  super._buildBlock(state);
52
52
  const output = this._outputs[0];
53
53
  state.compilationString +=
54
- this._declareOutput(output, state) +
54
+ state._declareOutput(output) +
55
55
  ` = floor(${this.value.associatedVariableName} / (1.0 / ${this.steps.associatedVariableName})) * (1.0 / ${this.steps.associatedVariableName});\n`;
56
56
  return this;
57
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"posterizeBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/posterizeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB;IACjD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,oBAAoB,CAAC,CAAC,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ointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to posterize a value\r\n * @see https://en.wikipedia.org/wiki/Posterization\r\n */\r\nexport class PosterizeBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new PosterizeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"value\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"steps\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"PosterizeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the steps input component\r\n */\r\n public get steps(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString +=\r\n this._declareOutput(output, state) +\r\n ` = floor(${this.value.associatedVariableName} / (1.0 / ${this.steps.associatedVariableName})) * (1.0 / ${this.steps.associatedVariableName});\\n`;\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PosterizeBlock\", PosterizeBlock);\r\n"]}
1
+ {"version":3,"file":"posterizeBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/posterizeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,iBAAiB;IACjD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEhC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;QAChG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;QAChG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,KAAK,CAAC,CAAC;IACnG,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB;YACnB,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC;gBAC5B,YAAY,IAAI,CAAC,KAAK,CAAC,sBAAsB,aAAa,IAAI,CAAC,KAAK,CAAC,sBAAsB,eAAe,IAAI,CAAC,KAAK,CAAC,sBAAsB,MAAM,CAAC;QACtJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to posterize a value\r\n * @see https://en.wikipedia.org/wiki/Posterization\r\n */\r\nexport class PosterizeBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new PosterizeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"value\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"steps\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"PosterizeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the steps input component\r\n */\r\n public get steps(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString +=\r\n state._declareOutput(output) +\r\n ` = floor(${this.value.associatedVariableName} / (1.0 / ${this.steps.associatedVariableName})) * (1.0 / ${this.steps.associatedVariableName});\\n`;\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PosterizeBlock\", PosterizeBlock);\r\n"]}
@@ -46,7 +46,7 @@ export class PowBlock extends NodeMaterialBlock {
46
46
  _buildBlock(state) {
47
47
  super._buildBlock(state);
48
48
  const output = this._outputs[0];
49
- state.compilationString += this._declareOutput(output, state) + ` = pow(${this.value.associatedVariableName}, ${this.power.associatedVariableName});\n`;
49
+ state.compilationString += state._declareOutput(output) + ` = pow(${this.value.associatedVariableName}, ${this.power.associatedVariableName});\n`;
50
50
  return this;
51
51
  }
52
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"powBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/powBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,iBAAiB;IAC3C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,UAAU,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,UAAU,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,IAAI,CAAC,KAAK,CAAC,sBAAsB,MAAM,CAAC;QAExJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the value of the first parameter raised to the power of the second\r\n */\r\nexport class PowBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new PowBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"value\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"power\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"PowBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the power operand input component\r\n */\r\n public get power(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = pow(${this.value.associatedVariableName}, ${this.power.associatedVariableName});\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PowBlock\", PowBlock);\r\n"]}
1
+ {"version":3,"file":"powBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/powBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,iBAAiB;IAC3C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IA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eMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the value of the first parameter raised to the power of the second\r\n */\r\nexport class PowBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new PowBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"value\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"power\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._linkConnectionTypes(0, 1);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"PowBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value operand input component\r\n */\r\n public get value(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the power operand input component\r\n */\r\n public get power(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += state._declareOutput(output) + ` = pow(${this.value.associatedVariableName}, ${this.power.associatedVariableName});\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PowBlock\", PowBlock);\r\n"]}
@@ -45,7 +45,7 @@ export class RandomNumberBlock extends NodeMaterialBlock {
45
45
  const output = this._outputs[0];
46
46
  const comments = `//${this.name}`;
47
47
  state._emitFunctionFromInclude("helperFunctions", comments);
48
- state.compilationString += this._declareOutput(output, state) + ` = getRand(${this.seed.associatedVariableName}.xy);\n`;
48
+ state.compilationString += state._declareOutput(output) + ` = getRand(${this.seed.associatedVariableName}.xy);\n`;
49
49
  return this;
50
50
  }
51
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"randomNumberBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/randomNumberBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,iDAAiD,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACpD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAE3E,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,0CAA0C,CACtD,qCAAqC,CAAC,OAAO;YACzC,qCAAqC,CAAC,OAAO;YAC7C,qCAAqC,CAAC,OAAO;YAC7C,qCAAqC,CAAC,MAAM;YAC5C,qCAAqC,CAAC,MAAM,CACnD,CAAC;IACN,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,MAAM,QAAQ,GAAG,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;QAClC,KAAK,CAAC,wBAAwB,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QAE5D,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,cAAc,IAAI,CAAC,IAAI,CAAC,sBAAsB,SAAS,CAAC;QAExH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\nimport \"../../../Shaders/ShadersInclude/helperFunctions\";\r\n\r\n/**\r\n * Block used to get a random number\r\n */\r\nexport class RandomNumberBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new RandomNumberBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"seed\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float);\r\n\r\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Vector2 |\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4 |\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4\r\n );\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"RandomNumberBlock\";\r\n }\r\n\r\n /**\r\n * Gets the seed input component\r\n */\r\n public get seed(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n const comments = `//${this.name}`;\r\n state._emitFunctionFromInclude(\"helperFunctions\", comments);\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = getRand(${this.seed.associatedVariableName}.xy);\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.RandomNumberBlock\", RandomNumberBlock);\r\n"]}
1
+ {"version":3,"file":"randomNumberBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/randomNumberBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,iDAAiD,CAAC;AAEzD;;GAEG;AACH,MA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CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\nimport \"../../../Shaders/ShadersInclude/helperFunctions\";\r\n\r\n/**\r\n * Block used to get a random number\r\n */\r\nexport class RandomNumberBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new RandomNumberBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"seed\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float);\r\n\r\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Vector2 |\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4 |\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4\r\n );\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"RandomNumberBlock\";\r\n }\r\n\r\n /**\r\n * Gets the seed input component\r\n */\r\n public get seed(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n const comments = `//${this.name}`;\r\n state._emitFunctionFromInclude(\"helperFunctions\", comments);\r\n\r\n state.compilationString += state._declareOutput(output) + ` = getRand(${this.seed.associatedVariableName}.xy);\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.RandomNumberBlock\", RandomNumberBlock);\r\n"]}
@@ -39,10 +39,10 @@ export class ReciprocalBlock extends NodeMaterialBlock {
39
39
  super._buildBlock(state);
40
40
  const output = this._outputs[0];
41
41
  if (this.input.type === NodeMaterialBlockConnectionPointTypes.Matrix) {
42
- state.compilationString += this._declareOutput(output, state) + ` = inverse(${this.input.associatedVariableName});\n`;
42
+ state.compilationString += state._declareOutput(output) + ` = inverse(${this.input.associatedVariableName});\n`;
43
43
  }
44
44
  else {
45
- state.compilationString += this._declareOutput(output, state) + ` = 1. / ${this.input.associatedVariableName};\n`;
45
+ state.compilationString += state._declareOutput(output) + ` = 1. / ${this.input.associatedVariableName};\n`;
46
46
  }
47
47
  return this;
48
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reciprocalBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/reciprocalBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,iBAAiB;IAClD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,qCAAqC,CAAC,MAAM,EAAE;YAClE,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,cAAc,IAAI,CAAC,KAAK,CAAC,sBAAsB,MAAM,CAAC;SACzH;aAAM;YACH,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,WAAW,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,CAAC;SACrH;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the reciprocal (1 / x) of a value\r\n */\r\nexport class ReciprocalBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new ReciprocalBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"ReciprocalBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n if (this.input.type === NodeMaterialBlockConnectionPointTypes.Matrix) {\r\n state.compilationString += this._declareOutput(output, state) + ` = inverse(${this.input.associatedVariableName});\\n`;\r\n } else {\r\n state.compilationString += this._declareOutput(output, state) + ` = 1. / ${this.input.associatedVariableName};\\n`;\r\n }\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ReciprocalBlock\", ReciprocalBlock);\r\n"]}
1
+ {"version":3,"file":"reciprocalBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/reciprocalBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC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IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the reciprocal (1 / x) of a value\r\n */\r\nexport class ReciprocalBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new ReciprocalBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"ReciprocalBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n if (this.input.type === NodeMaterialBlockConnectionPointTypes.Matrix) {\r\n state.compilationString += state._declareOutput(output) + ` = inverse(${this.input.associatedVariableName});\\n`;\r\n } else {\r\n state.compilationString += state._declareOutput(output) + ` = 1. / ${this.input.associatedVariableName};\\n`;\r\n }\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ReciprocalBlock\", ReciprocalBlock);\r\n"]}
@@ -52,7 +52,7 @@ export class ReflectBlock extends NodeMaterialBlock {
52
52
  _buildBlock(state) {
53
53
  super._buildBlock(state);
54
54
  const output = this._outputs[0];
55
- state.compilationString += this._declareOutput(output, state) + ` = reflect(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz);\n`;
55
+ state.compilationString += state._declareOutput(output) + ` = reflect(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz);\n`;
56
56
  return this;
57
57
  }
58
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"reflectBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/reflectBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAC/C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QACjF,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC/E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAE7E,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,0CAA0C,CACtD,qCAAqC,CAAC,OAAO;YACzC,qCAAqC,CAAC,OAAO;YAC7C,qCAAqC,CAAC,MAAM;YAC5C,qCAAqC,CAAC,MAAM,CACnD,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,0CAA0C,CACtD,qCAAqC,CAAC,OAAO;YACzC,qCAAqC,CAAC,OAAO;YAC7C,qCAAqC,CAAC,MAAM;YAC5C,qCAAqC,CAAC,MAAM,CACnD,CAAC;IACN,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,cAAc,IAAI,CAAC,QAAQ,CAAC,sBAAsB,SAAS,IAAI,CAAC,MAAM,CAAC,sBAAsB,UAAU,CAAC;QAExK,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the reflected vector from a direction and a normal\r\n */\r\nexport class ReflectBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new ReflectBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"incident\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"normal\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Vector3);\r\n\r\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4 |\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4\r\n );\r\n this._inputs[1].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4 |\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4\r\n );\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"ReflectBlock\";\r\n }\r\n\r\n /**\r\n * Gets the incident component\r\n */\r\n public get incident(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the normal component\r\n */\r\n public get normal(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = reflect(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz);\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ReflectBlock\", ReflectBlock);\r\n"]}
1
+ {"version":3,"file":"reflectBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/reflectBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAC/C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QACjF,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC/E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAE7E,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,0CAA0C,CACtD,qCAAqC,CAAC,OAAO;YACzC,qCAAqC,CAAC,OAAO;YAC7C,qCAAqC,CAAC,MAAM;YAC5C,qCAAqC,CAAC,MAAM,CACnD,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,0CAA0C,CACtD,qCAAqC,CAAC,OAAO;YACzC,qCAAqC,CAAC,OAAO;YAC7C,qCAAqC,CAAC,MAAM;YAC5C,qCAAqC,CAAC,MAAM,CACnD,CAAC;IACN,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB,IAAI,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,cAAc,IAAI,CAAC,QAAQ,CAAC,sBAAsB,SAAS,IAAI,CAAC,MAAM,CAAC,sBAAsB,UAAU,CAAC;QAElK,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the reflected vector from a direction and a normal\r\n */\r\nexport class ReflectBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new ReflectBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"incident\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"normal\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Vector3);\r\n\r\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4 |\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4\r\n );\r\n this._inputs[1].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4 |\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4\r\n );\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"ReflectBlock\";\r\n }\r\n\r\n /**\r\n * Gets the incident component\r\n */\r\n public get incident(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the normal component\r\n */\r\n public get normal(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString += state._declareOutput(output) + ` = reflect(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz);\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ReflectBlock\", ReflectBlock);\r\n"]}
@@ -60,7 +60,7 @@ export class RefractBlock extends NodeMaterialBlock {
60
60
  super._buildBlock(state);
61
61
  const output = this._outputs[0];
62
62
  state.compilationString +=
63
- this._declareOutput(output, state) +
63
+ state._declareOutput(output) +
64
64
  ` = refract(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz, ${this.ior.associatedVariableName});\n`;
65
65
  return this;
66
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"refractBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/refractBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAC/C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QACjF,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACvE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAE7E,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,0CAA0C,CACtD,qCAAqC,CAAC,OAAO;YACzC,qCAAqC,CAAC,OAAO;YAC7C,qCAAqC,CAAC,MAAM;YAC5C,qCAAqC,CAAC,MAAM,CACnD,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,0CAA0C,CACtD,qCAAqC,CAAC,OAAO;YACzC,qCAAqC,CAAC,OAAO;YAC7C,qCAAqC,CAAC,MAAM;YAC5C,qCAAqC,CAAC,MAAM,CACnD,CAAC;IACN,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,GAAG;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB;YACnB,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC;gBAClC,cAAc,IAAI,CAAC,QAAQ,CAAC,sBAAsB,SAAS,IAAI,CAAC,MAAM,CAAC,sBAAsB,SAAS,IAAI,CAAC,GAAG,CAAC,sBAAsB,MAAM,CAAC;QAEhJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the refracted vector from a direction and a normal\r\n */\r\nexport class RefractBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new RefractBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"incident\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"normal\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"ior\", NodeMaterialBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Vector3);\r\n\r\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4 |\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4\r\n );\r\n this._inputs[1].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4 |\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4\r\n );\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"RefractBlock\";\r\n }\r\n\r\n /**\r\n * Gets the incident component\r\n */\r\n public get incident(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the normal component\r\n */\r\n public get normal(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the index of refraction component\r\n */\r\n public get ior(): NodeMaterialConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString +=\r\n this._declareOutput(output, state) +\r\n ` = refract(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz, ${this.ior.associatedVariableName});\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.RefractBlock\", RefractBlock);\r\n"]}
1
+ {"version":3,"file":"refractBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/refractBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAC/C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QACjF,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACvE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAE7E,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,0CAA0C,CACtD,qCAAqC,CAAC,OAAO;YACzC,qCAAqC,CAAC,OAAO;YAC7C,qCAAqC,CAAC,MAAM;YAC5C,qCAAqC,CAAC,MAAM,CACnD,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,0CAA0C,CACtD,qCAAqC,CAAC,OAAO;YACzC,qCAAqC,CAAC,OAAO;YAC7C,qCAAqC,CAAC,MAAM;YAC5C,qCAAqC,CAAC,MAAM,CACnD,CAAC;IACN,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,cAAc,CAAC;IAC1B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,GAAG;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAEhC,KAAK,CAAC,iBAAiB;YACnB,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC;gBAC5B,cAAc,IAAI,CAAC,QAAQ,CAAC,sBAAsB,SAAS,IAAI,CAAC,MAAM,CAAC,sBAAsB,SAAS,IAAI,CAAC,GAAG,CAAC,sBAAsB,MAAM,CAAC;QAEhJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n/**\r\n * Block used to get the refracted vector from a direction and a normal\r\n */\r\nexport class RefractBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new RefractBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"incident\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"normal\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"ior\", NodeMaterialBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Vector3);\r\n\r\n this._inputs[0].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4 |\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4\r\n );\r\n this._inputs[1].addExcludedConnectionPointFromAllowedTypes(\r\n NodeMaterialBlockConnectionPointTypes.Vector3 |\r\n NodeMaterialBlockConnectionPointTypes.Vector4 |\r\n NodeMaterialBlockConnectionPointTypes.Color3 |\r\n NodeMaterialBlockConnectionPointTypes.Color4\r\n );\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"RefractBlock\";\r\n }\r\n\r\n /**\r\n * Gets the incident component\r\n */\r\n public get incident(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the normal component\r\n */\r\n public get normal(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the index of refraction component\r\n */\r\n public get ior(): NodeMaterialConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n\r\n state.compilationString +=\r\n state._declareOutput(output) +\r\n ` = refract(${this.incident.associatedVariableName}.xyz, ${this.normal.associatedVariableName}.xyz, ${this.ior.associatedVariableName});\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.RefractBlock\", RefractBlock);\r\n"]}
@@ -82,7 +82,7 @@ export class RemapBlock extends NodeMaterialBlock {
82
82
  const targetMin = this.targetMin.isConnected ? this.targetMin.associatedVariableName : this._writeFloat(this.targetRange.x);
83
83
  const targetMax = this.targetMax.isConnected ? this.targetMax.associatedVariableName : this._writeFloat(this.targetRange.y);
84
84
  state.compilationString +=
85
- this._declareOutput(output, state) +
85
+ state._declareOutput(output) +
86
86
  ` = ${targetMin} + (${this._inputs[0].associatedVariableName} - ${sourceMin}) * (${targetMax} - ${targetMin}) / (${sourceMax} - ${sourceMin});\n`;
87
87
  return this;
88
88
  }