@babylonjs/core 7.18.0 → 7.19.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 (419) hide show
  1. package/Animations/animationGroup.js +10 -2
  2. package/Animations/animationGroup.js.map +1 -1
  3. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +1 -58
  4. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +26 -75
  5. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  6. package/Engines/abstractEngine.js +2 -2
  7. package/Engines/abstractEngine.js.map +1 -1
  8. package/Materials/Background/backgroundMaterial.d.ts +5 -3
  9. package/Materials/Background/backgroundMaterial.js +26 -3
  10. package/Materials/Background/backgroundMaterial.js.map +1 -1
  11. package/Materials/Background/index.d.ts +4 -0
  12. package/Materials/Background/index.js +6 -0
  13. package/Materials/Background/index.js.map +1 -1
  14. package/Materials/GreasedLine/greasedLineMaterialInterfaces.d.ts +3 -1
  15. package/Materials/GreasedLine/greasedLineMaterialInterfaces.js +3 -1
  16. package/Materials/GreasedLine/greasedLineMaterialInterfaces.js.map +1 -1
  17. package/Materials/Node/Blocks/Dual/clipPlanesBlock.d.ts +1 -0
  18. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +22 -0
  19. package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
  20. package/Materials/Node/Blocks/Dual/fogBlock.d.ts +2 -1
  21. package/Materials/Node/Blocks/Dual/fogBlock.js +14 -1
  22. package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
  23. package/Materials/Node/Blocks/Dual/index.d.ts +28 -0
  24. package/Materials/Node/Blocks/Dual/index.js +33 -0
  25. package/Materials/Node/Blocks/Dual/index.js.map +1 -1
  26. package/Materials/Node/Blocks/Dual/lightBlock.d.ts +2 -9
  27. package/Materials/Node/Blocks/Dual/lightBlock.js +32 -9
  28. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  29. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.d.ts +2 -1
  30. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +14 -1
  31. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  32. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.d.ts +1 -3
  33. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +20 -3
  34. package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
  35. package/Materials/Node/Blocks/Fragment/index.d.ts +18 -0
  36. package/Materials/Node/Blocks/Fragment/index.js +22 -0
  37. package/Materials/Node/Blocks/Fragment/index.js.map +1 -1
  38. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.d.ts +2 -3
  39. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +65 -35
  40. package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
  41. package/Materials/Node/Blocks/Fragment/shadowMapBlock.d.ts +1 -0
  42. package/Materials/Node/Blocks/Fragment/shadowMapBlock.js +20 -0
  43. package/Materials/Node/Blocks/Fragment/shadowMapBlock.js.map +1 -1
  44. package/Materials/Node/Blocks/PBR/anisotropyBlock.js +8 -7
  45. package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
  46. package/Materials/Node/Blocks/PBR/clearCoatBlock.js +9 -6
  47. package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
  48. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.d.ts +1 -0
  49. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +28 -18
  50. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  51. package/Materials/Node/Blocks/PBR/refractionBlock.js +14 -12
  52. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  53. package/Materials/Node/Blocks/Vertex/bonesBlock.d.ts +1 -2
  54. package/Materials/Node/Blocks/Vertex/bonesBlock.js +12 -2
  55. package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
  56. package/Materials/Node/Blocks/Vertex/index.d.ts +12 -0
  57. package/Materials/Node/Blocks/Vertex/index.js +15 -0
  58. package/Materials/Node/Blocks/Vertex/index.js.map +1 -1
  59. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.d.ts +1 -2
  60. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +22 -2
  61. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  62. package/Materials/Node/nodeMaterial.d.ts +2 -0
  63. package/Materials/Node/nodeMaterial.js +26 -0
  64. package/Materials/Node/nodeMaterial.js.map +1 -1
  65. package/Materials/Node/nodeMaterialBlock.d.ts +10 -0
  66. package/Materials/Node/nodeMaterialBlock.js +13 -0
  67. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  68. package/Materials/PBR/index.d.ts +4 -0
  69. package/Materials/PBR/index.js +5 -0
  70. package/Materials/PBR/index.js.map +1 -1
  71. package/Materials/PBR/pbrBaseMaterial.d.ts +12 -3
  72. package/Materials/PBR/pbrBaseMaterial.js +62 -20
  73. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  74. package/Materials/PBR/pbrMaterial.d.ts +2 -1
  75. package/Materials/PBR/pbrMaterial.js +3 -2
  76. package/Materials/PBR/pbrMaterial.js.map +1 -1
  77. package/Materials/index.d.ts +4 -0
  78. package/Materials/index.js +6 -0
  79. package/Materials/index.js.map +1 -1
  80. package/Materials/material.d.ts +7 -0
  81. package/Materials/material.js +8 -0
  82. package/Materials/material.js.map +1 -1
  83. package/Materials/materialPluginManager.js +19 -1
  84. package/Materials/materialPluginManager.js.map +1 -1
  85. package/Materials/standardMaterial.d.ts +9 -3
  86. package/Materials/standardMaterial.js +30 -3
  87. package/Materials/standardMaterial.js.map +1 -1
  88. package/Meshes/Builders/greasedLineBuilder.js +2 -2
  89. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  90. package/Meshes/Builders/linesBuilder.js +1 -0
  91. package/Meshes/Builders/linesBuilder.js.map +1 -1
  92. package/ShadersWGSL/ShadersInclude/backgroundUboDeclaration.d.ts +6 -0
  93. package/ShadersWGSL/ShadersInclude/backgroundUboDeclaration.js +12 -0
  94. package/ShadersWGSL/ShadersInclude/backgroundUboDeclaration.js.map +1 -0
  95. package/ShadersWGSL/ShadersInclude/bakedVertexAnimation.d.ts +1 -1
  96. package/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js +1 -1
  97. package/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js.map +1 -1
  98. package/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.d.ts +1 -1
  99. package/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js +1 -1
  100. package/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js.map +1 -1
  101. package/ShadersWGSL/ShadersInclude/bonesDeclaration.d.ts +1 -1
  102. package/ShadersWGSL/ShadersInclude/bonesDeclaration.js +1 -1
  103. package/ShadersWGSL/ShadersInclude/bonesDeclaration.js.map +1 -1
  104. package/ShadersWGSL/ShadersInclude/bonesVertex.d.ts +1 -1
  105. package/ShadersWGSL/ShadersInclude/bonesVertex.js +1 -1
  106. package/ShadersWGSL/ShadersInclude/bonesVertex.js.map +1 -1
  107. package/ShadersWGSL/ShadersInclude/bumpFragment.d.ts +1 -1
  108. package/ShadersWGSL/ShadersInclude/bumpFragment.js +17 -17
  109. package/ShadersWGSL/ShadersInclude/bumpFragment.js.map +1 -1
  110. package/ShadersWGSL/ShadersInclude/bumpFragmentFunctions.d.ts +1 -1
  111. package/ShadersWGSL/ShadersInclude/bumpFragmentFunctions.js +3 -3
  112. package/ShadersWGSL/ShadersInclude/bumpFragmentFunctions.js.map +1 -1
  113. package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.d.ts +1 -1
  114. package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js +22 -42
  115. package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
  116. package/ShadersWGSL/ShadersInclude/bumpVertex.d.ts +5 -0
  117. package/ShadersWGSL/ShadersInclude/bumpVertex.js +14 -0
  118. package/ShadersWGSL/ShadersInclude/bumpVertex.js.map +1 -0
  119. package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.d.ts +5 -0
  120. package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js +14 -0
  121. package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js.map +1 -0
  122. package/ShadersWGSL/ShadersInclude/clipPlaneFragment.d.ts +1 -1
  123. package/ShadersWGSL/ShadersInclude/clipPlaneFragment.js +1 -1
  124. package/ShadersWGSL/ShadersInclude/clipPlaneFragment.js.map +1 -1
  125. package/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.d.ts +1 -1
  126. package/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js +1 -1
  127. package/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js.map +1 -1
  128. package/ShadersWGSL/ShadersInclude/clipPlaneVertex.d.ts +1 -1
  129. package/ShadersWGSL/ShadersInclude/clipPlaneVertex.js +1 -1
  130. package/ShadersWGSL/ShadersInclude/clipPlaneVertex.js.map +1 -1
  131. package/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.d.ts +1 -1
  132. package/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js +1 -1
  133. package/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js.map +1 -1
  134. package/ShadersWGSL/ShadersInclude/decalFragment.d.ts +1 -1
  135. package/ShadersWGSL/ShadersInclude/decalFragment.js +5 -4
  136. package/ShadersWGSL/ShadersInclude/decalFragment.js.map +1 -1
  137. package/ShadersWGSL/ShadersInclude/decalFragmentDeclaration.d.ts +5 -0
  138. package/ShadersWGSL/ShadersInclude/decalFragmentDeclaration.js +12 -0
  139. package/ShadersWGSL/ShadersInclude/decalFragmentDeclaration.js.map +1 -0
  140. package/ShadersWGSL/ShadersInclude/decalVertexDeclaration.d.ts +5 -0
  141. package/ShadersWGSL/ShadersInclude/decalVertexDeclaration.js +12 -0
  142. package/ShadersWGSL/ShadersInclude/decalVertexDeclaration.js.map +1 -0
  143. package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.d.ts +7 -0
  144. package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js +15 -0
  145. package/ShadersWGSL/ShadersInclude/defaultUboDeclaration.js.map +1 -0
  146. package/ShadersWGSL/ShadersInclude/depthPrePass.d.ts +1 -1
  147. package/ShadersWGSL/ShadersInclude/depthPrePass.js +1 -1
  148. package/ShadersWGSL/ShadersInclude/depthPrePass.js.map +1 -1
  149. package/ShadersWGSL/ShadersInclude/fogFragment.d.ts +5 -0
  150. package/ShadersWGSL/ShadersInclude/fogFragment.js +16 -0
  151. package/ShadersWGSL/ShadersInclude/fogFragment.js.map +1 -0
  152. package/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.d.ts +1 -1
  153. package/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js +2 -3
  154. package/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js.map +1 -1
  155. package/ShadersWGSL/ShadersInclude/fogVertex.d.ts +1 -1
  156. package/ShadersWGSL/ShadersInclude/fogVertex.js +2 -2
  157. package/ShadersWGSL/ShadersInclude/fogVertex.js.map +1 -1
  158. package/ShadersWGSL/ShadersInclude/fogVertexDeclaration.d.ts +1 -1
  159. package/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js +1 -1
  160. package/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js.map +1 -1
  161. package/ShadersWGSL/ShadersInclude/fresnelFunction.d.ts +1 -1
  162. package/ShadersWGSL/ShadersInclude/fresnelFunction.js +1 -1
  163. package/ShadersWGSL/ShadersInclude/fresnelFunction.js.map +1 -1
  164. package/ShadersWGSL/ShadersInclude/harmonicsFunctions.d.ts +1 -1
  165. package/ShadersWGSL/ShadersInclude/harmonicsFunctions.js +1 -1
  166. package/ShadersWGSL/ShadersInclude/harmonicsFunctions.js.map +1 -1
  167. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.d.ts +1 -1
  168. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +1 -1
  169. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  170. package/ShadersWGSL/ShadersInclude/helperFunctions.d.ts +1 -1
  171. package/ShadersWGSL/ShadersInclude/helperFunctions.js +15 -6
  172. package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
  173. package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.d.ts +1 -1
  174. package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js +3 -3
  175. package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js.map +1 -1
  176. package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.d.ts +1 -1
  177. package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js +5 -5
  178. package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js.map +1 -1
  179. package/ShadersWGSL/ShadersInclude/importanceSampling.d.ts +1 -1
  180. package/ShadersWGSL/ShadersInclude/importanceSampling.js +1 -1
  181. package/ShadersWGSL/ShadersInclude/importanceSampling.js.map +1 -1
  182. package/ShadersWGSL/ShadersInclude/instancesDeclaration.d.ts +1 -1
  183. package/ShadersWGSL/ShadersInclude/instancesDeclaration.js +1 -1
  184. package/ShadersWGSL/ShadersInclude/instancesDeclaration.js.map +1 -1
  185. package/ShadersWGSL/ShadersInclude/instancesVertex.d.ts +1 -1
  186. package/ShadersWGSL/ShadersInclude/instancesVertex.js +4 -4
  187. package/ShadersWGSL/ShadersInclude/instancesVertex.js.map +1 -1
  188. package/ShadersWGSL/ShadersInclude/lightFragment.d.ts +1 -1
  189. package/ShadersWGSL/ShadersInclude/lightFragment.js +8 -8
  190. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  191. package/ShadersWGSL/ShadersInclude/lightUboDeclaration.d.ts +1 -1
  192. package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js +2 -2
  193. package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js.map +1 -1
  194. package/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.d.ts +5 -0
  195. package/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js +33 -0
  196. package/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js.map +1 -0
  197. package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.d.ts +1 -1
  198. package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js +1 -1
  199. package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js.map +1 -1
  200. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.d.ts +1 -1
  201. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +3 -3
  202. package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
  203. package/ShadersWGSL/ShadersInclude/logDepthDeclaration.d.ts +1 -1
  204. package/ShadersWGSL/ShadersInclude/logDepthDeclaration.js +1 -1
  205. package/ShadersWGSL/ShadersInclude/logDepthDeclaration.js.map +1 -1
  206. package/ShadersWGSL/ShadersInclude/logDepthFragment.d.ts +5 -0
  207. package/ShadersWGSL/ShadersInclude/logDepthFragment.js +12 -0
  208. package/ShadersWGSL/ShadersInclude/logDepthFragment.js.map +1 -0
  209. package/ShadersWGSL/ShadersInclude/logDepthVertex.d.ts +1 -1
  210. package/ShadersWGSL/ShadersInclude/logDepthVertex.js +2 -2
  211. package/ShadersWGSL/ShadersInclude/logDepthVertex.js.map +1 -1
  212. package/ShadersWGSL/ShadersInclude/mainUVVaryingDeclaration.d.ts +5 -0
  213. package/ShadersWGSL/ShadersInclude/mainUVVaryingDeclaration.js +12 -0
  214. package/ShadersWGSL/ShadersInclude/mainUVVaryingDeclaration.js.map +1 -0
  215. package/ShadersWGSL/ShadersInclude/meshUboDeclaration.d.ts +1 -1
  216. package/ShadersWGSL/ShadersInclude/meshUboDeclaration.js +1 -1
  217. package/ShadersWGSL/ShadersInclude/meshUboDeclaration.js.map +1 -1
  218. package/ShadersWGSL/ShadersInclude/morphTargetsVertex.d.ts +1 -1
  219. package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js +6 -6
  220. package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js.map +1 -1
  221. package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.d.ts +1 -1
  222. package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js +1 -1
  223. package/ShadersWGSL/ShadersInclude/morphTargetsVertexDeclaration.js.map +1 -1
  224. package/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobal.d.ts +1 -1
  225. package/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobal.js +1 -1
  226. package/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobal.js.map +1 -1
  227. package/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobalDeclaration.d.ts +1 -1
  228. package/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobalDeclaration.js +1 -1
  229. package/ShadersWGSL/ShadersInclude/morphTargetsVertexGlobalDeclaration.js.map +1 -1
  230. package/ShadersWGSL/ShadersInclude/oitDeclaration.d.ts +5 -0
  231. package/ShadersWGSL/ShadersInclude/oitDeclaration.js +13 -0
  232. package/ShadersWGSL/ShadersInclude/oitDeclaration.js.map +1 -0
  233. package/ShadersWGSL/ShadersInclude/oitFragment.d.ts +5 -0
  234. package/ShadersWGSL/ShadersInclude/oitFragment.js +34 -0
  235. package/ShadersWGSL/ShadersInclude/oitFragment.js.map +1 -0
  236. package/ShadersWGSL/ShadersInclude/packingFunctions.d.ts +1 -1
  237. package/ShadersWGSL/ShadersInclude/packingFunctions.js +1 -1
  238. package/ShadersWGSL/ShadersInclude/packingFunctions.js.map +1 -1
  239. package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.d.ts +1 -1
  240. package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +12 -8
  241. package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
  242. package/ShadersWGSL/ShadersInclude/pbrBlockAlbedoOpacity.d.ts +1 -1
  243. package/ShadersWGSL/ShadersInclude/pbrBlockAlbedoOpacity.js +5 -6
  244. package/ShadersWGSL/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
  245. package/ShadersWGSL/ShadersInclude/pbrBlockAlphaFresnel.d.ts +1 -1
  246. package/ShadersWGSL/ShadersInclude/pbrBlockAlphaFresnel.js +7 -8
  247. package/ShadersWGSL/ShadersInclude/pbrBlockAlphaFresnel.js.map +1 -1
  248. package/ShadersWGSL/ShadersInclude/pbrBlockAmbientOcclusion.d.ts +1 -1
  249. package/ShadersWGSL/ShadersInclude/pbrBlockAmbientOcclusion.js +1 -1
  250. package/ShadersWGSL/ShadersInclude/pbrBlockAmbientOcclusion.js.map +1 -1
  251. package/ShadersWGSL/ShadersInclude/pbrBlockAnisotropic.d.ts +1 -1
  252. package/ShadersWGSL/ShadersInclude/pbrBlockAnisotropic.js +5 -5
  253. package/ShadersWGSL/ShadersInclude/pbrBlockAnisotropic.js.map +1 -1
  254. package/ShadersWGSL/ShadersInclude/pbrBlockClearcoat.d.ts +1 -1
  255. package/ShadersWGSL/ShadersInclude/pbrBlockClearcoat.js +5 -5
  256. package/ShadersWGSL/ShadersInclude/pbrBlockClearcoat.js.map +1 -1
  257. package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.d.ts +1 -1
  258. package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js +1 -1
  259. package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js.map +1 -1
  260. package/ShadersWGSL/ShadersInclude/pbrBlockFinalColorComposition.d.ts +1 -1
  261. package/ShadersWGSL/ShadersInclude/pbrBlockFinalColorComposition.js +3 -3
  262. package/ShadersWGSL/ShadersInclude/pbrBlockFinalColorComposition.js.map +1 -1
  263. package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.d.ts +1 -1
  264. package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js +6 -6
  265. package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
  266. package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.d.ts +1 -1
  267. package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js +7 -7
  268. package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
  269. package/ShadersWGSL/ShadersInclude/pbrBlockGeometryInfo.d.ts +1 -1
  270. package/ShadersWGSL/ShadersInclude/pbrBlockGeometryInfo.js +1 -1
  271. package/ShadersWGSL/ShadersInclude/pbrBlockGeometryInfo.js.map +1 -1
  272. package/ShadersWGSL/ShadersInclude/pbrBlockImageProcessing.d.ts +1 -1
  273. package/ShadersWGSL/ShadersInclude/pbrBlockImageProcessing.js +4 -4
  274. package/ShadersWGSL/ShadersInclude/pbrBlockImageProcessing.js.map +1 -1
  275. package/ShadersWGSL/ShadersInclude/pbrBlockIridescence.d.ts +1 -1
  276. package/ShadersWGSL/ShadersInclude/pbrBlockIridescence.js +3 -5
  277. package/ShadersWGSL/ShadersInclude/pbrBlockIridescence.js.map +1 -1
  278. package/ShadersWGSL/ShadersInclude/pbrBlockLightmapInit.d.ts +1 -1
  279. package/ShadersWGSL/ShadersInclude/pbrBlockLightmapInit.js +5 -5
  280. package/ShadersWGSL/ShadersInclude/pbrBlockLightmapInit.js.map +1 -1
  281. package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.d.ts +1 -1
  282. package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js +4 -4
  283. package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js.map +1 -1
  284. package/ShadersWGSL/ShadersInclude/pbrBlockNormalGeometric.d.ts +5 -0
  285. package/ShadersWGSL/ShadersInclude/pbrBlockNormalGeometric.js +19 -0
  286. package/ShadersWGSL/ShadersInclude/pbrBlockNormalGeometric.js.map +1 -0
  287. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.d.ts +1 -1
  288. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js +1 -1
  289. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js.map +1 -1
  290. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance0.d.ts +1 -1
  291. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance0.js +1 -1
  292. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance0.js.map +1 -1
  293. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.d.ts +1 -1
  294. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +6 -6
  295. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
  296. package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.d.ts +1 -1
  297. package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js +1 -1
  298. package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
  299. package/ShadersWGSL/ShadersInclude/pbrBlockSheen.d.ts +1 -1
  300. package/ShadersWGSL/ShadersInclude/pbrBlockSheen.js +4 -4
  301. package/ShadersWGSL/ShadersInclude/pbrBlockSheen.js.map +1 -1
  302. package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.d.ts +1 -1
  303. package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js +4 -4
  304. package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  305. package/ShadersWGSL/ShadersInclude/pbrDebug.d.ts +1 -1
  306. package/ShadersWGSL/ShadersInclude/pbrDebug.js +10 -10
  307. package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
  308. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFalloffFunctions.d.ts +1 -1
  309. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFalloffFunctions.js +1 -1
  310. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFalloffFunctions.js.map +1 -1
  311. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.d.ts +1 -1
  312. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +1 -1
  313. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  314. package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.d.ts +1 -1
  315. package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js +1 -1
  316. package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js.map +1 -1
  317. package/ShadersWGSL/ShadersInclude/pbrFragmentExtraDeclaration.d.ts +6 -0
  318. package/ShadersWGSL/ShadersInclude/pbrFragmentExtraDeclaration.js +24 -0
  319. package/ShadersWGSL/ShadersInclude/pbrFragmentExtraDeclaration.js.map +1 -0
  320. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.d.ts +7 -0
  321. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js +96 -0
  322. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -0
  323. package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.d.ts +1 -1
  324. package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js +3 -3
  325. package/ShadersWGSL/ShadersInclude/pbrHelperFunctions.js.map +1 -1
  326. package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.d.ts +1 -1
  327. package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js +3 -3
  328. package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js.map +1 -1
  329. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.d.ts +7 -0
  330. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +15 -0
  331. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -0
  332. package/ShadersWGSL/ShadersInclude/prePassDeclaration.d.ts +5 -0
  333. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +17 -0
  334. package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -0
  335. package/ShadersWGSL/ShadersInclude/prePassVertex.d.ts +5 -0
  336. package/ShadersWGSL/ShadersInclude/prePassVertex.js +42 -0
  337. package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -0
  338. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.d.ts +5 -0
  339. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js +17 -0
  340. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js.map +1 -0
  341. package/ShadersWGSL/ShadersInclude/reflectionFunction.d.ts +1 -1
  342. package/ShadersWGSL/ShadersInclude/reflectionFunction.js +12 -10
  343. package/ShadersWGSL/ShadersInclude/reflectionFunction.js.map +1 -1
  344. package/ShadersWGSL/ShadersInclude/samplerFragmentAlternateDeclaration.d.ts +5 -0
  345. package/ShadersWGSL/ShadersInclude/samplerFragmentAlternateDeclaration.js +26 -0
  346. package/ShadersWGSL/ShadersInclude/samplerFragmentAlternateDeclaration.js.map +1 -0
  347. package/ShadersWGSL/ShadersInclude/samplerFragmentDeclaration.d.ts +1 -1
  348. package/ShadersWGSL/ShadersInclude/samplerFragmentDeclaration.js +2 -2
  349. package/ShadersWGSL/ShadersInclude/samplerFragmentDeclaration.js.map +1 -1
  350. package/ShadersWGSL/ShadersInclude/samplerVertexDeclaration.d.ts +5 -0
  351. package/ShadersWGSL/ShadersInclude/samplerVertexDeclaration.js +12 -0
  352. package/ShadersWGSL/ShadersInclude/samplerVertexDeclaration.js.map +1 -0
  353. package/ShadersWGSL/ShadersInclude/samplerVertexImplementation.d.ts +5 -0
  354. package/ShadersWGSL/ShadersInclude/samplerVertexImplementation.js +33 -0
  355. package/ShadersWGSL/ShadersInclude/samplerVertexImplementation.js.map +1 -0
  356. package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.d.ts +1 -1
  357. package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js +1 -1
  358. package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js.map +1 -1
  359. package/ShadersWGSL/ShadersInclude/shadowMapFragment.d.ts +1 -1
  360. package/ShadersWGSL/ShadersInclude/shadowMapFragment.js +1 -1
  361. package/ShadersWGSL/ShadersInclude/shadowMapFragment.js.map +1 -1
  362. package/ShadersWGSL/ShadersInclude/shadowMapVertexMetric.d.ts +1 -1
  363. package/ShadersWGSL/ShadersInclude/shadowMapVertexMetric.js +1 -1
  364. package/ShadersWGSL/ShadersInclude/shadowMapVertexMetric.js.map +1 -1
  365. package/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.d.ts +1 -1
  366. package/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js +1 -1
  367. package/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
  368. package/ShadersWGSL/ShadersInclude/shadowsVertex.d.ts +1 -1
  369. package/ShadersWGSL/ShadersInclude/shadowsVertex.js +2 -2
  370. package/ShadersWGSL/ShadersInclude/shadowsVertex.js.map +1 -1
  371. package/ShadersWGSL/ShadersInclude/subSurfaceScatteringFunctions.d.ts +5 -0
  372. package/ShadersWGSL/ShadersInclude/subSurfaceScatteringFunctions.js +10 -0
  373. package/ShadersWGSL/ShadersInclude/subSurfaceScatteringFunctions.js.map +1 -0
  374. package/ShadersWGSL/ShadersInclude/uvAttributeDeclaration.d.ts +5 -0
  375. package/ShadersWGSL/ShadersInclude/uvAttributeDeclaration.js +12 -0
  376. package/ShadersWGSL/ShadersInclude/uvAttributeDeclaration.js.map +1 -0
  377. package/ShadersWGSL/ShadersInclude/uvVariableDeclaration.d.ts +5 -0
  378. package/ShadersWGSL/ShadersInclude/uvVariableDeclaration.js +17 -0
  379. package/ShadersWGSL/ShadersInclude/uvVariableDeclaration.js.map +1 -0
  380. package/ShadersWGSL/ShadersInclude/vertexColorMixing.d.ts +5 -0
  381. package/ShadersWGSL/ShadersInclude/vertexColorMixing.js +22 -0
  382. package/ShadersWGSL/ShadersInclude/vertexColorMixing.js.map +1 -0
  383. package/ShadersWGSL/background.fragment.d.ts +20 -0
  384. package/ShadersWGSL/background.fragment.js +225 -0
  385. package/ShadersWGSL/background.fragment.js.map +1 -0
  386. package/ShadersWGSL/background.vertex.d.ts +21 -0
  387. package/ShadersWGSL/background.vertex.js +123 -0
  388. package/ShadersWGSL/background.vertex.js.map +1 -0
  389. package/ShadersWGSL/boundingInfo.compute.d.ts +1 -1
  390. package/ShadersWGSL/boundingInfo.compute.js +1 -1
  391. package/ShadersWGSL/boundingInfo.compute.js.map +1 -1
  392. package/ShadersWGSL/clearQuad.fragment.d.ts +1 -1
  393. package/ShadersWGSL/clearQuad.fragment.js +1 -1
  394. package/ShadersWGSL/clearQuad.fragment.js.map +1 -1
  395. package/ShadersWGSL/clearQuad.vertex.d.ts +1 -1
  396. package/ShadersWGSL/clearQuad.vertex.js +1 -1
  397. package/ShadersWGSL/clearQuad.vertex.js.map +1 -1
  398. package/ShadersWGSL/default.fragment.d.ts +31 -0
  399. package/ShadersWGSL/default.fragment.js +381 -0
  400. package/ShadersWGSL/default.fragment.js.map +1 -0
  401. package/ShadersWGSL/default.vertex.d.ts +36 -0
  402. package/ShadersWGSL/default.vertex.js +169 -0
  403. package/ShadersWGSL/default.vertex.js.map +1 -0
  404. package/ShadersWGSL/gpuUpdateParticles.compute.d.ts +1 -1
  405. package/ShadersWGSL/gpuUpdateParticles.compute.js +1 -1
  406. package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
  407. package/ShadersWGSL/particles.vertex.d.ts +1 -1
  408. package/ShadersWGSL/particles.vertex.js +1 -1
  409. package/ShadersWGSL/particles.vertex.js.map +1 -1
  410. package/ShadersWGSL/pbr.fragment.d.ts +60 -0
  411. package/ShadersWGSL/pbr.fragment.js +667 -0
  412. package/ShadersWGSL/pbr.fragment.js.map +1 -0
  413. package/ShadersWGSL/pbr.vertex.d.ts +36 -0
  414. package/ShadersWGSL/pbr.vertex.js +232 -0
  415. package/ShadersWGSL/pbr.vertex.js.map +1 -0
  416. package/ShadersWGSL/postprocess.vertex.d.ts +1 -1
  417. package/ShadersWGSL/postprocess.vertex.js +1 -1
  418. package/ShadersWGSL/postprocess.vertex.js.map +1 -1
  419. package/package.json +1 -1
@@ -84,14 +84,14 @@ export function CreateGreasedLineMaterial(name, options, scene) {
84
84
  let material;
85
85
  switch (options.materialType) {
86
86
  case 1 /* GreasedLineMeshMaterialType.MATERIAL_TYPE_PBR */:
87
- material = new PBRMaterial(name, scene);
87
+ material = new PBRMaterial(name, scene, true); // Forcing glsl for now
88
88
  new GreasedLinePluginMaterial(material, scene, options);
89
89
  break;
90
90
  case 2 /* GreasedLineMeshMaterialType.MATERIAL_TYPE_SIMPLE */:
91
91
  material = new GreasedLineSimpleMaterial(name, scene, options);
92
92
  break;
93
93
  default:
94
- material = new StandardMaterial(name, scene);
94
+ material = new StandardMaterial(name, scene, true); // Forcing glsl for now
95
95
  new GreasedLinePluginMaterial(material, scene, options);
96
96
  break;
97
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"greasedLineBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/greasedLineBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAG7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAN,IAAkB,gCAyBjB;AAzB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AAG,CAAC,CAAC,CAAC;YAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;gBACrC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAExB,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBAE3B,CAAC,IAAI,iBAAiB,CAAC;aAC1B;SACJ;aAAM,IAAI,iBAAiB,qEAA6D,EAAE;YACvF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACpC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;aAC9B;SACJ;KACJ;SAAM;QACH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;YACjC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;SAC9B;KACJ;IAED,OAAO,UAAU,CAAC;AACtB,CAAC","sourcesContent":["import { StandardMaterial } from \"./../../Materials/standardMaterial\";\r\nimport { PBRMaterial } from \"../../Materials/PBR/pbrMaterial\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { GreasedLineMesh } from \"../GreasedLine/greasedLineMesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport type { Color3 } from \"../../Maths/math.color\";\r\nimport { GreasedLineSimpleMaterial } from \"../../Materials/GreasedLine/greasedLineSimpleMaterial\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\r\nimport type { GreasedLineMeshOptions } from \"../GreasedLine/greasedLineBaseMesh\";\r\nimport { GreasedLineRibbonAutoDirectionMode, GreasedLineRibbonFacesMode, GreasedLineRibbonPointsMode } from \"../GreasedLine/greasedLineBaseMesh\";\r\nimport { GreasedLineRibbonMesh } from \"../GreasedLine/greasedLineRibbonMesh\";\r\nimport type { GreasedLineMaterialOptions } from \"../../Materials/GreasedLine/greasedLineMaterialInterfaces\";\r\nimport { GreasedLineMeshMaterialType } from \"../../Materials/GreasedLine/greasedLineMaterialInterfaces\";\r\nimport { GreasedLinePluginMaterial } from \"../../Materials/GreasedLine/greasedLinePluginMaterial\";\r\nimport { GreasedLineMaterialDefaults } from \"../../Materials/GreasedLine/greasedLineMaterialDefaults\";\r\n\r\n/**\r\n * How are the colors distributed along the color table\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colors-and-colordistribution}\r\n */\r\nexport const enum GreasedLineMeshColorDistribution {\r\n /**\r\n * Do no modify the color table\r\n */\r\n COLOR_DISTRIBUTION_NONE = 0,\r\n /**\r\n * Repeat the colors until the color table is full\r\n */\r\n COLOR_DISTRIBUTION_REPEAT = 1,\r\n /**\r\n * Distribute the colors evenly through the color table\r\n */\r\n COLOR_DISTRIBUTION_EVEN = 2,\r\n /**\r\n * Put the colors to start of the color table a fill the rest with the default color\r\n */\r\n COLOR_DISTRIBUTION_START = 3,\r\n /**\r\n * Put the colors to the end of the color table and fill the rest with the default color\r\n */\r\n COLOR_DISTRIBUTION_END = 4,\r\n /**\r\n * Put the colors to start and to the end of the color table and fill the gap between with the default color\r\n */\r\n COLOR_DISTRIBUTION_START_END = 5,\r\n}\r\n\r\n/**\r\n * How are the widths distributed along the width table\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#widths-and-widthdistribution}\r\n */\r\nexport const enum GreasedLineMeshWidthDistribution {\r\n /**\r\n * Do no modify the width table\r\n */\r\n WIDTH_DISTRIBUTION_NONE = 0,\r\n /**\r\n * Repeat the widths until the width table is full\r\n */\r\n WIDTH_DISTRIBUTION_REPEAT = 1,\r\n /**\r\n * Distribute the widths evenly through the width table\r\n */\r\n WIDTH_DISTRIBUTION_EVEN = 2,\r\n /**\r\n * Put the widths to start of the width table a fill the rest with the default width\r\n */\r\n WIDTH_DISTRIBUTION_START = 3,\r\n /**\r\n * Put the widths to the end of the width table and fill the rest with the default width\r\n */\r\n WIDTH_DISTRIBUTION_END = 4,\r\n /**\r\n * Put the widths to start and to the end of the width table and fill the gap between with the default width\r\n */\r\n WIDTH_DISTRIBUTION_START_END = 5,\r\n}\r\n\r\n/**\r\n * Material options for GreasedLineBuilder\r\n */\r\nexport interface GreasedLineMaterialBuilderOptions extends GreasedLineMaterialOptions {\r\n /**\r\n * If set to true a new material will be created and a new material plugin will be attached\r\n * to the material. The material will be set on the mesh. If the instance option is specified in the mesh options,\r\n * no material will be created/assigned. Defaults to true.\r\n */\r\n createAndAssignMaterial?: boolean;\r\n /**\r\n * Distribution of the colors if the color table contains fewer entries than needed. Defaults to GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START\r\n * @see CompleteGreasedLineColorTable\r\n */\r\n colorDistribution?: GreasedLineMeshColorDistribution;\r\n}\r\n\r\n/**\r\n * Line mesh options for GreasedLineBuilder\r\n */\r\nexport interface GreasedLineMeshBuilderOptions extends GreasedLineMeshOptions {\r\n /**\r\n * Distribution of the widths if the width table contains fewer entries than needed. Defaults to GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START\r\n * @see CompleteGreasedLineWidthTable\r\n */\r\n widthDistribution?: GreasedLineMeshWidthDistribution;\r\n}\r\n\r\n/**\r\n * Builder functions for creating GreasedLineMeshes\r\n */\r\n\r\n/**\r\n * Creates a new @see GreasedLinePluginMaterial\r\n * @param name name of the material\r\n * @param options material options @see GreasedLineMaterialOptions\r\n * @param scene scene or null to use the last scene\r\n * @returns StandardMaterial or PBRMaterial with the @see GreasedLinePluginMaterial attached to it\r\n */\r\nexport function CreateGreasedLineMaterial(name: string, options: GreasedLineMaterialOptions, scene: Nullable<Scene>) {\r\n scene = <Scene>(scene ?? EngineStore.LastCreatedScene);\r\n\r\n let material;\r\n switch (options.materialType) {\r\n case GreasedLineMeshMaterialType.MATERIAL_TYPE_PBR:\r\n material = new PBRMaterial(name, scene);\r\n new GreasedLinePluginMaterial(material, scene, options);\r\n break;\r\n case GreasedLineMeshMaterialType.MATERIAL_TYPE_SIMPLE:\r\n material = new GreasedLineSimpleMaterial(name, scene, options);\r\n break;\r\n default:\r\n material = new StandardMaterial(name, scene);\r\n new GreasedLinePluginMaterial(material, scene, options);\r\n break;\r\n }\r\n\r\n return material;\r\n}\r\n\r\n/**\r\n * Creates a GreasedLine mesh\r\n * @param name name of the mesh\r\n * @param options options for the mesh\r\n * @param materialOptions material options for the mesh\r\n * @param scene scene where the mesh will be created\r\n * @returns instance of GreasedLineMesh\r\n */\r\nexport function CreateGreasedLine(name: string, options: GreasedLineMeshBuilderOptions, materialOptions?: Nullable<GreasedLineMaterialBuilderOptions>, scene?: Nullable<Scene>) {\r\n scene = <Scene>(scene ?? EngineStore.LastCreatedScene);\r\n\r\n let instance;\r\n const allPoints = GreasedLineTools.ConvertPoints(options.points);\r\n\r\n options.widthDistribution = options.widthDistribution ?? GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START;\r\n if (options.ribbonOptions) {\r\n options.ribbonOptions.facesMode = options.ribbonOptions.facesMode ?? GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING;\r\n options.ribbonOptions.pointsMode = options.ribbonOptions.pointsMode ?? GreasedLineRibbonPointsMode.POINTS_MODE_POINTS;\r\n options.ribbonOptions.directionsAutoMode =\r\n options.ribbonOptions.directionsAutoMode ??\r\n (options.ribbonOptions.directions ? GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_NONE : GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT);\r\n }\r\n\r\n materialOptions = materialOptions ?? {\r\n color: GreasedLineMaterialDefaults.DEFAULT_COLOR,\r\n };\r\n materialOptions.createAndAssignMaterial = materialOptions.createAndAssignMaterial ?? true;\r\n materialOptions.colorDistribution = materialOptions?.colorDistribution ?? GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START;\r\n materialOptions.materialType = materialOptions.materialType ?? GreasedLineMeshMaterialType.MATERIAL_TYPE_STANDARD;\r\n\r\n const pointsCount = GetPointsCount(allPoints);\r\n const widths = CompleteGreasedLineWidthTable(pointsCount, options.widths ?? [], options.widthDistribution);\r\n\r\n const colors = materialOptions?.colors\r\n ? CompleteGreasedLineColorTable(pointsCount, materialOptions.colors, materialOptions.colorDistribution, materialOptions.color ?? GreasedLineMaterialDefaults.DEFAULT_COLOR)\r\n : undefined;\r\n\r\n // create new mesh if instance is not defined\r\n const initialGreasedLineOptions: GreasedLineMeshOptions = {\r\n points: allPoints,\r\n updatable: options.updatable,\r\n widths,\r\n lazy: options.lazy,\r\n ribbonOptions: options.ribbonOptions,\r\n uvs: options.uvs,\r\n colorPointers: options.colorPointers,\r\n };\r\n\r\n if (initialGreasedLineOptions.ribbonOptions) {\r\n if (initialGreasedLineOptions.ribbonOptions.pointsMode === GreasedLineRibbonPointsMode.POINTS_MODE_POINTS) {\r\n initialGreasedLineOptions.ribbonOptions.width = materialOptions.width ?? initialGreasedLineOptions.ribbonOptions.width ?? GreasedLineMaterialDefaults.DEFAULT_WIDTH;\r\n }\r\n }\r\n\r\n if (!options.instance) {\r\n instance = initialGreasedLineOptions.ribbonOptions\r\n ? new GreasedLineRibbonMesh(name, scene, initialGreasedLineOptions)\r\n : new GreasedLineMesh(name, scene, initialGreasedLineOptions);\r\n\r\n if (materialOptions) {\r\n const initialMaterialOptions: GreasedLineMaterialOptions = {\r\n materialType: materialOptions.materialType,\r\n dashCount: materialOptions.dashCount,\r\n dashOffset: materialOptions.dashOffset,\r\n dashRatio: materialOptions.dashRatio,\r\n resolution: materialOptions.resolution,\r\n sizeAttenuation: materialOptions.sizeAttenuation,\r\n useColors: materialOptions.useColors,\r\n useDash: materialOptions.useDash,\r\n visibility: materialOptions.visibility,\r\n width: materialOptions.width,\r\n color: materialOptions.color,\r\n colorMode: materialOptions.colorMode,\r\n colorsSampling: materialOptions.colorsSampling,\r\n colorDistributionType: materialOptions.colorDistributionType,\r\n colors,\r\n cameraFacing: !options.ribbonOptions,\r\n colorsTexture: materialOptions.colorsTexture,\r\n };\r\n\r\n if (materialOptions.createAndAssignMaterial) {\r\n const material = CreateGreasedLineMaterial(name, initialMaterialOptions, scene);\r\n instance.material = material;\r\n\r\n if (options.ribbonOptions?.facesMode === GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING) {\r\n material.backFaceCulling = false;\r\n }\r\n }\r\n }\r\n } else {\r\n // update the data on the mesh instance\r\n instance = options.instance;\r\n if (instance instanceof GreasedLineRibbonMesh) {\r\n instance.addPoints(allPoints, initialGreasedLineOptions);\r\n } else {\r\n // add widths\r\n const currentWidths = instance.widths;\r\n if (currentWidths) {\r\n const newWidths = currentWidths.slice();\r\n for (const w of widths) {\r\n newWidths.push(w);\r\n }\r\n instance.widths = newWidths;\r\n } else {\r\n instance.widths = widths;\r\n }\r\n\r\n instance.addPoints(allPoints);\r\n\r\n // add UVs\r\n if (options.uvs) {\r\n const currentUVs = instance.uvs;\r\n if (currentUVs) {\r\n const newUVs = new Float32Array(currentUVs.length + options.uvs.length);\r\n newUVs.set(currentUVs, 0);\r\n newUVs.set(options.uvs, currentUVs.length);\r\n instance.uvs = newUVs;\r\n } else {\r\n instance.uvs = options.uvs;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // add colors\r\n // it will merge if any colors already on the instance\r\n if (colors && options.instance) {\r\n if (options.instance.greasedLineMaterial) {\r\n const currentColors = options.instance.greasedLineMaterial.colors;\r\n if (currentColors) {\r\n const newColors = currentColors.concat(colors);\r\n options.instance.greasedLineMaterial.setColors(newColors, instance.isLazy());\r\n }\r\n }\r\n }\r\n\r\n return instance;\r\n}\r\n\r\n/**\r\n * Counts the number of points\r\n * @param allPoints Array of points [[x, y, z], [x, y, z], ...] or Array of points [x, y, z, x, y, z, ...]\r\n * @returns total number of points\r\n */\r\nexport function GetPointsCount(allPoints: number[][]) {\r\n let pointCount = 0;\r\n for (const points of allPoints) {\r\n pointCount += (<number[]>points).length / 3;\r\n }\r\n return pointCount;\r\n}\r\n\r\n/**\r\n * Completes the width table/fills the missing entries. It means it creates a width entry for every point of the line mesh.\r\n * You can provide more points the widths when creating the mesh. This function will fill the empty entries.\r\n * The algorithm used to fill the empty entries can be\r\n * GreasedLineMeshWidthDistribution.REPEAT - the width table will be repeatedly copied to the empty values [wL, wU] = [wL, wU, wL, wU, wL, wU, wL, wU, ...]\r\n * GreasedLineMeshWidthDistribution.EVEN - the width table will be evenly copied to the empty values [wL, wU] = [wL, wL, wL, wL, wU, wU, wU, wU]\r\n * GreasedLineMeshWidthDistribution.START - the width table will be copied at the start of the empty values\r\n * and rest will be filled width the default width upper and default width lower values [wU, wL] = [wL, wU, dwL, dwU, dwL, dwU, dwL, dwU]\r\n * GreasedLineMeshWidthDistribution.END - the width table will be copied at the end of the empty values\r\n * and rest will be filled width the default values [wL, wU] = [wL, wU, dwL, dwU, dwL, dwU, wL, wU]\r\n * @param pointCount number of points of the line mesh\r\n * @param widths array of widths [widhtLower, widthUpper, widthLower, widthUpper ...]. Two widths (lower/upper) per point.\r\n * @param widthsDistribution how to distribute widths if the widths array has fewer entries than pointCount\r\n * @param defaultWidthUpper the default value which will be used to fill empty width entries - upper width\r\n * @param defaultWidthLower the default value which will be used to fill empty width entries - lower width\r\n * @returns completed width table.\r\n */\r\nexport function CompleteGreasedLineWidthTable(\r\n pointCount: number,\r\n widths: number[],\r\n widthsDistribution: GreasedLineMeshWidthDistribution,\r\n defaultWidthUpper = 1,\r\n defaultWidthLower = 1\r\n): number[] {\r\n const missingCount = pointCount - widths.length / 2;\r\n\r\n const widthsData: number[] = [];\r\n if (missingCount < 0) {\r\n return widths.slice(0, pointCount * 2);\r\n }\r\n\r\n // is the width table shorter than the point table?\r\n if (missingCount > 0) {\r\n if (widths.length % 2 != 0) {\r\n widths.push(defaultWidthUpper);\r\n }\r\n // it is, fill in the missing elements\r\n if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START_END) {\r\n const halfCount = Math.floor(widths.length / 2);\r\n\r\n // start sector\r\n for (let i = 0, j = 0; i < halfCount - 1; i++) {\r\n widthsData.push(widths[j++]);\r\n widthsData.push(widths[j++]);\r\n }\r\n\r\n // middle sector\r\n const widthL = widths[halfCount / 2];\r\n const widthU = widths[halfCount / 2 + 1];\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(widthU);\r\n widthsData.push(widthL);\r\n }\r\n\r\n // end sector\r\n for (let i = halfCount; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START) {\r\n // start sector\r\n for (let i = 0; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(defaultWidthUpper);\r\n widthsData.push(defaultWidthLower);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_END) {\r\n // start sector\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(defaultWidthUpper);\r\n widthsData.push(defaultWidthLower);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_REPEAT) {\r\n let i = 0;\r\n for (let x = 0; x < pointCount; x++) {\r\n widthsData.push(widths[i++]);\r\n widthsData.push(widths[i++]);\r\n\r\n if (i === widths.length) {\r\n i = 0;\r\n }\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_EVEN) {\r\n let j = 0;\r\n const widthsectorLength = widths.length / ((pointCount - 1) * 2);\r\n for (let x = 0; x < pointCount; x++) {\r\n const i = Math.floor(j);\r\n\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n\r\n j += widthsectorLength;\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < widths.length; i++) {\r\n widthsData.push(widths[i]);\r\n }\r\n }\r\n\r\n return widthsData;\r\n}\r\n\r\n/**\r\n * Completes the color table/fill the missing color entries. It means it creates a color entry for every point of the line mesh.\r\n * You can provide more points the colors when creating the mesh. This function will fill the empty entries.\r\n * The algorithm used to fill the empty entries can be\r\n * GreasedLineMesColorhDistribution.REPEAT - the color table will be repeatedly copied to the empty values [c1, c2] = [c1, c2, c1, c2, c1, c2, c1, c2]\r\n * GreasedLineMesColorhDistribution.EVEN - the color table will be evenly copied to the empty values [c1, c2] = [c1, c1, c1, c1, c2, c2, c2, c2]\r\n * GreasedLineMesColorhDistribution.START - the color table will be copied at the start of the empty values\r\n * and rest will be filled color the default color value [c1, c2] = [c1, c2, dc, dc, dc, dc, dc, dc]\r\n * GreasedLineMesColorhDistribution.START_END - the color table will be copied at the start and the end of the empty values\r\n * and rest will be filled color the default color value [c1, c2] = [c1, c2, dc, dc, dc, dc, c1, c2]\r\n * @param pointCount number of points of the line mesh\r\n * @param colors array of Color3 for the color table\r\n * @param colorDistribution how to distribute colors if the colors array has fewer entries than pointCount\r\n * @param defaultColor default color to be used to fill empty entries in the color table\r\n * @returns completed array of Color3s\r\n */\r\nexport function CompleteGreasedLineColorTable(pointCount: number, colors: Color3[], colorDistribution: GreasedLineMeshColorDistribution, defaultColor: Color3): Color3[] {\r\n pointCount = Math.max(colors.length, pointCount);\r\n const missingCount = pointCount - colors.length;\r\n if (missingCount < 0) {\r\n return colors.slice(0, pointCount);\r\n }\r\n\r\n const colorsData: Color3[] = [];\r\n // is the color table shorter than the point table?\r\n if (missingCount > 0) {\r\n // it is, fill in the missing elements\r\n if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START_END) {\r\n const halfCount = Math.floor(colors.length / 2);\r\n\r\n // start sector\r\n for (let i = 0; i < halfCount; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n\r\n // middle sector\r\n for (let i = 0; i < missingCount - 1; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n\r\n // end sector\r\n for (let i = halfCount; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START) {\r\n // start sector\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < missingCount; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_END) {\r\n // start sector\r\n for (let i = 0; i < missingCount - 1; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_REPEAT) {\r\n let i = 0;\r\n for (let x = 0; x < pointCount; x++) {\r\n colorsData.push(colors[i]);\r\n\r\n i++;\r\n\r\n if (i === colors.length) {\r\n i = 0;\r\n }\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_EVEN) {\r\n let j = 0;\r\n const colorSectorLength = colors.length / (pointCount - 1);\r\n for (let x = 0; x < pointCount - 1; x++) {\r\n const i = Math.floor(j);\r\n\r\n colorsData.push(colors[i]);\r\n\r\n j += colorSectorLength;\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_NONE) {\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < pointCount; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n }\r\n\r\n return colorsData;\r\n}\r\n"]}
1
+ {"version":3,"file":"greasedLineBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/greasedLineBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAG/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAG7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AAEtG;;;GAGG;AACH,MAAM,CAAN,IAAkB,gCAyBjB;AAzBD,WAAkB,gCAAgC;IAC9C;;OAEG;IACH,6HAA2B,CAAA;IAC3B;;OAEG;IACH,iIAA6B,CAAA;IAC7B;;OAEG;IACH,6HAA2B,CAAA;IAC3B;;OAEG;IACH,+HAA4B,CAAA;IAC5B;;OAEG;IACH,2HAA0B,CAAA;IAC1B;;OAEG;IACH,uIAAgC,CAAA;AACpC,CAAC,EAzBiB,gCAAgC,KAAhC,gCAAgC,QAyBjD;AAED;;;GAGG;AACH,MAAM,CAAN,IAAkB,gCAyBjB;AAzBD,WAAkB,gCAAgC;IAC9C;;OAEG;IACH,6HAA2B,CAAA;IAC3B;;OAEG;IACH,iIAA6B,CAAA;IAC7B;;OAEG;IACH,6HAA2B,CAAA;IAC3B;;OAEG;IACH,+HAA4B,CAAA;IAC5B;;OAEG;IACH,2HAA0B,CAAA;IAC1B;;OAEG;IACH,uIAAgC,CAAA;AACpC,CAAC,E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9B;SACJ;KACJ;SAAM;QACH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE;YACjC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;SAC9B;KACJ;IAED,OAAO,UAAU,CAAC;AACtB,CAAC","sourcesContent":["import { StandardMaterial } from \"./../../Materials/standardMaterial\";\r\nimport { PBRMaterial } from \"../../Materials/PBR/pbrMaterial\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { GreasedLineMesh } from \"../GreasedLine/greasedLineMesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport type { Color3 } from \"../../Maths/math.color\";\r\nimport { GreasedLineSimpleMaterial } from \"../../Materials/GreasedLine/greasedLineSimpleMaterial\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\r\nimport type { GreasedLineMeshOptions } from \"../GreasedLine/greasedLineBaseMesh\";\r\nimport { GreasedLineRibbonAutoDirectionMode, GreasedLineRibbonFacesMode, GreasedLineRibbonPointsMode } from \"../GreasedLine/greasedLineBaseMesh\";\r\nimport { GreasedLineRibbonMesh } from \"../GreasedLine/greasedLineRibbonMesh\";\r\nimport type { GreasedLineMaterialOptions } from \"../../Materials/GreasedLine/greasedLineMaterialInterfaces\";\r\nimport { GreasedLineMeshMaterialType } from \"../../Materials/GreasedLine/greasedLineMaterialInterfaces\";\r\nimport { GreasedLinePluginMaterial } from \"../../Materials/GreasedLine/greasedLinePluginMaterial\";\r\nimport { GreasedLineMaterialDefaults } from \"../../Materials/GreasedLine/greasedLineMaterialDefaults\";\r\n\r\n/**\r\n * How are the colors distributed along the color table\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#colors-and-colordistribution}\r\n */\r\nexport const enum GreasedLineMeshColorDistribution {\r\n /**\r\n * Do no modify the color table\r\n */\r\n COLOR_DISTRIBUTION_NONE = 0,\r\n /**\r\n * Repeat the colors until the color table is full\r\n */\r\n COLOR_DISTRIBUTION_REPEAT = 1,\r\n /**\r\n * Distribute the colors evenly through the color table\r\n */\r\n COLOR_DISTRIBUTION_EVEN = 2,\r\n /**\r\n * Put the colors to start of the color table a fill the rest with the default color\r\n */\r\n COLOR_DISTRIBUTION_START = 3,\r\n /**\r\n * Put the colors to the end of the color table and fill the rest with the default color\r\n */\r\n COLOR_DISTRIBUTION_END = 4,\r\n /**\r\n * Put the colors to start and to the end of the color table and fill the gap between with the default color\r\n */\r\n COLOR_DISTRIBUTION_START_END = 5,\r\n}\r\n\r\n/**\r\n * How are the widths distributed along the width table\r\n * {@link https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param/greased_line#widths-and-widthdistribution}\r\n */\r\nexport const enum GreasedLineMeshWidthDistribution {\r\n /**\r\n * Do no modify the width table\r\n */\r\n WIDTH_DISTRIBUTION_NONE = 0,\r\n /**\r\n * Repeat the widths until the width table is full\r\n */\r\n WIDTH_DISTRIBUTION_REPEAT = 1,\r\n /**\r\n * Distribute the widths evenly through the width table\r\n */\r\n WIDTH_DISTRIBUTION_EVEN = 2,\r\n /**\r\n * Put the widths to start of the width table a fill the rest with the default width\r\n */\r\n WIDTH_DISTRIBUTION_START = 3,\r\n /**\r\n * Put the widths to the end of the width table and fill the rest with the default width\r\n */\r\n WIDTH_DISTRIBUTION_END = 4,\r\n /**\r\n * Put the widths to start and to the end of the width table and fill the gap between with the default width\r\n */\r\n WIDTH_DISTRIBUTION_START_END = 5,\r\n}\r\n\r\n/**\r\n * Material options for GreasedLineBuilder\r\n */\r\nexport interface GreasedLineMaterialBuilderOptions extends GreasedLineMaterialOptions {\r\n /**\r\n * If set to true a new material will be created and a new material plugin will be attached\r\n * to the material. The material will be set on the mesh. If the instance option is specified in the mesh options,\r\n * no material will be created/assigned. Defaults to true.\r\n */\r\n createAndAssignMaterial?: boolean;\r\n /**\r\n * Distribution of the colors if the color table contains fewer entries than needed. Defaults to GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START\r\n * @see CompleteGreasedLineColorTable\r\n */\r\n colorDistribution?: GreasedLineMeshColorDistribution;\r\n}\r\n\r\n/**\r\n * Line mesh options for GreasedLineBuilder\r\n */\r\nexport interface GreasedLineMeshBuilderOptions extends GreasedLineMeshOptions {\r\n /**\r\n * Distribution of the widths if the width table contains fewer entries than needed. Defaults to GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START\r\n * @see CompleteGreasedLineWidthTable\r\n */\r\n widthDistribution?: GreasedLineMeshWidthDistribution;\r\n}\r\n\r\n/**\r\n * Builder functions for creating GreasedLineMeshes\r\n */\r\n\r\n/**\r\n * Creates a new @see GreasedLinePluginMaterial\r\n * @param name name of the material\r\n * @param options material options @see GreasedLineMaterialOptions\r\n * @param scene scene or null to use the last scene\r\n * @returns StandardMaterial or PBRMaterial with the @see GreasedLinePluginMaterial attached to it\r\n */\r\nexport function CreateGreasedLineMaterial(name: string, options: GreasedLineMaterialOptions, scene: Nullable<Scene>) {\r\n scene = <Scene>(scene ?? EngineStore.LastCreatedScene);\r\n\r\n let material;\r\n switch (options.materialType) {\r\n case GreasedLineMeshMaterialType.MATERIAL_TYPE_PBR:\r\n material = new PBRMaterial(name, scene, true); // Forcing glsl for now\r\n new GreasedLinePluginMaterial(material, scene, options);\r\n break;\r\n case GreasedLineMeshMaterialType.MATERIAL_TYPE_SIMPLE:\r\n material = new GreasedLineSimpleMaterial(name, scene, options);\r\n break;\r\n default:\r\n material = new StandardMaterial(name, scene, true); // Forcing glsl for now\r\n new GreasedLinePluginMaterial(material, scene, options);\r\n break;\r\n }\r\n\r\n return material;\r\n}\r\n\r\n/**\r\n * Creates a GreasedLine mesh\r\n * @param name name of the mesh\r\n * @param options options for the mesh\r\n * @param materialOptions material options for the mesh\r\n * @param scene scene where the mesh will be created\r\n * @returns instance of GreasedLineMesh\r\n */\r\nexport function CreateGreasedLine(name: string, options: GreasedLineMeshBuilderOptions, materialOptions?: Nullable<GreasedLineMaterialBuilderOptions>, scene?: Nullable<Scene>) {\r\n scene = <Scene>(scene ?? EngineStore.LastCreatedScene);\r\n\r\n let instance;\r\n const allPoints = GreasedLineTools.ConvertPoints(options.points);\r\n\r\n options.widthDistribution = options.widthDistribution ?? GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START;\r\n if (options.ribbonOptions) {\r\n options.ribbonOptions.facesMode = options.ribbonOptions.facesMode ?? GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING;\r\n options.ribbonOptions.pointsMode = options.ribbonOptions.pointsMode ?? GreasedLineRibbonPointsMode.POINTS_MODE_POINTS;\r\n options.ribbonOptions.directionsAutoMode =\r\n options.ribbonOptions.directionsAutoMode ??\r\n (options.ribbonOptions.directions ? GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_NONE : GreasedLineRibbonAutoDirectionMode.AUTO_DIRECTIONS_FROM_FIRST_SEGMENT);\r\n }\r\n\r\n materialOptions = materialOptions ?? {\r\n color: GreasedLineMaterialDefaults.DEFAULT_COLOR,\r\n };\r\n materialOptions.createAndAssignMaterial = materialOptions.createAndAssignMaterial ?? true;\r\n materialOptions.colorDistribution = materialOptions?.colorDistribution ?? GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START;\r\n materialOptions.materialType = materialOptions.materialType ?? GreasedLineMeshMaterialType.MATERIAL_TYPE_STANDARD;\r\n\r\n const pointsCount = GetPointsCount(allPoints);\r\n const widths = CompleteGreasedLineWidthTable(pointsCount, options.widths ?? [], options.widthDistribution);\r\n\r\n const colors = materialOptions?.colors\r\n ? CompleteGreasedLineColorTable(pointsCount, materialOptions.colors, materialOptions.colorDistribution, materialOptions.color ?? GreasedLineMaterialDefaults.DEFAULT_COLOR)\r\n : undefined;\r\n\r\n // create new mesh if instance is not defined\r\n const initialGreasedLineOptions: GreasedLineMeshOptions = {\r\n points: allPoints,\r\n updatable: options.updatable,\r\n widths,\r\n lazy: options.lazy,\r\n ribbonOptions: options.ribbonOptions,\r\n uvs: options.uvs,\r\n colorPointers: options.colorPointers,\r\n };\r\n\r\n if (initialGreasedLineOptions.ribbonOptions) {\r\n if (initialGreasedLineOptions.ribbonOptions.pointsMode === GreasedLineRibbonPointsMode.POINTS_MODE_POINTS) {\r\n initialGreasedLineOptions.ribbonOptions.width = materialOptions.width ?? initialGreasedLineOptions.ribbonOptions.width ?? GreasedLineMaterialDefaults.DEFAULT_WIDTH;\r\n }\r\n }\r\n\r\n if (!options.instance) {\r\n instance = initialGreasedLineOptions.ribbonOptions\r\n ? new GreasedLineRibbonMesh(name, scene, initialGreasedLineOptions)\r\n : new GreasedLineMesh(name, scene, initialGreasedLineOptions);\r\n\r\n if (materialOptions) {\r\n const initialMaterialOptions: GreasedLineMaterialOptions = {\r\n materialType: materialOptions.materialType,\r\n dashCount: materialOptions.dashCount,\r\n dashOffset: materialOptions.dashOffset,\r\n dashRatio: materialOptions.dashRatio,\r\n resolution: materialOptions.resolution,\r\n sizeAttenuation: materialOptions.sizeAttenuation,\r\n useColors: materialOptions.useColors,\r\n useDash: materialOptions.useDash,\r\n visibility: materialOptions.visibility,\r\n width: materialOptions.width,\r\n color: materialOptions.color,\r\n colorMode: materialOptions.colorMode,\r\n colorsSampling: materialOptions.colorsSampling,\r\n colorDistributionType: materialOptions.colorDistributionType,\r\n colors,\r\n cameraFacing: !options.ribbonOptions,\r\n colorsTexture: materialOptions.colorsTexture,\r\n };\r\n\r\n if (materialOptions.createAndAssignMaterial) {\r\n const material = CreateGreasedLineMaterial(name, initialMaterialOptions, scene);\r\n instance.material = material;\r\n\r\n if (options.ribbonOptions?.facesMode === GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING) {\r\n material.backFaceCulling = false;\r\n }\r\n }\r\n }\r\n } else {\r\n // update the data on the mesh instance\r\n instance = options.instance;\r\n if (instance instanceof GreasedLineRibbonMesh) {\r\n instance.addPoints(allPoints, initialGreasedLineOptions);\r\n } else {\r\n // add widths\r\n const currentWidths = instance.widths;\r\n if (currentWidths) {\r\n const newWidths = currentWidths.slice();\r\n for (const w of widths) {\r\n newWidths.push(w);\r\n }\r\n instance.widths = newWidths;\r\n } else {\r\n instance.widths = widths;\r\n }\r\n\r\n instance.addPoints(allPoints);\r\n\r\n // add UVs\r\n if (options.uvs) {\r\n const currentUVs = instance.uvs;\r\n if (currentUVs) {\r\n const newUVs = new Float32Array(currentUVs.length + options.uvs.length);\r\n newUVs.set(currentUVs, 0);\r\n newUVs.set(options.uvs, currentUVs.length);\r\n instance.uvs = newUVs;\r\n } else {\r\n instance.uvs = options.uvs;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // add colors\r\n // it will merge if any colors already on the instance\r\n if (colors && options.instance) {\r\n if (options.instance.greasedLineMaterial) {\r\n const currentColors = options.instance.greasedLineMaterial.colors;\r\n if (currentColors) {\r\n const newColors = currentColors.concat(colors);\r\n options.instance.greasedLineMaterial.setColors(newColors, instance.isLazy());\r\n }\r\n }\r\n }\r\n\r\n return instance;\r\n}\r\n\r\n/**\r\n * Counts the number of points\r\n * @param allPoints Array of points [[x, y, z], [x, y, z], ...] or Array of points [x, y, z, x, y, z, ...]\r\n * @returns total number of points\r\n */\r\nexport function GetPointsCount(allPoints: number[][]) {\r\n let pointCount = 0;\r\n for (const points of allPoints) {\r\n pointCount += (<number[]>points).length / 3;\r\n }\r\n return pointCount;\r\n}\r\n\r\n/**\r\n * Completes the width table/fills the missing entries. It means it creates a width entry for every point of the line mesh.\r\n * You can provide more points the widths when creating the mesh. This function will fill the empty entries.\r\n * The algorithm used to fill the empty entries can be\r\n * GreasedLineMeshWidthDistribution.REPEAT - the width table will be repeatedly copied to the empty values [wL, wU] = [wL, wU, wL, wU, wL, wU, wL, wU, ...]\r\n * GreasedLineMeshWidthDistribution.EVEN - the width table will be evenly copied to the empty values [wL, wU] = [wL, wL, wL, wL, wU, wU, wU, wU]\r\n * GreasedLineMeshWidthDistribution.START - the width table will be copied at the start of the empty values\r\n * and rest will be filled width the default width upper and default width lower values [wU, wL] = [wL, wU, dwL, dwU, dwL, dwU, dwL, dwU]\r\n * GreasedLineMeshWidthDistribution.END - the width table will be copied at the end of the empty values\r\n * and rest will be filled width the default values [wL, wU] = [wL, wU, dwL, dwU, dwL, dwU, wL, wU]\r\n * @param pointCount number of points of the line mesh\r\n * @param widths array of widths [widhtLower, widthUpper, widthLower, widthUpper ...]. Two widths (lower/upper) per point.\r\n * @param widthsDistribution how to distribute widths if the widths array has fewer entries than pointCount\r\n * @param defaultWidthUpper the default value which will be used to fill empty width entries - upper width\r\n * @param defaultWidthLower the default value which will be used to fill empty width entries - lower width\r\n * @returns completed width table.\r\n */\r\nexport function CompleteGreasedLineWidthTable(\r\n pointCount: number,\r\n widths: number[],\r\n widthsDistribution: GreasedLineMeshWidthDistribution,\r\n defaultWidthUpper = 1,\r\n defaultWidthLower = 1\r\n): number[] {\r\n const missingCount = pointCount - widths.length / 2;\r\n\r\n const widthsData: number[] = [];\r\n if (missingCount < 0) {\r\n return widths.slice(0, pointCount * 2);\r\n }\r\n\r\n // is the width table shorter than the point table?\r\n if (missingCount > 0) {\r\n if (widths.length % 2 != 0) {\r\n widths.push(defaultWidthUpper);\r\n }\r\n // it is, fill in the missing elements\r\n if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START_END) {\r\n const halfCount = Math.floor(widths.length / 2);\r\n\r\n // start sector\r\n for (let i = 0, j = 0; i < halfCount - 1; i++) {\r\n widthsData.push(widths[j++]);\r\n widthsData.push(widths[j++]);\r\n }\r\n\r\n // middle sector\r\n const widthL = widths[halfCount / 2];\r\n const widthU = widths[halfCount / 2 + 1];\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(widthU);\r\n widthsData.push(widthL);\r\n }\r\n\r\n // end sector\r\n for (let i = halfCount; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_START) {\r\n // start sector\r\n for (let i = 0; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(defaultWidthUpper);\r\n widthsData.push(defaultWidthLower);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_END) {\r\n // start sector\r\n for (let i = 0; i < missingCount; i++) {\r\n widthsData.push(defaultWidthUpper);\r\n widthsData.push(defaultWidthLower);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < widths.length; i += 2) {\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_REPEAT) {\r\n let i = 0;\r\n for (let x = 0; x < pointCount; x++) {\r\n widthsData.push(widths[i++]);\r\n widthsData.push(widths[i++]);\r\n\r\n if (i === widths.length) {\r\n i = 0;\r\n }\r\n }\r\n } else if (widthsDistribution === GreasedLineMeshWidthDistribution.WIDTH_DISTRIBUTION_EVEN) {\r\n let j = 0;\r\n const widthsectorLength = widths.length / ((pointCount - 1) * 2);\r\n for (let x = 0; x < pointCount; x++) {\r\n const i = Math.floor(j);\r\n\r\n widthsData.push(widths[i]);\r\n widthsData.push(widths[i + 1]);\r\n\r\n j += widthsectorLength;\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < widths.length; i++) {\r\n widthsData.push(widths[i]);\r\n }\r\n }\r\n\r\n return widthsData;\r\n}\r\n\r\n/**\r\n * Completes the color table/fill the missing color entries. It means it creates a color entry for every point of the line mesh.\r\n * You can provide more points the colors when creating the mesh. This function will fill the empty entries.\r\n * The algorithm used to fill the empty entries can be\r\n * GreasedLineMesColorhDistribution.REPEAT - the color table will be repeatedly copied to the empty values [c1, c2] = [c1, c2, c1, c2, c1, c2, c1, c2]\r\n * GreasedLineMesColorhDistribution.EVEN - the color table will be evenly copied to the empty values [c1, c2] = [c1, c1, c1, c1, c2, c2, c2, c2]\r\n * GreasedLineMesColorhDistribution.START - the color table will be copied at the start of the empty values\r\n * and rest will be filled color the default color value [c1, c2] = [c1, c2, dc, dc, dc, dc, dc, dc]\r\n * GreasedLineMesColorhDistribution.START_END - the color table will be copied at the start and the end of the empty values\r\n * and rest will be filled color the default color value [c1, c2] = [c1, c2, dc, dc, dc, dc, c1, c2]\r\n * @param pointCount number of points of the line mesh\r\n * @param colors array of Color3 for the color table\r\n * @param colorDistribution how to distribute colors if the colors array has fewer entries than pointCount\r\n * @param defaultColor default color to be used to fill empty entries in the color table\r\n * @returns completed array of Color3s\r\n */\r\nexport function CompleteGreasedLineColorTable(pointCount: number, colors: Color3[], colorDistribution: GreasedLineMeshColorDistribution, defaultColor: Color3): Color3[] {\r\n pointCount = Math.max(colors.length, pointCount);\r\n const missingCount = pointCount - colors.length;\r\n if (missingCount < 0) {\r\n return colors.slice(0, pointCount);\r\n }\r\n\r\n const colorsData: Color3[] = [];\r\n // is the color table shorter than the point table?\r\n if (missingCount > 0) {\r\n // it is, fill in the missing elements\r\n if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START_END) {\r\n const halfCount = Math.floor(colors.length / 2);\r\n\r\n // start sector\r\n for (let i = 0; i < halfCount; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n\r\n // middle sector\r\n for (let i = 0; i < missingCount - 1; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n\r\n // end sector\r\n for (let i = halfCount; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_START) {\r\n // start sector\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < missingCount; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_END) {\r\n // start sector\r\n for (let i = 0; i < missingCount - 1; i++) {\r\n colorsData.push(defaultColor);\r\n }\r\n\r\n // end sector\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_REPEAT) {\r\n let i = 0;\r\n for (let x = 0; x < pointCount; x++) {\r\n colorsData.push(colors[i]);\r\n\r\n i++;\r\n\r\n if (i === colors.length) {\r\n i = 0;\r\n }\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_EVEN) {\r\n let j = 0;\r\n const colorSectorLength = colors.length / (pointCount - 1);\r\n for (let x = 0; x < pointCount - 1; x++) {\r\n const i = Math.floor(j);\r\n\r\n colorsData.push(colors[i]);\r\n\r\n j += colorSectorLength;\r\n }\r\n } else if (colorDistribution === GreasedLineMeshColorDistribution.COLOR_DISTRIBUTION_NONE) {\r\n for (let i = 0; i < colors.length; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < pointCount; i++) {\r\n colorsData.push(colors[i]);\r\n }\r\n }\r\n\r\n return colorsData;\r\n}\r\n"]}
@@ -145,6 +145,7 @@ export function CreateLineSystem(name, options, scene = null) {
145
145
  if (colors && vertexColor) {
146
146
  instance.updateVerticesData(VertexBuffer.ColorKind, vertexColor, false, false);
147
147
  }
148
+ instance.refreshBoundingInfo();
148
149
  return instance;
149
150
  }
150
151
  // line system creation
@@ -1 +1 @@
1
- {"version":3,"file":"linesBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/linesBuilder.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAA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,QAAyB,IAAI,EAAE,YAAqB,KAAK,EAAE,WAAgC,IAAI,EAAa,EAAE;IAC/J,MAAM,OAAO,GAAG;QACZ,MAAM;QACN,SAAS;QACT,QAAQ;KACX,CAAC;IACF,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,IAAI,CAAC,iBAAiB,GAAG,CACrB,IAAY,EACZ,MAAiB,EACjB,QAAgB,EAChB,OAAe,EACf,MAAc,EACd,QAAyB,IAAI,EAC7B,SAAmB,EACnB,QAAoB,EACX,EAAE;IACX,MAAM,OAAO,GAAG;QACZ,MAAM;QACN,QAAQ;QACR,OAAO;QACP,MAAM;QACN,SAAS;QACT,QAAQ;KACX,CAAC;IACF,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport type { Color4 } from \"../../Maths/math.color\";\r\nimport { _CreationDataStorage, Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { FloatArray, Nullable } from \"../../types\";\r\nimport { LinesMesh } from \"../../Meshes/linesMesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer\";\r\nimport { Logger } from \"../../Misc/logger\";\r\n\r\nimport type { Material } from \"../../Materials/material\";\r\n\r\n/**\r\n * Creates the VertexData of the LineSystem\r\n * @param options an object used to set the following optional parameters for the LineSystem, required but can be empty\r\n * - lines an array of lines, each line being an array of successive Vector3\r\n * - colors an array of line colors, each of the line colors being an array of successive Color4, one per line point\r\n * @returns the VertexData of the LineSystem\r\n */\r\nexport function CreateLineSystemVertexData(options: { lines: Vector3[][]; colors?: Nullable<Color4[][]> }): VertexData {\r\n const indices = [];\r\n const positions = [];\r\n const lines = options.lines;\r\n const colors = options.colors;\r\n const vertexColors = [];\r\n let idx = 0;\r\n\r\n for (let l = 0; l < lines.length; l++) {\r\n const points = lines[l];\r\n for (let index = 0; index < points.length; index++) {\r\n const { x, y, z } = points[index];\r\n positions.push(x, y, z);\r\n if (colors) {\r\n const color = colors[l];\r\n const { r, g, b, a } = color[index];\r\n vertexColors.push(r, g, b, a);\r\n }\r\n if (index > 0) {\r\n indices.push(idx - 1);\r\n indices.push(idx);\r\n }\r\n idx++;\r\n }\r\n }\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n if (colors) {\r\n vertexData.colors = vertexColors;\r\n }\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Create the VertexData for a DashedLines\r\n * @param options an object used to set the following optional parameters for the DashedLines, required but can be empty\r\n * - points an array successive Vector3\r\n * - dashSize the size of the dashes relative to the dash number, optional, default 3\r\n * - gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1\r\n * - dashNb the intended total number of dashes, optional, default 200\r\n * @returns the VertexData for the DashedLines\r\n */\r\nexport function CreateDashedLinesVertexData(options: { points: Vector3[]; dashSize?: number; gapSize?: number; dashNb?: number }): VertexData {\r\n const dashSize = options.dashSize || 3;\r\n const gapSize = options.gapSize || 1;\r\n const dashNb = options.dashNb || 200;\r\n const points = options.points;\r\n\r\n const positions: number[] = [];\r\n const indices: number[] = [];\r\n\r\n const curvect = Vector3.Zero();\r\n let lg = 0;\r\n let nb = 0;\r\n let shft = 0;\r\n let dashshft = 0;\r\n let curshft = 0;\r\n let idx = 0;\r\n let i = 0;\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n lg += curvect.length();\r\n }\r\n shft = lg / dashNb;\r\n dashshft = (dashSize * shft) / (dashSize + gapSize);\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n nb = Math.floor(curvect.length() / shft);\r\n curvect.normalize();\r\n for (let j = 0; j < nb; j++) {\r\n curshft = shft * j;\r\n positions.push(points[i].x + curshft * curvect.x, points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z);\r\n positions.push(points[i].x + (curshft + dashshft) * curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z);\r\n indices.push(idx, idx + 1);\r\n idx += 2;\r\n }\r\n }\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.positions = positions;\r\n vertexData.indices = indices;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a line system mesh. A line system is a pool of many lines gathered in a single mesh\r\n * * A line system mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of lines as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineSystem to this static function\r\n * * The parameter `lines` is an array of lines, each line being an array of successive Vector3\r\n * * The optional parameter `instance` is an instance of an existing LineSystem object to be updated with the passed `lines` parameter\r\n * * The optional parameter `colors` is an array of line colors, each line colors being an array of successive Color4, one per line point\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need the alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * Updating a simple Line mesh, you just need to update every line in the `lines` array : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#line-system\r\n * @param name defines the name of the new line system\r\n * @param options defines the options used to create the line system\r\n * @param scene defines the hosting scene\r\n * @returns a new line system mesh\r\n */\r\nexport function CreateLineSystem(\r\n name: string,\r\n options: { lines: Vector3[][]; updatable?: boolean; instance?: Nullable<LinesMesh>; colors?: Nullable<Color4[][]>; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const instance = options.instance;\r\n const lines = options.lines;\r\n const colors = options.colors;\r\n\r\n if (instance) {\r\n // lines update\r\n const positions = instance.getVerticesData(VertexBuffer.PositionKind)!;\r\n let vertexColor;\r\n let lineColors;\r\n if (colors) {\r\n vertexColor = instance.getVerticesData(VertexBuffer.ColorKind)!;\r\n }\r\n let i = 0;\r\n let c = 0;\r\n for (let l = 0; l < lines.length; l++) {\r\n const points = lines[l];\r\n for (let p = 0; p < points.length; p++) {\r\n positions[i] = points[p].x;\r\n positions[i + 1] = points[p].y;\r\n positions[i + 2] = points[p].z;\r\n if (colors && vertexColor) {\r\n lineColors = colors[l];\r\n vertexColor[c] = lineColors[p].r;\r\n vertexColor[c + 1] = lineColors[p].g;\r\n vertexColor[c + 2] = lineColors[p].b;\r\n vertexColor[c + 3] = lineColors[p].a;\r\n c += 4;\r\n }\r\n i += 3;\r\n }\r\n }\r\n instance.updateVerticesData(VertexBuffer.PositionKind, positions, false, false);\r\n if (colors && vertexColor) {\r\n instance.updateVerticesData(VertexBuffer.ColorKind, vertexColor, false, false);\r\n }\r\n return instance;\r\n }\r\n\r\n // line system creation\r\n const useVertexColor = colors ? true : false;\r\n const lineSystem = new LinesMesh(name, scene, null, undefined, undefined, useVertexColor, options.useVertexAlpha, options.material);\r\n const vertexData = CreateLineSystemVertexData(options);\r\n vertexData.applyToMesh(lineSystem, options.updatable);\r\n return lineSystem;\r\n}\r\n\r\n/**\r\n * Creates a line mesh\r\n * A line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function\r\n * * The parameter `points` is an array successive Vector3\r\n * * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * The optional parameter `colors` is an array of successive Color4, one per line point\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * When updating an instance, remember that only point positions can change, not the number of points\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lines\r\n * @param name defines the name of the new line system\r\n * @param options defines the options used to create the line system\r\n * @param scene defines the hosting scene\r\n * @returns a new line mesh\r\n */\r\nexport function CreateLines(\r\n name: string,\r\n options: { points: Vector3[]; updatable?: boolean; instance?: Nullable<LinesMesh>; colors?: Color4[]; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const colors = options.colors ? [options.colors] : null;\r\n const lines = CreateLineSystem(\r\n name,\r\n { lines: [options.points], updatable: options.updatable, instance: options.instance, colors: colors, useVertexAlpha: options.useVertexAlpha, material: options.material },\r\n scene\r\n );\r\n return lines;\r\n}\r\n\r\n/**\r\n * Creates a dashed line mesh\r\n * * A dashed line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function\r\n * * The parameter `points` is an array successive Vector3\r\n * * The parameter `dashNb` is the intended total number of dashes (positive integer, default 200)\r\n * * The parameter `dashSize` is the size of the dashes relatively the dash number (positive float, default 3)\r\n * * The parameter `gapSize` is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)\r\n * * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need the alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * When updating an instance, remember that only point positions can change, not the number of points\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @returns the dashed line mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#dashed-lines\r\n */\r\nexport function CreateDashedLines(\r\n name: string,\r\n options: { points: Vector3[]; dashSize?: number; gapSize?: number; dashNb?: number; updatable?: boolean; instance?: LinesMesh; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const points = options.points;\r\n const instance = options.instance;\r\n const gapSize = options.gapSize || 1;\r\n const dashSize = options.dashSize || 3;\r\n\r\n if (instance) {\r\n // dashed lines update\r\n const positionFunction = (positions: FloatArray): void => {\r\n const curvect = Vector3.Zero();\r\n const nbSeg = positions.length / 6;\r\n let lg = 0;\r\n let nb = 0;\r\n let shft = 0;\r\n let dashshft = 0;\r\n let curshft = 0;\r\n let p = 0;\r\n let i = 0;\r\n let j = 0;\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n lg += curvect.length();\r\n }\r\n shft = lg / nbSeg;\r\n const dashSize = instance!._creationDataStorage!.dashSize;\r\n const gapSize = instance!._creationDataStorage!.gapSize;\r\n dashshft = (dashSize * shft) / (dashSize + gapSize);\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n nb = Math.floor(curvect.length() / shft);\r\n curvect.normalize();\r\n j = 0;\r\n while (j < nb && p < positions.length) {\r\n curshft = shft * j;\r\n positions[p] = points[i].x + curshft * curvect.x;\r\n positions[p + 1] = points[i].y + curshft * curvect.y;\r\n positions[p + 2] = points[i].z + curshft * curvect.z;\r\n positions[p + 3] = points[i].x + (curshft + dashshft) * curvect.x;\r\n positions[p + 4] = points[i].y + (curshft + dashshft) * curvect.y;\r\n positions[p + 5] = points[i].z + (curshft + dashshft) * curvect.z;\r\n p += 6;\r\n j++;\r\n }\r\n }\r\n while (p < positions.length) {\r\n positions[p] = points[i].x;\r\n positions[p + 1] = points[i].y;\r\n positions[p + 2] = points[i].z;\r\n p += 3;\r\n }\r\n };\r\n if (options.dashNb || options.dashSize || options.gapSize || options.useVertexAlpha || options.material) {\r\n Logger.Warn(\"You have used an option other than points with the instance option. Please be aware that these other options will be ignored.\");\r\n }\r\n instance.updateMeshPositions(positionFunction, false);\r\n return instance;\r\n }\r\n // dashed lines creation\r\n const dashedLines = new LinesMesh(name, scene, null, undefined, undefined, undefined, options.useVertexAlpha, options.material);\r\n const vertexData = CreateDashedLinesVertexData(options);\r\n vertexData.applyToMesh(dashedLines, options.updatable);\r\n\r\n dashedLines._creationDataStorage = new _CreationDataStorage();\r\n dashedLines._creationDataStorage.dashSize = dashSize;\r\n dashedLines._creationDataStorage.gapSize = gapSize;\r\n return dashedLines;\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the functions directly from the module\r\n */\r\nexport const LinesBuilder = {\r\n CreateDashedLines,\r\n CreateLineSystem,\r\n CreateLines,\r\n};\r\n\r\nVertexData.CreateLineSystem = CreateLineSystemVertexData;\r\nVertexData.CreateDashedLines = CreateDashedLinesVertexData;\r\n\r\nMesh.CreateLines = (name: string, points: Vector3[], scene: Nullable<Scene> = null, updatable: boolean = false, instance: Nullable<LinesMesh> = null): LinesMesh => {\r\n const options = {\r\n points,\r\n updatable,\r\n instance,\r\n };\r\n return CreateLines(name, options, scene);\r\n};\r\n\r\nMesh.CreateDashedLines = (\r\n name: string,\r\n points: Vector3[],\r\n dashSize: number,\r\n gapSize: number,\r\n dashNb: number,\r\n scene: Nullable<Scene> = null,\r\n updatable?: boolean,\r\n instance?: LinesMesh\r\n): LinesMesh => {\r\n const options = {\r\n points,\r\n dashSize,\r\n gapSize,\r\n dashNb,\r\n updatable,\r\n instance,\r\n };\r\n return CreateDashedLines(name, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"linesBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Mesh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AAY,GAAG;IACxB,iBAAiB;IACjB,gBAAgB;IAChB,WAAW;CACd,CAAC;AAEF,UAAU,CAAC,gBAAgB,GAAG,0BAA0B,CAAC;AACzD,UAAU,CAAC,iBAAiB,GAAG,2BAA2B,CAAC;AAE3D,IAAI,CAAC,WAAW,GAAG,CAAC,IAAY,EAAE,MAAiB,EAAE,QAAyB,IAAI,EAAE,YAAqB,KAAK,EAAE,WAAgC,IAAI,EAAa,EAAE;IAC/J,MAAM,OAAO,GAAG;QACZ,MAAM;QACN,SAAS;QACT,QAAQ;KACX,CAAC;IACF,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,IAAI,CAAC,iBAAiB,GAAG,CACrB,IAAY,EACZ,MAAiB,EACjB,QAAgB,EAChB,OAAe,EACf,MAAc,EACd,QAAyB,IAAI,EAC7B,SAAmB,EACnB,QAAoB,EACX,EAAE;IACX,MAAM,OAAO,GAAG;QACZ,MAAM;QACN,QAAQ;QACR,OAAO;QACP,MAAM;QACN,SAAS;QACT,QAAQ;KACX,CAAC;IACF,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport type { Color4 } from \"../../Maths/math.color\";\r\nimport { _CreationDataStorage, Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { FloatArray, Nullable } from \"../../types\";\r\nimport { LinesMesh } from \"../../Meshes/linesMesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer\";\r\nimport { Logger } from \"../../Misc/logger\";\r\n\r\nimport type { Material } from \"../../Materials/material\";\r\n\r\n/**\r\n * Creates the VertexData of the LineSystem\r\n * @param options an object used to set the following optional parameters for the LineSystem, required but can be empty\r\n * - lines an array of lines, each line being an array of successive Vector3\r\n * - colors an array of line colors, each of the line colors being an array of successive Color4, one per line point\r\n * @returns the VertexData of the LineSystem\r\n */\r\nexport function CreateLineSystemVertexData(options: { lines: Vector3[][]; colors?: Nullable<Color4[][]> }): VertexData {\r\n const indices = [];\r\n const positions = [];\r\n const lines = options.lines;\r\n const colors = options.colors;\r\n const vertexColors = [];\r\n let idx = 0;\r\n\r\n for (let l = 0; l < lines.length; l++) {\r\n const points = lines[l];\r\n for (let index = 0; index < points.length; index++) {\r\n const { x, y, z } = points[index];\r\n positions.push(x, y, z);\r\n if (colors) {\r\n const color = colors[l];\r\n const { r, g, b, a } = color[index];\r\n vertexColors.push(r, g, b, a);\r\n }\r\n if (index > 0) {\r\n indices.push(idx - 1);\r\n indices.push(idx);\r\n }\r\n idx++;\r\n }\r\n }\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n if (colors) {\r\n vertexData.colors = vertexColors;\r\n }\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Create the VertexData for a DashedLines\r\n * @param options an object used to set the following optional parameters for the DashedLines, required but can be empty\r\n * - points an array successive Vector3\r\n * - dashSize the size of the dashes relative to the dash number, optional, default 3\r\n * - gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1\r\n * - dashNb the intended total number of dashes, optional, default 200\r\n * @returns the VertexData for the DashedLines\r\n */\r\nexport function CreateDashedLinesVertexData(options: { points: Vector3[]; dashSize?: number; gapSize?: number; dashNb?: number }): VertexData {\r\n const dashSize = options.dashSize || 3;\r\n const gapSize = options.gapSize || 1;\r\n const dashNb = options.dashNb || 200;\r\n const points = options.points;\r\n\r\n const positions: number[] = [];\r\n const indices: number[] = [];\r\n\r\n const curvect = Vector3.Zero();\r\n let lg = 0;\r\n let nb = 0;\r\n let shft = 0;\r\n let dashshft = 0;\r\n let curshft = 0;\r\n let idx = 0;\r\n let i = 0;\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n lg += curvect.length();\r\n }\r\n shft = lg / dashNb;\r\n dashshft = (dashSize * shft) / (dashSize + gapSize);\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n nb = Math.floor(curvect.length() / shft);\r\n curvect.normalize();\r\n for (let j = 0; j < nb; j++) {\r\n curshft = shft * j;\r\n positions.push(points[i].x + curshft * curvect.x, points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z);\r\n positions.push(points[i].x + (curshft + dashshft) * curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z);\r\n indices.push(idx, idx + 1);\r\n idx += 2;\r\n }\r\n }\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.positions = positions;\r\n vertexData.indices = indices;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a line system mesh. A line system is a pool of many lines gathered in a single mesh\r\n * * A line system mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of lines as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineSystem to this static function\r\n * * The parameter `lines` is an array of lines, each line being an array of successive Vector3\r\n * * The optional parameter `instance` is an instance of an existing LineSystem object to be updated with the passed `lines` parameter\r\n * * The optional parameter `colors` is an array of line colors, each line colors being an array of successive Color4, one per line point\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need the alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * Updating a simple Line mesh, you just need to update every line in the `lines` array : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#line-system\r\n * @param name defines the name of the new line system\r\n * @param options defines the options used to create the line system\r\n * @param scene defines the hosting scene\r\n * @returns a new line system mesh\r\n */\r\nexport function CreateLineSystem(\r\n name: string,\r\n options: { lines: Vector3[][]; updatable?: boolean; instance?: Nullable<LinesMesh>; colors?: Nullable<Color4[][]>; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const instance = options.instance;\r\n const lines = options.lines;\r\n const colors = options.colors;\r\n\r\n if (instance) {\r\n // lines update\r\n const positions = instance.getVerticesData(VertexBuffer.PositionKind)!;\r\n let vertexColor;\r\n let lineColors;\r\n if (colors) {\r\n vertexColor = instance.getVerticesData(VertexBuffer.ColorKind)!;\r\n }\r\n let i = 0;\r\n let c = 0;\r\n for (let l = 0; l < lines.length; l++) {\r\n const points = lines[l];\r\n for (let p = 0; p < points.length; p++) {\r\n positions[i] = points[p].x;\r\n positions[i + 1] = points[p].y;\r\n positions[i + 2] = points[p].z;\r\n if (colors && vertexColor) {\r\n lineColors = colors[l];\r\n vertexColor[c] = lineColors[p].r;\r\n vertexColor[c + 1] = lineColors[p].g;\r\n vertexColor[c + 2] = lineColors[p].b;\r\n vertexColor[c + 3] = lineColors[p].a;\r\n c += 4;\r\n }\r\n i += 3;\r\n }\r\n }\r\n instance.updateVerticesData(VertexBuffer.PositionKind, positions, false, false);\r\n if (colors && vertexColor) {\r\n instance.updateVerticesData(VertexBuffer.ColorKind, vertexColor, false, false);\r\n }\r\n instance.refreshBoundingInfo();\r\n return instance;\r\n }\r\n\r\n // line system creation\r\n const useVertexColor = colors ? true : false;\r\n const lineSystem = new LinesMesh(name, scene, null, undefined, undefined, useVertexColor, options.useVertexAlpha, options.material);\r\n const vertexData = CreateLineSystemVertexData(options);\r\n vertexData.applyToMesh(lineSystem, options.updatable);\r\n return lineSystem;\r\n}\r\n\r\n/**\r\n * Creates a line mesh\r\n * A line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function\r\n * * The parameter `points` is an array successive Vector3\r\n * * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * The optional parameter `colors` is an array of successive Color4, one per line point\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * When updating an instance, remember that only point positions can change, not the number of points\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lines\r\n * @param name defines the name of the new line system\r\n * @param options defines the options used to create the line system\r\n * @param scene defines the hosting scene\r\n * @returns a new line mesh\r\n */\r\nexport function CreateLines(\r\n name: string,\r\n options: { points: Vector3[]; updatable?: boolean; instance?: Nullable<LinesMesh>; colors?: Color4[]; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const colors = options.colors ? [options.colors] : null;\r\n const lines = CreateLineSystem(\r\n name,\r\n { lines: [options.points], updatable: options.updatable, instance: options.instance, colors: colors, useVertexAlpha: options.useVertexAlpha, material: options.material },\r\n scene\r\n );\r\n return lines;\r\n}\r\n\r\n/**\r\n * Creates a dashed line mesh\r\n * * A dashed line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function\r\n * * The parameter `points` is an array successive Vector3\r\n * * The parameter `dashNb` is the intended total number of dashes (positive integer, default 200)\r\n * * The parameter `dashSize` is the size of the dashes relatively the dash number (positive float, default 3)\r\n * * The parameter `gapSize` is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)\r\n * * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need the alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * When updating an instance, remember that only point positions can change, not the number of points\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @returns the dashed line mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#dashed-lines\r\n */\r\nexport function CreateDashedLines(\r\n name: string,\r\n options: { points: Vector3[]; dashSize?: number; gapSize?: number; dashNb?: number; updatable?: boolean; instance?: LinesMesh; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const points = options.points;\r\n const instance = options.instance;\r\n const gapSize = options.gapSize || 1;\r\n const dashSize = options.dashSize || 3;\r\n\r\n if (instance) {\r\n // dashed lines update\r\n const positionFunction = (positions: FloatArray): void => {\r\n const curvect = Vector3.Zero();\r\n const nbSeg = positions.length / 6;\r\n let lg = 0;\r\n let nb = 0;\r\n let shft = 0;\r\n let dashshft = 0;\r\n let curshft = 0;\r\n let p = 0;\r\n let i = 0;\r\n let j = 0;\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n lg += curvect.length();\r\n }\r\n shft = lg / nbSeg;\r\n const dashSize = instance!._creationDataStorage!.dashSize;\r\n const gapSize = instance!._creationDataStorage!.gapSize;\r\n dashshft = (dashSize * shft) / (dashSize + gapSize);\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n nb = Math.floor(curvect.length() / shft);\r\n curvect.normalize();\r\n j = 0;\r\n while (j < nb && p < positions.length) {\r\n curshft = shft * j;\r\n positions[p] = points[i].x + curshft * curvect.x;\r\n positions[p + 1] = points[i].y + curshft * curvect.y;\r\n positions[p + 2] = points[i].z + curshft * curvect.z;\r\n positions[p + 3] = points[i].x + (curshft + dashshft) * curvect.x;\r\n positions[p + 4] = points[i].y + (curshft + dashshft) * curvect.y;\r\n positions[p + 5] = points[i].z + (curshft + dashshft) * curvect.z;\r\n p += 6;\r\n j++;\r\n }\r\n }\r\n while (p < positions.length) {\r\n positions[p] = points[i].x;\r\n positions[p + 1] = points[i].y;\r\n positions[p + 2] = points[i].z;\r\n p += 3;\r\n }\r\n };\r\n if (options.dashNb || options.dashSize || options.gapSize || options.useVertexAlpha || options.material) {\r\n Logger.Warn(\"You have used an option other than points with the instance option. Please be aware that these other options will be ignored.\");\r\n }\r\n instance.updateMeshPositions(positionFunction, false);\r\n return instance;\r\n }\r\n // dashed lines creation\r\n const dashedLines = new LinesMesh(name, scene, null, undefined, undefined, undefined, options.useVertexAlpha, options.material);\r\n const vertexData = CreateDashedLinesVertexData(options);\r\n vertexData.applyToMesh(dashedLines, options.updatable);\r\n\r\n dashedLines._creationDataStorage = new _CreationDataStorage();\r\n dashedLines._creationDataStorage.dashSize = dashSize;\r\n dashedLines._creationDataStorage.gapSize = gapSize;\r\n return dashedLines;\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the functions directly from the module\r\n */\r\nexport const LinesBuilder = {\r\n CreateDashedLines,\r\n CreateLineSystem,\r\n CreateLines,\r\n};\r\n\r\nVertexData.CreateLineSystem = CreateLineSystemVertexData;\r\nVertexData.CreateDashedLines = CreateDashedLinesVertexData;\r\n\r\nMesh.CreateLines = (name: string, points: Vector3[], scene: Nullable<Scene> = null, updatable: boolean = false, instance: Nullable<LinesMesh> = null): LinesMesh => {\r\n const options = {\r\n points,\r\n updatable,\r\n instance,\r\n };\r\n return CreateLines(name, options, scene);\r\n};\r\n\r\nMesh.CreateDashedLines = (\r\n name: string,\r\n points: Vector3[],\r\n dashSize: number,\r\n gapSize: number,\r\n dashNb: number,\r\n scene: Nullable<Scene> = null,\r\n updatable?: boolean,\r\n instance?: LinesMesh\r\n): LinesMesh => {\r\n const options = {\r\n points,\r\n dashSize,\r\n gapSize,\r\n dashNb,\r\n updatable,\r\n instance,\r\n };\r\n return CreateDashedLines(name, options, scene);\r\n};\r\n"]}
@@ -0,0 +1,6 @@
1
+ import "./sceneUboDeclaration";
2
+ /** @internal */
3
+ export declare const backgroundUboDeclarationWGSL: {
4
+ name: string;
5
+ shader: string;
6
+ };
@@ -0,0 +1,12 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../../Engines/shaderStore.js";
3
+ import "./sceneUboDeclaration.js";
4
+ const name = "backgroundUboDeclaration";
5
+ const shader = `uniform vPrimaryColor: vec4f;uniform vPrimaryColorShadow: vec4f;uniform vDiffuseInfos: vec2f;uniform vReflectionInfos: vec2f;uniform diffuseMatrix: mat4x4f;uniform reflectionMatrix: mat4x4f;uniform vReflectionMicrosurfaceInfos: vec3f;uniform fFovMultiplier: f32;uniform pointSize: f32;uniform shadowLevel: f32;uniform alpha: f32;uniform vBackgroundCenter: vec3f;uniform vReflectionControl: vec4f;uniform projectedGroundInfos: vec2f;
6
+ #include<sceneUboDeclaration>
7
+ `;
8
+ // Sideeffect
9
+ ShaderStore.IncludesShadersStoreWGSL[name] = shader;
10
+ /** @internal */
11
+ export const backgroundUboDeclarationWGSL = { name, shader };
12
+ //# sourceMappingURL=backgroundUboDeclaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backgroundUboDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/backgroundUboDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,uBAAuB,CAAC;AAE/B,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG;;CAEd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nimport \"./sceneUboDeclaration\";\n\nconst name = \"backgroundUboDeclaration\";\nconst shader = `uniform vPrimaryColor: vec4f;uniform vPrimaryColorShadow: vec4f;uniform vDiffuseInfos: vec2f;uniform vReflectionInfos: vec2f;uniform diffuseMatrix: mat4x4f;uniform reflectionMatrix: mat4x4f;uniform vReflectionMicrosurfaceInfos: vec3f;uniform fFovMultiplier: f32;uniform pointSize: f32;uniform shadowLevel: f32;uniform alpha: f32;uniform vBackgroundCenter: vec3f;uniform vReflectionControl: vec4f;uniform projectedGroundInfos: vec2f;\n#include<sceneUboDeclaration>\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const backgroundUboDeclarationWGSL = { name, shader };\n"]}
@@ -1,5 +1,5 @@
1
1
  /** @internal */
2
- export declare const bakedVertexAnimation: {
2
+ export declare const bakedVertexAnimationWGSL: {
3
3
  name: string;
4
4
  shader: string;
5
5
  };
@@ -36,5 +36,5 @@ finalWorld=finalWorld*VATInfluence;}
36
36
  // Sideeffect
37
37
  ShaderStore.IncludesShadersStoreWGSL[name] = shader;
38
38
  /** @internal */
39
- export const bakedVertexAnimation = { name, shader };
39
+ export const bakedVertexAnimationWGSL = { name, shader };
40
40
  //# sourceMappingURL=bakedVertexAnimation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bakedVertexAnimation.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/bakedVertexAnimation.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Bd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bakedVertexAnimation\";\nconst shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\n#ifdef INSTANCES\nlet VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;\n#else\nlet VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;\n#endif\nlet totalFrames: f32=VATEndFrame-VATStartFrame+1.0;let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;let frameCorrection: f32=select(1.0,0.0,time<1.0);let numOfFrames: f32=totalFrames-frameCorrection;var VATFrameNum: f32=fract(time)*numOfFrames;VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;VATFrameNum=floor(VATFrameNum);VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;var VATInfluence : mat4x4<f32>;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];\n#endif\nfinalWorld=finalWorld*VATInfluence;}\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bakedVertexAnimation = { name, shader };\n"]}
1
+ {"version":3,"file":"bakedVertexAnimation.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/bakedVertexAnimation.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Bd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bakedVertexAnimation\";\nconst shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\n{\n#ifdef INSTANCES\nlet VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;\n#else\nlet VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;\n#endif\nlet totalFrames: f32=VATEndFrame-VATStartFrame+1.0;let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;let frameCorrection: f32=select(1.0,0.0,time<1.0);let numOfFrames: f32=totalFrames-frameCorrection;var VATFrameNum: f32=fract(time)*numOfFrames;VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;VATFrameNum=floor(VATFrameNum);VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;var VATInfluence : mat4x4<f32>;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];\n#endif\n#if NUM_BONE_INFLUENCERS>2\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];\n#endif\n#if NUM_BONE_INFLUENCERS>3\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];\n#endif\n#if NUM_BONE_INFLUENCERS>5\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];\n#endif\n#if NUM_BONE_INFLUENCERS>6\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];\n#endif\n#if NUM_BONE_INFLUENCERS>7\nVATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];\n#endif\nfinalWorld=finalWorld*VATInfluence;}\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bakedVertexAnimationWGSL = { name, shader };\n"]}
@@ -1,5 +1,5 @@
1
1
  /** @internal */
2
- export declare const bakedVertexAnimationDeclaration: {
2
+ export declare const bakedVertexAnimationDeclarationWGSL: {
3
3
  name: string;
4
4
  shader: string;
5
5
  };
@@ -13,5 +13,5 @@ fn readMatrixFromRawSamplerVAT(smp : texture_2d<f32>,index : f32,frame : f32)->m
13
13
  // Sideeffect
14
14
  ShaderStore.IncludesShadersStoreWGSL[name] = shader;
15
15
  /** @internal */
16
- export const bakedVertexAnimationDeclaration = { name, shader };
16
+ export const bakedVertexAnimationDeclarationWGSL = { name, shader };
17
17
  //# sourceMappingURL=bakedVertexAnimationDeclaration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bakedVertexAnimationDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,iCAAiC,CAAC;AAC/C,MAAM,MAAM,GAAG;;;;;;;;CAQd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bakedVertexAnimationDeclaration\";\nconst shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\nuniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationTextureSizeInverted: vec2<f32>;uniform bakedVertexAnimationSettings: vec4<f32>;var bakedVertexAnimationTexture : texture_2d<f32>;\n#ifdef INSTANCES\nattribute bakedVertexAnimationSettingsInstanced : vec4<f32>;\n#endif\nfn readMatrixFromRawSamplerVAT(smp : texture_2d<f32>,index : f32,frame : f32)->mat4x4<f32>\n{let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2<i32>(offset+0,frameUV),0);let m1=textureLoad(smp,vec2<i32>(offset+1,frameUV),0);let m2=textureLoad(smp,vec2<i32>(offset+2,frameUV),0);let m3=textureLoad(smp,vec2<i32>(offset+3,frameUV),0);return mat4x4<f32>(m0,m1,m2,m3);}\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bakedVertexAnimationDeclaration = { name, shader };\n"]}
1
+ {"version":3,"file":"bakedVertexAnimationDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,iCAAiC,CAAC;AAC/C,MAAM,MAAM,GAAG;;;;;;;;CAQd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,mCAAmC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bakedVertexAnimationDeclaration\";\nconst shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE\nuniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationTextureSizeInverted: vec2<f32>;uniform bakedVertexAnimationSettings: vec4<f32>;var bakedVertexAnimationTexture : texture_2d<f32>;\n#ifdef INSTANCES\nattribute bakedVertexAnimationSettingsInstanced : vec4<f32>;\n#endif\nfn readMatrixFromRawSamplerVAT(smp : texture_2d<f32>,index : f32,frame : f32)->mat4x4<f32>\n{let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2<i32>(offset+0,frameUV),0);let m1=textureLoad(smp,vec2<i32>(offset+1,frameUV),0);let m2=textureLoad(smp,vec2<i32>(offset+2,frameUV),0);let m3=textureLoad(smp,vec2<i32>(offset+3,frameUV),0);return mat4x4<f32>(m0,m1,m2,m3);}\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bakedVertexAnimationDeclarationWGSL = { name, shader };\n"]}
@@ -1,5 +1,5 @@
1
1
  /** @internal */
2
- export declare const bonesDeclaration: {
2
+ export declare const bonesDeclarationWGSL: {
3
3
  name: string;
4
4
  shader: string;
5
5
  };
@@ -26,5 +26,5 @@ let m0=textureLoad(smp,vec2<i32>(offset+0,0),0);let m1=textureLoad(smp,vec2<i32>
26
26
  // Sideeffect
27
27
  ShaderStore.IncludesShadersStoreWGSL[name] = shader;
28
28
  /** @internal */
29
- export const bonesDeclaration = { name, shader };
29
+ export const bonesDeclarationWGSL = { name, shader };
30
30
  //# sourceMappingURL=bonesDeclaration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bonesDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/bonesDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bonesDeclaration\";\nconst shader = `#if NUM_BONE_INFLUENCERS>0\nattribute matricesIndices : vec4<f32>;attribute matricesWeights : vec4<f32>;\n#if NUM_BONE_INFLUENCERS>4\nattribute matricesIndicesExtra : vec4<f32>;attribute matricesWeightsExtra : vec4<f32>;\n#endif\n#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#ifdef BONETEXTURE\nvar boneSampler : texture_2d<f32>;uniform boneTextureWidth : f32;\n#else\nuniform mBones : array<mat4x4,BonesPerMesh>;\n#ifdef BONES_VELOCITY_ENABLED\nuniform mPreviousBones : array<mat4x4,BonesPerMesh>;\n#endif\n#endif\n#ifdef BONETEXTURE\nfn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4<f32>\n{let offset=i32(index) *4; \nlet m0=textureLoad(smp,vec2<i32>(offset+0,0),0);let m1=textureLoad(smp,vec2<i32>(offset+1,0),0);let m2=textureLoad(smp,vec2<i32>(offset+2,0),0);let m3=textureLoad(smp,vec2<i32>(offset+3,0),0);return mat4x4<f32>(m0,m1,m2,m3);}\n#endif\n#endif\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bonesDeclaration = { name, shader };\n"]}
1
+ {"version":3,"file":"bonesDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/bonesDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bonesDeclaration\";\nconst shader = `#if NUM_BONE_INFLUENCERS>0\nattribute matricesIndices : vec4<f32>;attribute matricesWeights : vec4<f32>;\n#if NUM_BONE_INFLUENCERS>4\nattribute matricesIndicesExtra : vec4<f32>;attribute matricesWeightsExtra : vec4<f32>;\n#endif\n#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#ifdef BONETEXTURE\nvar boneSampler : texture_2d<f32>;uniform boneTextureWidth : f32;\n#else\nuniform mBones : array<mat4x4,BonesPerMesh>;\n#ifdef BONES_VELOCITY_ENABLED\nuniform mPreviousBones : array<mat4x4,BonesPerMesh>;\n#endif\n#endif\n#ifdef BONETEXTURE\nfn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4<f32>\n{let offset=i32(index) *4; \nlet m0=textureLoad(smp,vec2<i32>(offset+0,0),0);let m1=textureLoad(smp,vec2<i32>(offset+1,0),0);let m2=textureLoad(smp,vec2<i32>(offset+2,0),0);let m3=textureLoad(smp,vec2<i32>(offset+3,0),0);return mat4x4<f32>(m0,m1,m2,m3);}\n#endif\n#endif\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bonesDeclarationWGSL = { name, shader };\n"]}
@@ -1,5 +1,5 @@
1
1
  /** @internal */
2
- export declare const bonesVertex: {
2
+ export declare const bonesVertexWGSL: {
3
3
  name: string;
4
4
  shader: string;
5
5
  };
@@ -58,5 +58,5 @@ finalWorld=finalWorld*influence;
58
58
  // Sideeffect
59
59
  ShaderStore.IncludesShadersStoreWGSL[name] = shader;
60
60
  /** @internal */
61
- export const bonesVertex = { name, shader };
61
+ export const bonesVertexWGSL = { name, shader };
62
62
  //# sourceMappingURL=bonesVertex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bonesVertex.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/bonesVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,aAAa,CAAC;AAC3B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bonesVertex\";\nconst shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nvar influence : mat4x4<f32>;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];\n#endif \n#else \ninfluence=uniforms.mBones[int(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\n#endif \n#endif\nfinalWorld=finalWorld*influence;\n#endif\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bonesVertex = { name, shader };\n"]}
1
+ {"version":3,"file":"bonesVertex.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/bonesVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,aAAa,CAAC;AAC3B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bonesVertex\";\nconst shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE\n#if NUM_BONE_INFLUENCERS>0\nvar influence : mat4x4<f32>;\n#ifdef BONETEXTURE\ninfluence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];\n#endif \n#else \ninfluence=uniforms.mBones[int(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\n#endif \n#if NUM_BONE_INFLUENCERS>4\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\ninfluence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\n#endif \n#endif\nfinalWorld=finalWorld*influence;\n#endif\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bonesVertexWGSL = { name, shader };\n"]}
@@ -1,5 +1,5 @@
1
1
  /** @internal */
2
- export declare const bumpFragment: {
2
+ export declare const bumpFragmentWGSL: {
3
3
  name: string;
4
4
  shader: string;
5
5
  };
@@ -6,56 +6,56 @@ const shader = `var uvOffset: vec2f= vec2f(0.0,0.0);
6
6
  #ifdef NORMALXYSCALE
7
7
  var normalScale: f32=1.0;
8
8
  #elif defined(BUMP)
9
- var normalScale: f32=vBumpInfos.y;
9
+ var normalScale: f32=uniforms.vBumpInfos.y;
10
10
  #else
11
11
  var normalScale: f32=1.0;
12
12
  #endif
13
13
  #if defined(TANGENT) && defined(NORMAL)
14
- var TBN: mat3x3f=vTBN;
14
+ var TBN: mat3x3f=mat3x3<f32>(input.vTBN0,input.vTBN1,input.vTBN2);
15
15
  #elif defined(BUMP)
16
- var TBNUV: vec2f=select(-vBumpUV,vBumpUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vTangentSpaceParams);
16
+ var TBNUV: vec2f=select(-fragmentInputs.vBumpUV,fragmentInputs.vBumpUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV,uniforms.vTangentSpaceParams);
17
17
  #else
18
- var TBNUV: vec2f=select(-vDetailUV,vDetailUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,vPositionW,TBNUV, vec2f(1.,1.));
18
+ var TBNUV: vec2f=select(-vDetailUV,vDetailUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV, vec2f(1.,1.));
19
19
  #endif
20
20
  #elif defined(ANISOTROPIC)
21
21
  #if defined(TANGENT) && defined(NORMAL)
22
- var TBN: mat3x3f=vTBN;
22
+ var TBN: mat3x3f=mat3x3<f32>(input.vTBN0,input.vTBN1,input.vTBN2);
23
23
  #else
24
- var TBNUV: vec2f=select( -vMainUV1,vMainUV1,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW,vPositionW,TBNUV, vec2f(1.,1.));
24
+ var TBNUV: vec2f=select( -fragmentInputs.vMainUV1,fragmentInputs.vMainUV1,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW,input.vPositionW,TBNUV, vec2f(1.,1.));
25
25
  #endif
26
26
  #endif
27
27
  #ifdef PARALLAX
28
28
  var invTBN: mat3x3f=transposeMat3(TBN);
29
29
  #ifdef PARALLAXOCCLUSION
30
- uvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);
30
+ uvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,fragmentInputs.vBumpUV,uniforms.vBumpInfos.z);
31
31
  #else
32
- uvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);
32
+ uvOffset=parallaxOffset(invTBN*viewDirectionW,uniforms.vBumpInfos.z);
33
33
  #endif
34
34
  #endif
35
35
  #ifdef DETAIL
36
- var detailColor: vec4f=textureSample(detail,detailSampler,vDetailUV+uvOffset);var detailNormalRG: vec2f=detailColor.wy*2.0-1.0;var detailNormalB: f32=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));var detailNormal: vec3f= vec3f(detailNormalRG,detailNormalB);
36
+ var detailColor: vec4f=textureSample(detailSampler,detailSamplerSampler,vDetailUV+uvOffset);var detailNormalRG: vec2f=detailColor.wy*2.0-1.0;var detailNormalB: f32=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));var detailNormal: vec3f= vec3f(detailNormalRG,detailNormalB);
37
37
  #endif
38
38
  #ifdef BUMP
39
39
  #ifdef OBJECTSPACE_NORMALMAP
40
40
  #define CUSTOM_FRAGMENT_BUMP_FRAGMENT
41
- normalW=normalize(textureSample(bump,bumpSampler,vBumpUV).xyz *2.0-1.0);normalW=normalize( mat3x3f(normalMatrix)*normalW);
41
+ normalW=normalize(textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).xyz *2.0-1.0);normalW=normalize(mat3x3f(uniforms.normalMatrix[0].xyz,uniforms.normalMatrix[1].xyz,uniforms.normalMatrix[2].xyz)*normalW);
42
42
  #elif !defined(DETAIL)
43
- normalW=perturbNormal(TBN,textureSample(bump,bumpSampler,vBumpUV+uvOffset).xyz,vBumpInfos.y);
43
+ normalW=perturbNormal(TBN,textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV+uvOffset).xyz,uniforms.vBumpInfos.y);
44
44
  #else
45
- var bumpNormal: vec3f=textureSample(bump,bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;
45
+ var bumpNormal: vec3f=textureSample(bumpSampler,bumpSamplerSampler,vBumpUV+uvOffset).xyz*2.0-1.0;
46
46
  #if DETAIL_NORMALBLENDMETHOD==0
47
- detailNormal.xy*=vDetailInfos.z;var blendedNormal: vec3f=normalize( vec3f(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));
47
+ detailNormal.xy*=uniforms.vDetailInfos.z;var blendedNormal: vec3f=normalize( vec3f(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));
48
48
  #elif DETAIL_NORMALBLENDMETHOD==1
49
- detailNormal.xy*=vDetailInfos.z;bumpNormal+= vec3f(0.0,0.0,1.0);detailNormal*= vec3f(-1.0,-1.0,1.0);var blendedNormal: vec3f=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;
49
+ detailNormal.xy*=uniforms.vDetailInfos.z;bumpNormal+= vec3f(0.0,0.0,1.0);detailNormal*= vec3f(-1.0,-1.0,1.0);var blendedNormal: vec3f=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;
50
50
  #endif
51
- normalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);
51
+ normalW=perturbNormalBase(TBN,blendedNormal,uniforms.vBumpInfos.y);
52
52
  #endif
53
53
  #elif defined(DETAIL)
54
- detailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);
54
+ detailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,uniforms.vDetailInfos.z);
55
55
  #endif
56
56
  `;
57
57
  // Sideeffect
58
58
  ShaderStore.IncludesShadersStoreWGSL[name] = shader;
59
59
  /** @internal */
60
- export const bumpFragment = { name, shader };
60
+ export const bumpFragmentWGSL = { name, shader };
61
61
  //# sourceMappingURL=bumpFragment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bumpFragment.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/bumpFragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,cAAc,CAAC;AAC5B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bumpFragment\";\nconst shader = `var uvOffset: vec2f= vec2f(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)\n#ifdef NORMALXYSCALE\nvar normalScale: f32=1.0;\n#elif defined(BUMP)\nvar normalScale: f32=vBumpInfos.y;\n#else\nvar normalScale: f32=1.0;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nvar TBN: mat3x3f=vTBN;\n#elif defined(BUMP)\nvar TBNUV: vec2f=select(-vBumpUV,vBumpUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,vPositionW,TBNUV,vTangentSpaceParams);\n#else\nvar TBNUV: vec2f=select(-vDetailUV,vDetailUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,vPositionW,TBNUV, vec2f(1.,1.));\n#endif\n#elif defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvar TBN: mat3x3f=vTBN;\n#else\nvar TBNUV: vec2f=select( -vMainUV1,vMainUV1,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW,vPositionW,TBNUV, vec2f(1.,1.));\n#endif\n#endif\n#ifdef PARALLAX\nvar invTBN: mat3x3f=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,vBumpUV,vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,vBumpInfos.z);\n#endif\n#endif\n#ifdef DETAIL\nvar detailColor: vec4f=textureSample(detail,detailSampler,vDetailUV+uvOffset);var detailNormalRG: vec2f=detailColor.wy*2.0-1.0;var detailNormalB: f32=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));var detailNormal: vec3f= vec3f(detailNormalRG,detailNormalB);\n#endif\n#ifdef BUMP\n#ifdef OBJECTSPACE_NORMALMAP\n#define CUSTOM_FRAGMENT_BUMP_FRAGMENT\nnormalW=normalize(textureSample(bump,bumpSampler,vBumpUV).xyz *2.0-1.0);normalW=normalize( mat3x3f(normalMatrix)*normalW);\n#elif !defined(DETAIL)\nnormalW=perturbNormal(TBN,textureSample(bump,bumpSampler,vBumpUV+uvOffset).xyz,vBumpInfos.y);\n#else\nvar bumpNormal: vec3f=textureSample(bump,bumpSampler,vBumpUV+uvOffset).xyz*2.0-1.0;\n#if DETAIL_NORMALBLENDMETHOD==0 \ndetailNormal.xy*=vDetailInfos.z;var blendedNormal: vec3f=normalize( vec3f(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));\n#elif DETAIL_NORMALBLENDMETHOD==1 \ndetailNormal.xy*=vDetailInfos.z;bumpNormal+= vec3f(0.0,0.0,1.0);detailNormal*= vec3f(-1.0,-1.0,1.0);var blendedNormal: vec3f=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;\n#endif\nnormalW=perturbNormalBase(TBN,blendedNormal,vBumpInfos.y);\n#endif\n#elif defined(DETAIL)\ndetailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,vDetailInfos.z);\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bumpFragment = { name, shader };\n"]}
1
+ {"version":3,"file":"bumpFragment.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/bumpFragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,IAAI,GAAG,cAAc,CAAC;AAC5B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACpD,gBAAgB;AAChB,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\n\nconst name = \"bumpFragment\";\nconst shader = `var uvOffset: vec2f= vec2f(0.0,0.0);\n#if defined(BUMP) || defined(PARALLAX) || defined(DETAIL)\n#ifdef NORMALXYSCALE\nvar normalScale: f32=1.0;\n#elif defined(BUMP)\nvar normalScale: f32=uniforms.vBumpInfos.y;\n#else\nvar normalScale: f32=1.0;\n#endif\n#if defined(TANGENT) && defined(NORMAL)\nvar TBN: mat3x3f=mat3x3<f32>(input.vTBN0,input.vTBN1,input.vTBN2); \n#elif defined(BUMP)\nvar TBNUV: vec2f=select(-fragmentInputs.vBumpUV,fragmentInputs.vBumpUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV,uniforms.vTangentSpaceParams);\n#else\nvar TBNUV: vec2f=select(-vDetailUV,vDetailUV,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW*normalScale,input.vPositionW,TBNUV, vec2f(1.,1.));\n#endif\n#elif defined(ANISOTROPIC)\n#if defined(TANGENT) && defined(NORMAL)\nvar TBN: mat3x3f=mat3x3<f32>(input.vTBN0,input.vTBN1,input.vTBN2); \n#else\nvar TBNUV: vec2f=select( -fragmentInputs.vMainUV1,fragmentInputs.vMainUV1,fragmentInputs.frontFacing);var TBN: mat3x3f=cotangent_frame(normalW,input.vPositionW,TBNUV, vec2f(1.,1.));\n#endif\n#endif\n#ifdef PARALLAX\nvar invTBN: mat3x3f=transposeMat3(TBN);\n#ifdef PARALLAXOCCLUSION\nuvOffset=parallaxOcclusion(invTBN*-viewDirectionW,invTBN*normalW,fragmentInputs.vBumpUV,uniforms.vBumpInfos.z);\n#else\nuvOffset=parallaxOffset(invTBN*viewDirectionW,uniforms.vBumpInfos.z);\n#endif\n#endif\n#ifdef DETAIL\nvar detailColor: vec4f=textureSample(detailSampler,detailSamplerSampler,vDetailUV+uvOffset);var detailNormalRG: vec2f=detailColor.wy*2.0-1.0;var detailNormalB: f32=sqrt(1.-saturate(dot(detailNormalRG,detailNormalRG)));var detailNormal: vec3f= vec3f(detailNormalRG,detailNormalB);\n#endif\n#ifdef BUMP\n#ifdef OBJECTSPACE_NORMALMAP\n#define CUSTOM_FRAGMENT_BUMP_FRAGMENT\nnormalW=normalize(textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV).xyz *2.0-1.0);normalW=normalize(mat3x3f(uniforms.normalMatrix[0].xyz,uniforms.normalMatrix[1].xyz,uniforms.normalMatrix[2].xyz)*normalW);\n#elif !defined(DETAIL)\nnormalW=perturbNormal(TBN,textureSample(bumpSampler,bumpSamplerSampler,fragmentInputs.vBumpUV+uvOffset).xyz,uniforms.vBumpInfos.y);\n#else\nvar bumpNormal: vec3f=textureSample(bumpSampler,bumpSamplerSampler,vBumpUV+uvOffset).xyz*2.0-1.0;\n#if DETAIL_NORMALBLENDMETHOD==0 \ndetailNormal.xy*=uniforms.vDetailInfos.z;var blendedNormal: vec3f=normalize( vec3f(bumpNormal.xy+detailNormal.xy,bumpNormal.z*detailNormal.z));\n#elif DETAIL_NORMALBLENDMETHOD==1 \ndetailNormal.xy*=uniforms.vDetailInfos.z;bumpNormal+= vec3f(0.0,0.0,1.0);detailNormal*= vec3f(-1.0,-1.0,1.0);var blendedNormal: vec3f=bumpNormal*dot(bumpNormal,detailNormal)/bumpNormal.z-detailNormal;\n#endif\nnormalW=perturbNormalBase(TBN,blendedNormal,uniforms.vBumpInfos.y);\n#endif\n#elif defined(DETAIL)\ndetailNormal.xy*=vDetailInfos.z;normalW=perturbNormalBase(TBN,detailNormal,uniforms.vDetailInfos.z);\n#endif\n`;\n// Sideeffect\nShaderStore.IncludesShadersStoreWGSL[name] = shader;\n/** @internal */\nexport const bumpFragmentWGSL = { name, shader };\n"]}