@onerjs/core 9.0.1 → 9.0.3

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 (476) hide show
  1. package/Animations/animationGroup.pure.js.map +1 -1
  2. package/Buffers/buffer.pure.js +4 -0
  3. package/Buffers/buffer.pure.js.map +1 -1
  4. package/Cameras/camera.pure.d.ts +14 -0
  5. package/Cameras/camera.pure.js +15 -0
  6. package/Cameras/camera.pure.js.map +1 -1
  7. package/Compute/computeShader.pure.d.ts +2 -1
  8. package/Compute/computeShader.pure.js +29 -10
  9. package/Compute/computeShader.pure.js.map +1 -1
  10. package/Culling/ray.core.js +22 -9
  11. package/Culling/ray.core.js.map +1 -1
  12. package/Engines/IDrawContext.d.ts +2 -0
  13. package/Engines/IDrawContext.js.map +1 -1
  14. package/Engines/Native/nativeInterfaces.d.ts +55 -4
  15. package/Engines/Native/nativeInterfaces.js.map +1 -1
  16. package/Engines/Native/nativeRenderTargetWrapper.d.ts +1 -0
  17. package/Engines/Native/nativeRenderTargetWrapper.js +5 -1
  18. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  19. package/Engines/Processors/shaderCodeInliner.d.ts +2 -0
  20. package/Engines/Processors/shaderCodeInliner.js +251 -6
  21. package/Engines/Processors/shaderCodeInliner.js.map +1 -1
  22. package/Engines/Processors/shaderProcessor.js +10 -1
  23. package/Engines/Processors/shaderProcessor.js.map +1 -1
  24. package/Engines/WebGPU/Extensions/engine.debugging.pure.js +12 -0
  25. package/Engines/WebGPU/Extensions/engine.debugging.pure.js.map +1 -1
  26. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +0 -1
  27. package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
  28. package/Engines/WebGPU/Extensions/engine.query.pure.js +5 -0
  29. package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
  30. package/Engines/WebGPU/webgpuBufferManager.js +7 -0
  31. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  32. package/Engines/WebGPU/webgpuCacheTextureView.d.ts +1 -1
  33. package/Engines/WebGPU/webgpuCacheTextureView.js +20 -8
  34. package/Engines/WebGPU/webgpuCacheTextureView.js.map +1 -1
  35. package/Engines/WebGPU/webgpuDrawContext.d.ts +2 -0
  36. package/Engines/WebGPU/webgpuDrawContext.js +6 -0
  37. package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
  38. package/Engines/WebGPU/webgpuQuerySet.d.ts +3 -3
  39. package/Engines/WebGPU/webgpuQuerySet.js +23 -9
  40. package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
  41. package/Engines/WebGPU/webgpuRenderPassCommandStream.d.ts +156 -0
  42. package/Engines/WebGPU/webgpuRenderPassCommandStream.js +323 -0
  43. package/Engines/WebGPU/webgpuRenderPassCommandStream.js.map +1 -0
  44. package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
  45. package/Engines/WebGPU/webgpuTextureManager.js +4 -3
  46. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  47. package/Engines/WebGPU/webgpuTimestampQuery.d.ts +3 -1
  48. package/Engines/WebGPU/webgpuTimestampQuery.js +9 -6
  49. package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
  50. package/Engines/abstractEngine.pure.d.ts +2 -0
  51. package/Engines/abstractEngine.pure.js +14 -5
  52. package/Engines/abstractEngine.pure.js.map +1 -1
  53. package/Engines/constants.d.ts +6 -0
  54. package/Engines/constants.js +6 -0
  55. package/Engines/constants.js.map +1 -1
  56. package/Engines/engine.d.ts +198 -24
  57. package/Engines/pure.d.ts +1 -0
  58. package/Engines/pure.js +1 -0
  59. package/Engines/pure.js.map +1 -1
  60. package/Engines/renderCommandBatcher.pure.d.ts +16 -0
  61. package/Engines/renderCommandBatcher.pure.js +24 -0
  62. package/Engines/renderCommandBatcher.pure.js.map +1 -0
  63. package/Engines/thinEngine.functions.js +3 -2
  64. package/Engines/thinEngine.functions.js.map +1 -1
  65. package/Engines/thinEngine.pure.js +18 -2
  66. package/Engines/thinEngine.pure.js.map +1 -1
  67. package/Engines/thinNativeEngine.pure.d.ts +10 -7
  68. package/Engines/thinNativeEngine.pure.js +117 -46
  69. package/Engines/thinNativeEngine.pure.js.map +1 -1
  70. package/Engines/thinWebGPUEngine.d.ts +8 -0
  71. package/Engines/thinWebGPUEngine.js +11 -0
  72. package/Engines/thinWebGPUEngine.js.map +1 -1
  73. package/Engines/webgpuEngine.pure.d.ts +60 -1
  74. package/Engines/webgpuEngine.pure.js +238 -42
  75. package/Engines/webgpuEngine.pure.js.map +1 -1
  76. package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.d.ts +3 -3
  77. package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.js +2 -1
  78. package/FlowGraph/Blocks/Data/Audio/flowGraphGetSoundVolumeBlock.pure.js.map +1 -1
  79. package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.d.ts +3 -3
  80. package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.js +2 -1
  81. package/FlowGraph/Blocks/Data/Audio/flowGraphIsSoundPlayingBlock.pure.js.map +1 -1
  82. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.d.ts +5 -0
  83. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.js +8 -0
  84. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.js.map +1 -0
  85. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.d.ts +77 -0
  86. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.js +141 -0
  87. package/FlowGraph/Blocks/Event/flowGraphMeshIntersectionEventBlock.pure.js.map +1 -0
  88. package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.d.ts +5 -3
  89. package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.js +38 -7
  90. package/FlowGraph/Blocks/Event/flowGraphSoundEndedEventBlock.pure.js.map +1 -1
  91. package/FlowGraph/Blocks/Event/index.d.ts +1 -0
  92. package/FlowGraph/Blocks/Event/index.js +1 -0
  93. package/FlowGraph/Blocks/Event/index.js.map +1 -1
  94. package/FlowGraph/Blocks/Event/pure.d.ts +1 -0
  95. package/FlowGraph/Blocks/Event/pure.js +1 -0
  96. package/FlowGraph/Blocks/Event/pure.js.map +1 -1
  97. package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.d.ts +3 -3
  98. package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.js +2 -1
  99. package/FlowGraph/Blocks/Execution/Audio/flowGraphPauseSoundBlock.pure.js.map +1 -1
  100. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.d.ts +3 -3
  101. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.js +2 -1
  102. package/FlowGraph/Blocks/Execution/Audio/flowGraphPlaySoundBlock.pure.js.map +1 -1
  103. package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.d.ts +3 -3
  104. package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.js +2 -1
  105. package/FlowGraph/Blocks/Execution/Audio/flowGraphSetSoundVolumeBlock.pure.js.map +1 -1
  106. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.d.ts +3 -3
  107. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.js +2 -1
  108. package/FlowGraph/Blocks/Execution/Audio/flowGraphStopSoundBlock.pure.js.map +1 -1
  109. package/FlowGraph/Blocks/allBlocks.pure.js +2 -0
  110. package/FlowGraph/Blocks/allBlocks.pure.js.map +1 -1
  111. package/FlowGraph/Blocks/flowGraphBlockFactory.js +2 -0
  112. package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
  113. package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +1 -0
  114. package/FlowGraph/Blocks/flowGraphBlockNames.js +1 -0
  115. package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -1
  116. package/FlowGraph/flowGraph.d.ts +12 -1
  117. package/FlowGraph/flowGraph.js +38 -0
  118. package/FlowGraph/flowGraph.js.map +1 -1
  119. package/FlowGraph/flowGraphCoordinator.d.ts +44 -0
  120. package/FlowGraph/flowGraphCoordinator.js +141 -0
  121. package/FlowGraph/flowGraphCoordinator.js.map +1 -1
  122. package/FlowGraph/flowGraphDataConnection.pure.js +41 -14
  123. package/FlowGraph/flowGraphDataConnection.pure.js.map +1 -1
  124. package/FlowGraph/flowGraphParser.js +105 -5
  125. package/FlowGraph/flowGraphParser.js.map +1 -1
  126. package/FlowGraph/flowGraphSoundAssets.d.ts +40 -0
  127. package/FlowGraph/flowGraphSoundAssets.js +33 -0
  128. package/FlowGraph/flowGraphSoundAssets.js.map +1 -0
  129. package/FlowGraph/index.d.ts +1 -0
  130. package/FlowGraph/index.js +1 -0
  131. package/FlowGraph/index.js.map +1 -1
  132. package/FlowGraph/pure.d.ts +1 -0
  133. package/FlowGraph/pure.js +1 -0
  134. package/FlowGraph/pure.js.map +1 -1
  135. package/FlowGraph/serialization.d.ts +8 -0
  136. package/FlowGraph/serialization.js +31 -12
  137. package/FlowGraph/serialization.js.map +1 -1
  138. package/FlowGraph/typeDefinitions.d.ts +25 -0
  139. package/FlowGraph/typeDefinitions.js.map +1 -1
  140. package/FrameGraph/Tasks/PostProcesses/taaTask.js +2 -0
  141. package/FrameGraph/Tasks/PostProcesses/taaTask.js.map +1 -1
  142. package/Instrumentation/engineInstrumentation.d.ts +1 -0
  143. package/Instrumentation/engineInstrumentation.js +25 -6
  144. package/Instrumentation/engineInstrumentation.js.map +1 -1
  145. package/Lights/Clustered/clusteredLightContainer.pure.js +2 -0
  146. package/Lights/Clustered/clusteredLightContainer.pure.js.map +1 -1
  147. package/Lights/Shadows/cascadedShadowGenerator.pure.d.ts +36 -1
  148. package/Lights/Shadows/cascadedShadowGenerator.pure.js +202 -27
  149. package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
  150. package/Lights/directionalLight.pure.d.ts +24 -10
  151. package/Lights/directionalLight.pure.js +29 -11
  152. package/Lights/directionalLight.pure.js.map +1 -1
  153. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +4 -4
  154. package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
  155. package/Materials/Node/Blocks/Dual/lightBlock.pure.js +1 -1
  156. package/Materials/Node/Blocks/Dual/lightBlock.pure.js.map +1 -1
  157. package/Materials/Node/Blocks/Input/inputBlock.pure.js +4 -0
  158. package/Materials/Node/Blocks/Input/inputBlock.pure.js.map +1 -1
  159. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.d.ts +9 -0
  160. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +23 -3
  161. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
  162. package/Materials/PBR/openpbrMaterial.pure.js +1 -1
  163. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  164. package/Materials/PBR/pbrBaseMaterial.pure.d.ts +9 -0
  165. package/Materials/PBR/pbrBaseMaterial.pure.js +60 -1
  166. package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
  167. package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +11 -0
  168. package/Materials/PBR/pbrBaseSimpleMaterial.js +21 -2
  169. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  170. package/Materials/PBR/pbrMaterial.pure.d.ts +12 -0
  171. package/Materials/PBR/pbrMaterial.pure.js +23 -3
  172. package/Materials/PBR/pbrMaterial.pure.js.map +1 -1
  173. package/Materials/Textures/Filtering/hdrIrradianceFiltering.d.ts +1 -0
  174. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +10 -0
  175. package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -1
  176. package/Materials/Textures/HTML/htmlInCanvasPolyfill.d.ts +5 -0
  177. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js +7 -0
  178. package/Materials/Textures/HTML/htmlInCanvasPolyfill.js.map +1 -1
  179. package/Materials/Textures/HTML/htmlInteractionManager.d.ts +9 -3
  180. package/Materials/Textures/HTML/htmlInteractionManager.js +64 -5
  181. package/Materials/Textures/HTML/htmlInteractionManager.js.map +1 -1
  182. package/Materials/Textures/HTML/htmlTexture.d.ts +11 -11
  183. package/Materials/Textures/HTML/htmlTexture.js +106 -65
  184. package/Materials/Textures/HTML/htmlTexture.js.map +1 -1
  185. package/Materials/Textures/Loaders/internalTextureLoader.d.ts +2 -1
  186. package/Materials/Textures/Loaders/internalTextureLoader.js.map +1 -1
  187. package/Materials/Textures/Loaders/ktxTextureLoader.d.ts +2 -1
  188. package/Materials/Textures/Loaders/ktxTextureLoader.js +4 -50
  189. package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
  190. package/Materials/Textures/Procedurals/proceduralTexture.pure.js +10 -0
  191. package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
  192. package/Materials/Textures/dynamicTexture.pure.js +6 -0
  193. package/Materials/Textures/dynamicTexture.pure.js.map +1 -1
  194. package/Materials/Textures/ktx2encoderTypes.d.ts +51 -0
  195. package/Materials/Textures/ktx2encoderTypes.js +2 -0
  196. package/Materials/Textures/ktx2encoderTypes.js.map +1 -0
  197. package/Materials/Textures/renderTargetTexture.pure.js +10 -2
  198. package/Materials/Textures/renderTargetTexture.pure.js.map +1 -1
  199. package/Materials/Textures/texture.pure.js +7 -1
  200. package/Materials/Textures/texture.pure.js.map +1 -1
  201. package/Materials/Textures/textureMerger.d.ts +11 -0
  202. package/Materials/Textures/textureMerger.js +34 -19
  203. package/Materials/Textures/textureMerger.js.map +1 -1
  204. package/Materials/Textures/textureProcessor.d.ts +145 -0
  205. package/Materials/Textures/textureProcessor.js +445 -45
  206. package/Materials/Textures/textureProcessor.js.map +1 -1
  207. package/Materials/Textures/textureSampling.functions.d.ts +41 -0
  208. package/Materials/Textures/textureSampling.functions.js +82 -0
  209. package/Materials/Textures/textureSampling.functions.js.map +1 -0
  210. package/Materials/drawWrapper.d.ts +8 -0
  211. package/Materials/drawWrapper.js +19 -0
  212. package/Materials/drawWrapper.js.map +1 -1
  213. package/Materials/effect.pure.d.ts +6 -0
  214. package/Materials/effect.pure.js +28 -6
  215. package/Materials/effect.pure.js.map +1 -1
  216. package/Materials/effect.webgl.functions.pure.js +1 -1
  217. package/Materials/effect.webgl.functions.pure.js.map +1 -1
  218. package/Materials/material.pure.d.ts +5 -0
  219. package/Materials/material.pure.js +9 -2
  220. package/Materials/material.pure.js.map +1 -1
  221. package/Materials/materialFlags.d.ts +6 -0
  222. package/Materials/materialFlags.js +14 -0
  223. package/Materials/materialFlags.js.map +1 -1
  224. package/Materials/materialHelper.functions.d.ts +2 -1
  225. package/Materials/materialHelper.functions.js +36 -2
  226. package/Materials/materialHelper.functions.js.map +1 -1
  227. package/Materials/materialHelper.geometryrendering.js +19 -16
  228. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  229. package/Materials/materialPluginManager.pure.js +12 -8
  230. package/Materials/materialPluginManager.pure.js.map +1 -1
  231. package/Materials/prePassConfiguration.js +19 -16
  232. package/Materials/prePassConfiguration.js.map +1 -1
  233. package/Materials/shaderMaterial.pure.js +19 -6
  234. package/Materials/shaderMaterial.pure.js.map +1 -1
  235. package/Materials/shadowDepthWrapper.d.ts +6 -0
  236. package/Materials/shadowDepthWrapper.js +17 -0
  237. package/Materials/shadowDepthWrapper.js.map +1 -1
  238. package/Meshes/Compression/dracoCodec.d.ts +14 -0
  239. package/Meshes/Compression/dracoCodec.js +22 -0
  240. package/Meshes/Compression/dracoCodec.js.map +1 -1
  241. package/Meshes/Compression/dracoDecoder.d.ts +1 -0
  242. package/Meshes/Compression/dracoDecoder.js +27 -0
  243. package/Meshes/Compression/dracoDecoder.js.map +1 -1
  244. package/Meshes/Compression/dracoEncoder.d.ts +1 -0
  245. package/Meshes/Compression/dracoEncoder.js +8 -0
  246. package/Meshes/Compression/dracoEncoder.js.map +1 -1
  247. package/Meshes/Compression/meshoptCompression.d.ts +1 -0
  248. package/Meshes/Compression/meshoptCompression.js +9 -0
  249. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  250. package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.d.ts +415 -0
  251. package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.js +912 -0
  252. package/Meshes/GaussianSplatting/gaussianSplattingGpuSorter.js.map +1 -0
  253. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +3 -0
  254. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +40 -9
  255. package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
  256. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +112 -8
  257. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +696 -74
  258. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  259. package/Meshes/abstractMesh.pure.js +12 -4
  260. package/Meshes/abstractMesh.pure.js.map +1 -1
  261. package/Meshes/geometry.d.ts +5 -0
  262. package/Meshes/geometry.js +25 -0
  263. package/Meshes/geometry.js.map +1 -1
  264. package/Meshes/index.d.ts +1 -0
  265. package/Meshes/index.js +1 -0
  266. package/Meshes/index.js.map +1 -1
  267. package/Meshes/mesh.pure.d.ts +7 -0
  268. package/Meshes/mesh.pure.js +18 -13
  269. package/Meshes/mesh.pure.js.map +1 -1
  270. package/Meshes/pure.d.ts +1 -0
  271. package/Meshes/pure.js +1 -0
  272. package/Meshes/pure.js.map +1 -1
  273. package/Meshes/subMesh.pure.d.ts +3 -0
  274. package/Meshes/subMesh.pure.js +26 -0
  275. package/Meshes/subMesh.pure.js.map +1 -1
  276. package/Meshes/thinInstanceMesh.pure.js +5 -3
  277. package/Meshes/thinInstanceMesh.pure.js.map +1 -1
  278. package/Misc/index.d.ts +1 -0
  279. package/Misc/index.js +1 -0
  280. package/Misc/index.js.map +1 -1
  281. package/Misc/khronosTextureContainer2.d.ts +3 -2
  282. package/Misc/khronosTextureContainer2.js +24 -6
  283. package/Misc/khronosTextureContainer2.js.map +1 -1
  284. package/Misc/khronosTextureContainer2Encoder.d.ts +166 -0
  285. package/Misc/khronosTextureContainer2Encoder.js +556 -0
  286. package/Misc/khronosTextureContainer2Encoder.js.map +1 -0
  287. package/Misc/khronosTextureContainer2EncoderWorker.d.ts +61 -0
  288. package/Misc/khronosTextureContainer2EncoderWorker.js +55 -0
  289. package/Misc/khronosTextureContainer2EncoderWorker.js.map +1 -0
  290. package/Misc/pure.d.ts +1 -0
  291. package/Misc/pure.js +1 -0
  292. package/Misc/pure.js.map +1 -1
  293. package/Misc/textureFormat.functions.d.ts +6 -0
  294. package/Misc/textureFormat.functions.js +54 -0
  295. package/Misc/textureFormat.functions.js.map +1 -0
  296. package/Misc/textureTools.d.ts +6 -2
  297. package/Misc/textureTools.js +100 -42
  298. package/Misc/textureTools.js.map +1 -1
  299. package/Misc/tools.pure.js +1 -1
  300. package/Misc/tools.pure.js.map +1 -1
  301. package/Particles/Node/Blocks/systemBlock.pure.d.ts +1 -1
  302. package/Particles/Node/Blocks/systemBlock.pure.js +6 -3
  303. package/Particles/Node/Blocks/systemBlock.pure.js.map +1 -1
  304. package/Particles/computeShaderParticleSystem.pure.js +5 -0
  305. package/Particles/computeShaderParticleSystem.pure.js.map +1 -1
  306. package/Particles/gpuParticleSystem.pure.d.ts +2 -0
  307. package/Particles/gpuParticleSystem.pure.js +25 -1
  308. package/Particles/gpuParticleSystem.pure.js.map +1 -1
  309. package/Particles/solidParticle.d.ts +5 -0
  310. package/Particles/solidParticle.js +5 -0
  311. package/Particles/solidParticle.js.map +1 -1
  312. package/Particles/solidParticleSystem.d.ts +10 -0
  313. package/Particles/solidParticleSystem.js +72 -13
  314. package/Particles/solidParticleSystem.js.map +1 -1
  315. package/Particles/thinParticleSystem.pure.js +4 -0
  316. package/Particles/thinParticleSystem.pure.js.map +1 -1
  317. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.d.ts +27 -6
  318. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.js +60 -5
  319. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.pure.js.map +1 -1
  320. package/PostProcesses/thinTAAPostProcess.d.ts +1 -0
  321. package/PostProcesses/thinTAAPostProcess.js +17 -1
  322. package/PostProcesses/thinTAAPostProcess.js.map +1 -1
  323. package/PostProcesses/volumetricLightScatteringPostProcess.pure.d.ts +2 -1
  324. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js +6 -5
  325. package/PostProcesses/volumetricLightScatteringPostProcess.pure.js.map +1 -1
  326. package/Rendering/boundingBoxRenderer.pure.js +2 -3
  327. package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
  328. package/Rendering/geometryBufferRenderer.pure.js +8 -2
  329. package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
  330. package/Rendering/objectRenderer.d.ts +1 -0
  331. package/Rendering/objectRenderer.js +14 -0
  332. package/Rendering/objectRenderer.js.map +1 -1
  333. package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js +2 -2
  334. package/Shaders/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
  335. package/Shaders/ShadersInclude/bumpVertex.js +1 -1
  336. package/Shaders/ShadersInclude/bumpVertex.js.map +1 -1
  337. package/Shaders/ShadersInclude/bumpVertexDeclaration.js +1 -1
  338. package/Shaders/ShadersInclude/bumpVertexDeclaration.js.map +1 -1
  339. package/Shaders/ShadersInclude/hdrFilteringFunctions.js +5 -1
  340. package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  341. package/Shaders/ShadersInclude/helperFunctions.js +2 -2
  342. package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
  343. package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
  344. package/Shaders/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
  345. package/Shaders/ShadersInclude/openpbrVertexDeclaration.js +6 -0
  346. package/Shaders/ShadersInclude/openpbrVertexDeclaration.js.map +1 -1
  347. package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js +11 -1
  348. package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
  349. package/Shaders/ShadersInclude/pbrBlockNormalFinal.js +9 -0
  350. package/Shaders/ShadersInclude/pbrBlockNormalFinal.js.map +1 -1
  351. package/Shaders/ShadersInclude/pbrBlockReflectance.js +1 -1
  352. package/Shaders/ShadersInclude/pbrBlockReflectance.js.map +1 -1
  353. package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js +1 -1
  354. package/Shaders/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -1
  355. package/Shaders/ShadersInclude/pbrFragmentDeclaration.js +7 -1
  356. package/Shaders/ShadersInclude/pbrFragmentDeclaration.js.map +1 -1
  357. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
  358. package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  359. package/Shaders/ShadersInclude/pbrIBLFunctions.js +12 -0
  360. package/Shaders/ShadersInclude/pbrIBLFunctions.js.map +1 -1
  361. package/Shaders/ShadersInclude/pbrUboDeclaration.js +1 -1
  362. package/Shaders/ShadersInclude/pbrUboDeclaration.js.map +1 -1
  363. package/Shaders/ShadersInclude/pbrVertexDeclaration.js +3 -0
  364. package/Shaders/ShadersInclude/pbrVertexDeclaration.js.map +1 -1
  365. package/Shaders/geometry.vertex.js +6 -6
  366. package/Shaders/geometry.vertex.js.map +1 -1
  367. package/Shaders/gpuUpdateParticles.vertex.js +1 -1
  368. package/Shaders/gpuUpdateParticles.vertex.js.map +1 -1
  369. package/Shaders/lod.fragment.js +15 -2
  370. package/Shaders/lod.fragment.js.map +1 -1
  371. package/Shaders/lod3D.fragment.js +15 -2
  372. package/Shaders/lod3D.fragment.js.map +1 -1
  373. package/Shaders/lodCube.fragment.js +15 -2
  374. package/Shaders/lodCube.fragment.js.map +1 -1
  375. package/Shaders/openpbr.vertex.js +2 -0
  376. package/Shaders/openpbr.vertex.js.map +1 -1
  377. package/Shaders/pbr.fragment.js +12 -1
  378. package/Shaders/pbr.fragment.js.map +1 -1
  379. package/Shaders/pbr.vertex.js +2 -0
  380. package/Shaders/pbr.vertex.js.map +1 -1
  381. package/Shaders/textureMerger.fragment.js +28 -0
  382. package/Shaders/textureMerger.fragment.js.map +1 -1
  383. package/Shaders/textureProcessor.fragment.js +26 -4
  384. package/Shaders/textureProcessor.fragment.js.map +1 -1
  385. package/Shaders/volumetricLightScattering.fragment.js +1 -1
  386. package/Shaders/volumetricLightScattering.fragment.js.map +1 -1
  387. package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js +2 -2
  388. package/ShadersWGSL/ShadersInclude/bumpFragmentMainFunctions.js.map +1 -1
  389. package/ShadersWGSL/ShadersInclude/bumpVertex.js +1 -1
  390. package/ShadersWGSL/ShadersInclude/bumpVertex.js.map +1 -1
  391. package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js +1 -1
  392. package/ShadersWGSL/ShadersInclude/bumpVertexDeclaration.js.map +1 -1
  393. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js +1 -1
  394. package/ShadersWGSL/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  395. package/ShadersWGSL/ShadersInclude/helperFunctions.js +2 -2
  396. package/ShadersWGSL/ShadersInclude/helperFunctions.js.map +1 -1
  397. package/ShadersWGSL/ShadersInclude/lightFragment.js +44 -2
  398. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  399. package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js +17 -3
  400. package/ShadersWGSL/ShadersInclude/lightUboDeclaration.js.map +1 -1
  401. package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js +12 -1
  402. package/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js.map +1 -1
  403. package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js +1 -1
  404. package/ShadersWGSL/ShadersInclude/openpbrBackgroundTransmission.js.map +1 -1
  405. package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js +11 -1
  406. package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
  407. package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js +9 -0
  408. package/ShadersWGSL/ShadersInclude/pbrBlockNormalFinal.js.map +1 -1
  409. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js +1 -1
  410. package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js.map +1 -1
  411. package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.js +1 -1
  412. package/ShadersWGSL/ShadersInclude/pbrClusteredLightingFunctions.js.map +1 -1
  413. package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js +1 -1
  414. package/ShadersWGSL/ShadersInclude/pbrDirectLightingSetupFunctions.js.map +1 -1
  415. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js +1 -0
  416. package/ShadersWGSL/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
  417. package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js +8 -0
  418. package/ShadersWGSL/ShadersInclude/pbrIBLFunctions.js.map +1 -1
  419. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js +1 -1
  420. package/ShadersWGSL/ShadersInclude/pbrUboDeclaration.js.map +1 -1
  421. package/ShadersWGSL/ShadersInclude/prePassVertex.js +2 -2
  422. package/ShadersWGSL/ShadersInclude/prePassVertex.js.map +1 -1
  423. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js +1 -1
  424. package/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.js.map +1 -1
  425. package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js +3 -1
  426. package/ShadersWGSL/ShadersInclude/sceneUboDeclaration.js.map +1 -1
  427. package/ShadersWGSL/ShadersInclude/shadowsVertex.js +16 -0
  428. package/ShadersWGSL/ShadersInclude/shadowsVertex.js.map +1 -1
  429. package/ShadersWGSL/default.fragment.js +4 -4
  430. package/ShadersWGSL/default.fragment.js.map +1 -1
  431. package/ShadersWGSL/default.vertex.js +1 -1
  432. package/ShadersWGSL/default.vertex.js.map +1 -1
  433. package/ShadersWGSL/gaussianSplatting.vertex.js +3 -3
  434. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  435. package/ShadersWGSL/gpuUpdateParticles.compute.js +1 -1
  436. package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
  437. package/ShadersWGSL/gsSortCount.compute.d.ts +5 -0
  438. package/ShadersWGSL/gsSortCount.compute.js +19 -0
  439. package/ShadersWGSL/gsSortCount.compute.js.map +1 -0
  440. package/ShadersWGSL/gsSortKeys.compute.d.ts +5 -0
  441. package/ShadersWGSL/gsSortKeys.compute.js +49 -0
  442. package/ShadersWGSL/gsSortKeys.compute.js.map +1 -0
  443. package/ShadersWGSL/gsSortOutput.compute.d.ts +5 -0
  444. package/ShadersWGSL/gsSortOutput.compute.js +28 -0
  445. package/ShadersWGSL/gsSortOutput.compute.js.map +1 -0
  446. package/ShadersWGSL/gsSortScanLocal.compute.d.ts +5 -0
  447. package/ShadersWGSL/gsSortScanLocal.compute.js +23 -0
  448. package/ShadersWGSL/gsSortScanLocal.compute.js.map +1 -0
  449. package/ShadersWGSL/gsSortScanSums.compute.d.ts +5 -0
  450. package/ShadersWGSL/gsSortScanSums.compute.js +19 -0
  451. package/ShadersWGSL/gsSortScanSums.compute.js.map +1 -0
  452. package/ShadersWGSL/gsSortScatter.compute.d.ts +5 -0
  453. package/ShadersWGSL/gsSortScatter.compute.js +33 -0
  454. package/ShadersWGSL/gsSortScatter.compute.js.map +1 -0
  455. package/ShadersWGSL/lod.fragment.js +14 -2
  456. package/ShadersWGSL/lod.fragment.js.map +1 -1
  457. package/ShadersWGSL/lod3D.fragment.js +14 -2
  458. package/ShadersWGSL/lod3D.fragment.js.map +1 -1
  459. package/ShadersWGSL/lodCube.fragment.js +14 -2
  460. package/ShadersWGSL/lodCube.fragment.js.map +1 -1
  461. package/ShadersWGSL/openpbr.vertex.js +3 -1
  462. package/ShadersWGSL/openpbr.vertex.js.map +1 -1
  463. package/ShadersWGSL/pbr.fragment.js +11 -0
  464. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  465. package/ShadersWGSL/pbr.vertex.js +3 -1
  466. package/ShadersWGSL/pbr.vertex.js.map +1 -1
  467. package/ShadersWGSL/textureMerger.fragment.js +40 -4
  468. package/ShadersWGSL/textureMerger.fragment.js.map +1 -1
  469. package/ShadersWGSL/textureProcessor.fragment.js +26 -4
  470. package/ShadersWGSL/textureProcessor.fragment.js.map +1 -1
  471. package/Sprites/spriteRenderer.js +15 -5
  472. package/Sprites/spriteRenderer.js.map +1 -1
  473. package/package.json +1 -1
  474. package/scene.pure.d.ts +23 -1
  475. package/scene.pure.js +83 -1
  476. package/scene.pure.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"prePassVertex.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/prePassVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,MAAM,IAAI,GAAG,eAAe,CAAC;AAC7B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"prePassVertex\";\nconst shader = `#ifdef PREPASS_DEPTH\nvertexOutputs.vViewPos=(scene.view*worldPos).rgb;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvertexOutputs.vNormViewDepth=((scene.view*worldPos).z-uniforms.cameraInfo.x)/(uniforms.cameraInfo.y-uniforms.cameraInfo.x);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvertexOutputs.vPosition=positionUpdated.xyz;\n#endif\n#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)\nvertexOutputs.vCurrentPosition=scene.viewProjection*worldPos;\n#if NUM_BONE_INFLUENCERS>0\nvar previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\n#endif\nvertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);\n#else\nvertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const prePassVertexWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"prePassVertex.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/prePassVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,MAAM,IAAI,GAAG,eAAe,CAAC;AAC7B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"prePassVertex\";\nconst shader = `#ifdef PREPASS_DEPTH\nvertexOutputs.vViewPos=(scene.view*worldPos).rgb;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvertexOutputs.vNormViewDepth=((scene.view*worldPos).z-uniforms.cameraInfo.x)/(uniforms.cameraInfo.y-uniforms.cameraInfo.x);\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvertexOutputs.vPosition=positionUpdated.xyz;\n#endif\n#if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED)\nvertexOutputs.vCurrentPosition=scene.viewProjection*worldPos;\n#if NUM_BONE_INFLUENCERS>0\nvar previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];\n#if NUM_BONE_INFLUENCERS>1\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];\n#endif \n#if NUM_BONE_INFLUENCERS>2\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];\n#endif \n#if NUM_BONE_INFLUENCERS>3\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];\n#endif\n#if NUM_BONE_INFLUENCERS>4\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];\n#endif \n#if NUM_BONE_INFLUENCERS>5\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];\n#endif \n#if NUM_BONE_INFLUENCERS>6\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];\n#endif \n#if NUM_BONE_INFLUENCERS>7\npreviousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];\n#endif\nvertexOutputs.vPreviousPosition=scene.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);\n#else\nvertexOutputs.vPreviousPosition=scene.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const prePassVertexWGSL = { name, shader };\n"]}
@@ -12,7 +12,7 @@ varying vViewPos: vec3f;
12
12
  varying vNormViewDepth: f32;
13
13
  #endif
14
14
  #if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
15
- uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
15
+ varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
16
16
  #endif
17
17
  #endif
18
18
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"prePassVertexDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;CAcd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"prePassVertexDeclaration\";\nconst shader = `#ifdef PREPASS\n#ifdef PREPASS_LOCAL_POSITION\nvarying vPosition : vec3f;\n#endif\n#ifdef PREPASS_DEPTH\nvarying vViewPos: vec3f;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying vNormViewDepth: f32;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nuniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const prePassVertexDeclarationWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"prePassVertexDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/prePassVertexDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;CAcd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"prePassVertexDeclaration\";\nconst shader = `#ifdef PREPASS\n#ifdef PREPASS_LOCAL_POSITION\nvarying vPosition : vec3f;\n#endif\n#ifdef PREPASS_DEPTH\nvarying vViewPos: vec3f;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying vNormViewDepth: f32;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvarying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const prePassVertexDeclarationWGSL = { name, shader };\n"]}
@@ -8,7 +8,9 @@ viewProjectionR : mat4x4<f32>,
8
8
  view : mat4x4<f32>,
9
9
  projection : mat4x4<f32>,
10
10
  vEyePosition : vec4<f32>,
11
- inverseProjection : mat4x4<f32>,};
11
+ inverseProjection : mat4x4<f32>,
12
+ previousViewProjection : mat4x4<f32>,
13
+ taaJitter : vec2<f32>,};
12
14
  #define SCENE_UBO
13
15
  var<uniform> scene : Scene;
14
16
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"sceneUboDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/sceneUboDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,MAAM,IAAI,GAAG,qBAAqB,CAAC;AACnC,MAAM,MAAM,GAAG;;;;;;;;;;CAUd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"sceneUboDeclaration\";\nconst shader = `struct Scene {viewProjection : mat4x4<f32>,\n#ifdef MULTIVIEW\nviewProjectionR : mat4x4<f32>,\n#endif \nview : mat4x4<f32>,\nprojection : mat4x4<f32>,\nvEyePosition : vec4<f32>,\ninverseProjection : mat4x4<f32>,};\n#define SCENE_UBO\nvar<uniform> scene : Scene;\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const sceneUboDeclarationWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"sceneUboDeclaration.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/sceneUboDeclaration.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,MAAM,IAAI,GAAG,qBAAqB,CAAC;AACnC,MAAM,MAAM,GAAG;;;;;;;;;;;;CAYd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"sceneUboDeclaration\";\nconst shader = `struct Scene {viewProjection : mat4x4<f32>,\n#ifdef MULTIVIEW\nviewProjectionR : mat4x4<f32>,\n#endif \nview : mat4x4<f32>,\nprojection : mat4x4<f32>,\nvEyePosition : vec4<f32>,\ninverseProjection : mat4x4<f32>,\npreviousViewProjection : mat4x4<f32>,\ntaaJitter : vec2<f32>,};\n#define SCENE_UBO\nvar<uniform> scene : Scene;\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const sceneUboDeclarationWGSL = { name, shader };\n"]}
@@ -9,7 +9,11 @@ vertexOutputs.vPositionFromCamera{X}=scene.view*worldPos;
9
9
  vertexOutputs.vPositionFromCamera{X}=uniforms.view*worldPos;
10
10
  #endif
11
11
  #if SHADOWCSMNUM_CASCADES{X}>0
12
+ #ifdef SHADOWCSMUBO{X}
13
+ vertexOutputs.vPositionFromLight{X}_0=cascades{X}.lightMatrix[0]*worldPos;
14
+ #else
12
15
  vertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos;
16
+ #endif
13
17
  #ifdef USE_REVERSE_DEPTHBUFFER
14
18
  vertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
15
19
  #else
@@ -17,7 +21,11 @@ vertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{
17
21
  #endif
18
22
  #endif
19
23
  #if SHADOWCSMNUM_CASCADES{X}>1
24
+ #ifdef SHADOWCSMUBO{X}
25
+ vertexOutputs.vPositionFromLight{X}_1=cascades{X}.lightMatrix[1]*worldPos;
26
+ #else
20
27
  vertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos;
28
+ #endif
21
29
  #ifdef USE_REVERSE_DEPTHBUFFER
22
30
  vertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
23
31
  #else
@@ -25,7 +33,11 @@ vertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{
25
33
  #endif
26
34
  #endif
27
35
  #if SHADOWCSMNUM_CASCADES{X}>2
36
+ #ifdef SHADOWCSMUBO{X}
37
+ vertexOutputs.vPositionFromLight{X}_2=cascades{X}.lightMatrix[2]*worldPos;
38
+ #else
28
39
  vertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos;
40
+ #endif
29
41
  #ifdef USE_REVERSE_DEPTHBUFFER
30
42
  vertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
31
43
  #else
@@ -33,7 +45,11 @@ vertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{
33
45
  #endif
34
46
  #endif
35
47
  #if SHADOWCSMNUM_CASCADES{X}>3
48
+ #ifdef SHADOWCSMUBO{X}
49
+ vertexOutputs.vPositionFromLight{X}_3=cascades{X}.lightMatrix[3]*worldPos;
50
+ #else
36
51
  vertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos;
52
+ #endif
37
53
  #ifdef USE_REVERSE_DEPTHBUFFER
38
54
  vertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
39
55
  #else
@@ -1 +1 @@
1
- {"version":3,"file":"shadowsVertex.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/shadowsVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,MAAM,IAAI,GAAG,eAAe,CAAC;AAC7B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"shadowsVertex\";\nconst shader = `#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\n#ifdef SCENE_UBO\nvertexOutputs.vPositionFromCamera{X}=scene.view*worldPos;\n#else\nvertexOutputs.vPositionFromCamera{X}=uniforms.view*worldPos;\n#endif\n#if SHADOWCSMNUM_CASCADES{X}>0\nvertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#if SHADOWCSMNUM_CASCADES{X}>1\nvertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#if SHADOWCSMNUM_CASCADES{X}>2\nvertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#if SHADOWCSMNUM_CASCADES{X}>3\nvertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const shadowsVertexWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"shadowsVertex.js","sourceRoot":"","sources":["../../../../../dev/core/src/ShadersWGSL/ShadersInclude/shadowsVertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,MAAM,IAAI,GAAG,eAAe,CAAC;AAC7B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,WAAW,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxD,CAAC;AACD,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../../Engines/shaderStore\";\nconst name = \"shadowsVertex\";\nconst shader = `#ifdef SHADOWS\n#if defined(SHADOWCSM{X})\n#ifdef SCENE_UBO\nvertexOutputs.vPositionFromCamera{X}=scene.view*worldPos;\n#else\nvertexOutputs.vPositionFromCamera{X}=uniforms.view*worldPos;\n#endif\n#if SHADOWCSMNUM_CASCADES{X}>0\n#ifdef SHADOWCSMUBO{X}\nvertexOutputs.vPositionFromLight{X}_0=cascades{X}.lightMatrix[0]*worldPos;\n#else\nvertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos;\n#endif\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#if SHADOWCSMNUM_CASCADES{X}>1\n#ifdef SHADOWCSMUBO{X}\nvertexOutputs.vPositionFromLight{X}_1=cascades{X}.lightMatrix[1]*worldPos;\n#else\nvertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos;\n#endif\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#if SHADOWCSMNUM_CASCADES{X}>2\n#ifdef SHADOWCSMUBO{X}\nvertexOutputs.vPositionFromLight{X}_2=cascades{X}.lightMatrix[2]*worldPos;\n#else\nvertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos;\n#endif\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#if SHADOWCSMNUM_CASCADES{X}>3\n#ifdef SHADOWCSMUBO{X}\nvertexOutputs.vPositionFromLight{X}_3=cascades{X}.lightMatrix[3]*worldPos;\n#else\nvertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos;\n#endif\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif \n#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})\nvertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos;\n#ifdef USE_REVERSE_DEPTHBUFFER\nvertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#else\nvertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;\n#endif\n#endif\n#endif\n`;\n// Sideeffect\nif (!ShaderStore.IncludesShadersStoreWGSL[name]) {\n ShaderStore.IncludesShadersStoreWGSL[name] = shader;\n}\n/** @internal */\nexport const shadowsVertexWGSL = { name, shader };\n"]}
@@ -226,17 +226,17 @@ reflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflection
226
226
  var reflectionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.reflectionRightColor.a,uniforms.reflectionLeftColor.a);
227
227
  #ifdef REFLECTIONFRESNELFROMSPECULAR
228
228
  #ifdef SPECULARTERM
229
- reflectionColor=vec4f(reflectionColor.rgb*specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);
229
+ reflectionColor=vec4f(reflectionColor.rgb*(specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb),reflectionColor.a);
230
230
  #else
231
- reflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);
231
+ reflectionColor=vec4f(reflectionColor.rgb*(uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb),reflectionColor.a);
232
232
  #endif
233
233
  #else
234
- reflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);
234
+ reflectionColor=vec4f(reflectionColor.rgb*(uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb),reflectionColor.a);
235
235
  #endif
236
236
  #endif
237
237
  #endif
238
238
  #ifdef REFRACTIONFRESNEL
239
- var refractionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.refractionRightColor.a,uniforms.refractionLeftColor.a);refractionColor=vec4f(refractionColor.rgb*uniforms.refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*uniforms.refractionRightColor.rgb,refractionColor.a);
239
+ var refractionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.refractionRightColor.a,uniforms.refractionLeftColor.a);refractionColor=vec4f(refractionColor.rgb*(uniforms.refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*uniforms.refractionRightColor.rgb),refractionColor.a);
240
240
  #endif
241
241
  #include<defaultFragmentAlpha>
242
242
  var emissiveColor: vec3f=uniforms.vEmissiveColor;
@@ -1 +1 @@
1
- {"version":3,"file":"default.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/default.fragment.ts"],"names":[],"mappings":"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","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { defaultUboDeclarationWGSL } from \"./ShadersInclude/defaultUboDeclaration\";\nimport { objectIdFunctionsWGSL } from \"./ShadersInclude/objectIdFunctions\";\nimport { prePassDeclarationWGSL } from \"./ShadersInclude/prePassDeclaration\";\nimport { oitDeclarationWGSL } from \"./ShadersInclude/oitDeclaration\";\nimport { mainUVVaryingDeclarationWGSL } from \"./ShadersInclude/mainUVVaryingDeclaration\";\nimport { helperFunctionsWGSL } from \"./ShadersInclude/helperFunctions\";\nimport { lightUboDeclarationWGSL } from \"./ShadersInclude/lightUboDeclaration\";\nimport { ltcHelperFunctionsWGSL } from \"./ShadersInclude/ltcHelperFunctions\";\nimport { clusteredLightingFunctionsWGSL } from \"./ShadersInclude/clusteredLightingFunctions\";\nimport { clusteredLightingComputeWGSL } from \"./ShadersInclude/clusteredLightingCompute\";\nimport { lightsFragmentFunctionsWGSL } from \"./ShadersInclude/lightsFragmentFunctions\";\nimport { shadowsFragmentFunctionsWGSL } from \"./ShadersInclude/shadowsFragmentFunctions\";\nimport { samplerFragmentDeclarationWGSL } from \"./ShadersInclude/samplerFragmentDeclaration\";\nimport { fresnelFunctionWGSL } from \"./ShadersInclude/fresnelFunction\";\nimport { reflectionFunctionWGSL } from \"./ShadersInclude/reflectionFunction\";\nimport { imageProcessingDeclarationWGSL } from \"./ShadersInclude/imageProcessingDeclaration\";\nimport { imageProcessingFunctionsWGSL } from \"./ShadersInclude/imageProcessingFunctions\";\nimport { textureRepetitionFunctionsWGSL } from \"./ShadersInclude/textureRepetitionFunctions\";\nimport { bumpFragmentMainFunctionsWGSL } from \"./ShadersInclude/bumpFragmentMainFunctions\";\nimport { bumpFragmentFunctionsWGSL } from \"./ShadersInclude/bumpFragmentFunctions\";\nimport { clipPlaneFragmentDeclarationWGSL } from \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport { logDepthDeclarationWGSL } from \"./ShadersInclude/logDepthDeclaration\";\nimport { fogFragmentDeclarationWGSL } from \"./ShadersInclude/fogFragmentDeclaration\";\nimport { clipPlaneFragmentWGSL } from \"./ShadersInclude/clipPlaneFragment\";\nimport { bumpFragmentWGSL } from \"./ShadersInclude/bumpFragment\";\nimport { decalFragmentWGSL } from \"./ShadersInclude/decalFragment\";\nimport { defaultFragmentAlphaWGSL } from \"./ShadersInclude/defaultFragmentAlpha\";\nimport { depthPrePassWGSL } from \"./ShadersInclude/depthPrePass\";\nimport { lightFragmentWGSL } from \"./ShadersInclude/lightFragment\";\nimport { logDepthFragmentWGSL } from \"./ShadersInclude/logDepthFragment\";\nimport { fogFragmentWGSL } from \"./ShadersInclude/fogFragment\";\nimport { meshBlendTagFragmentOutputWGSL } from \"./ShadersInclude/meshBlendTagFragmentOutput\";\nimport { oitFragmentWGSL } from \"./ShadersInclude/oitFragment\";\n\nconst name = \"defaultPixelShader\";\nconst shader = `#include<defaultUboDeclaration>\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#include<oitDeclaration>\n#define CUSTOM_FRAGMENT_BEGIN\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#include<mainUVVaryingDeclaration>[1..7]\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nvar refractionCubeSamplerSampler: sampler;var refractionCubeSampler: texture_cube<f32>;\n#else\nvar refraction2DSamplerSampler: sampler;var refraction2DSampler: texture_2d<f32>;\n#endif\n#endif\n#if defined(SPECULARTERM)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)\n#endif\n#include<fresnelFunction>\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nvar reflectionCubeSamplerSampler: sampler;var reflectionCubeSampler: texture_cube<f32>;\n#else\nvar reflection2DSamplerSampler: sampler;var reflection2DSampler: texture_2d<f32>;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<textureRepetitionFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f=normalize(cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)))* scene.vEyePosition.w;\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=select(-normalW,normalW,fragmentInputs.frontFacing);\n#endif\n#ifdef DIFFUSE\nbaseColor=TEXRD(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV+uvOffset);\n#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<uniforms.alphaCutOff) {discard;}\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#if defined(DECAL) && !defined(DECAL_AFTER_DETAIL)\nvar decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);\n#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#ifdef DEPTHPREPASS\n#include<defaultFragmentAlpha>\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef DETAIL\nbaseColor=vec4f(baseColor.rgb*2.0*mix(0.5,detailColor.r,uniforms.vDetailInfos.y),baseColor.a);\n#endif\n#if defined(DECAL) && defined(DECAL_AFTER_DETAIL)\nvar decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);\n#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\nvar baseAmbientColor: vec3f= vec3f(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=TEXRD(ambientSampler,ambientSamplerSampler,fragmentInputs.vAmbientUV+uvOffset).rgb*uniforms.vAmbientInfos.y;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\nvar specularMapColor: vec4f=TEXRD(specularSampler,specularSamplerSampler,fragmentInputs.vSpecularUV+uvOffset);specularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\nvar shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef LIGHTMAP\nvar lightmapColor: vec4f=TEXRD(lightmapSampler,lightmapSamplerSampler,fragmentInputs.vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor=vec4f(fromRGBD(lightmapColor),lightmapColor.a);\n#endif\nlightmapColor=vec4f(lightmapColor.rgb*uniforms.vLightmapInfos.y,lightmapColor.a);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\naggShadow=aggShadow/numLights;var refractionColor: vec4f= vec4f(0.,0.,0.,1.);\n#ifdef REFRACTION\nvar refractionVector: vec3f=normalize(refract(-viewDirectionW,normalW,uniforms.vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\n#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(fragmentInputs.vPositionW,refractionVector,uniforms.vRefractionSize,uniforms.vRefractionPosition);\n#endif\nrefractionVector.y=refractionVector.y*uniforms.vRefractionInfos.w;var refractionLookup: vec4f=textureSample(refractionCubeSampler,refractionCubeSamplerSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;}\n#else\nvar vRefractionUVW: vec3f= (uniforms.refractionMatrix*(scene.view* vec4f(fragmentInputs.vPositionW+refractionVector*uniforms.vRefractionInfos.z,1.0))).xyz;var refractionCoords: vec2f=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=textureSample(refraction2DSampler,refraction2DSamplerSampler,refractionCoords);\n#endif\n#ifdef RGBDREFRACTION\nrefractionColor=vec4f(fromRGBD(refractionColor),refractionColor.a);\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor=vec4f(toGammaSpaceVec3(refractionColor.rgb),refractionColor.a);\n#endif\nrefractionColor=vec4f(refractionColor.rgb*uniforms.vRefractionInfos.x,refractionColor.a);\n#endif\nvar reflectionColor: vec4f= vec4f(0.,0.,0.,1.);\n#ifdef REFLECTION\nvar vReflectionUVW: vec3f=computeReflectionCoords( vec4f(fragmentInputs.vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nvReflectionUVW=vec3f(vReflectionUVW.x,vReflectionUVW.y,vReflectionUVW.z*-1.0);\n#endif\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nvar bias: f32=uniforms.vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureSampleLevel(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW,bias);\n#else\nreflectionColor=textureSample(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW);\n#endif\n#else\nvar coords: vec2f=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;reflectionColor=textureSample(reflection2DSampler,reflection2DSamplerSampler,coords);\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor=vec4f(fromRGBD(reflectionColor),reflectionColor.a);\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor=vec4f(toGammaSpaceVec3(reflectionColor.rgb),reflectionColor.a);\n#endif\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflectionColor.a);\n#ifdef REFLECTIONFRESNEL\nvar reflectionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.reflectionRightColor.a,uniforms.reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor=vec4f(reflectionColor.rgb*specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);\n#else\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);\n#endif\n#else\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb,reflectionColor.a);\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nvar refractionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.refractionRightColor.a,uniforms.refractionLeftColor.a);refractionColor=vec4f(refractionColor.rgb*uniforms.refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*uniforms.refractionRightColor.rgb,refractionColor.a);\n#endif\n#include<defaultFragmentAlpha>\nvar emissiveColor: vec3f=uniforms.vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=TEXRD(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vEmissiveUV+uvOffset).rgb*uniforms.vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nvar emissiveFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.emissiveRightColor.a,uniforms.emissiveLeftColor.a);emissiveColor*=uniforms.emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*uniforms.emissiveRightColor.rgb;\n#endif\n#ifdef DIFFUSEFRESNEL\nvar diffuseFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.diffuseRightColor.a,uniforms.diffuseLeftColor.a);diffuseBase*=uniforms.diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*uniforms.diffuseRightColor.rgb;\n#endif\n#ifdef EMISSIVEASILLUMINATION\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvar finalDiffuse: vec3f=clamp((diffuseBase+emissiveColor)*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#else\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+emissiveColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular, vec3f(0.3,0.59,0.11)),0.0,1.0);\n#endif\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb, vec3f(0.3,0.59,0.11)),0.0,1.0);\n#endif\n#ifdef EMISSIVEASILLUMINATION\nvar color: vec4f= vec4f(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,vec3f(0.0),vec3f(1.0)),alpha);\n#else\nvar color: vec4f= vec4f(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\n#endif\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor=vec4f(color.rgb*lightmapColor.rgb,color.a);\n#else\ncolor=vec4f(color.rgb+lightmapColor.rgb,color.a);\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor=vec4f(max(color.rgb,vec3f(0.)),color.a);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);\n#else\n#ifdef IMAGEPROCESSING\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);color=applyImageProcessing(color);\n#endif\n#endif\ncolor=vec4f(color.rgb,color.a*mesh.visibility);\n#ifdef PREMULTIPLYALPHA\ncolor=vec4f(color.rgb*color.a, color.a);\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\n#if SCENE_MRT_COUNT>0\n#ifdef ALPHATEST\nvar writeGeometryInfo: f32=1.0;\n#else\nvar writeGeometryInfo: f32=select(0.0,1.0,color.a>0.4);\n#endif\nvar fragData: array<vec4<f32>,SCENE_MRT_COUNT>;\n#ifdef PREPASS_MESH_BLEND_TAG\nvar meshBlendTagOutput: vec4<u32>=vec4u(0u);if (writeGeometryInfo>0.0) {meshBlendTagOutput=vec4u(u32(uniforms.meshBlendTag),0u,0u,0u);}\n#endif\n#ifdef PREPASS_COLOR\nfragData[PREPASS_COLOR_INDEX]=color; \n#endif\n#ifdef PREPASS_POSITION\nfragData[PREPASS_POSITION_INDEX]=vec4f(fragmentInputs.vPositionW,writeGeometryInfo);\n#endif\n#ifdef PREPASS_OBJECT_ID\nfragData[PREPASS_OBJECT_ID_INDEX]=encodeObjectId(uniforms.objectId)*writeGeometryInfo;\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nfragData[PREPASS_LOCAL_POSITION_INDEX]=vec4f(fragmentInputs.vPosition,writeGeometryInfo);\n#endif\n#ifdef PREPASS_VELOCITY\nvar a: vec2f=(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[PREPASS_VELOCITY_INDEX]= vec4f(velocity,0.0,writeGeometryInfo);\n#elif defined(PREPASS_VELOCITY_LINEAR)\nvar velocity : vec2f=vec2f(0.5)*((fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w) -\n(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w));fragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_IRRADIANCE\nfragData[PREPASS_IRRADIANCE_INDEX]=vec4f(0.0,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_DEPTH\nfragData[PREPASS_DEPTH_INDEX]=vec4f(fragmentInputs.vViewPos.z,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_SCREENSPACE_DEPTH\nfragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nfragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4f(fragmentInputs.vNormViewDepth,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMAL\n#ifdef PREPASS_NORMAL_WORLDSPACE\nfragData[PREPASS_NORMAL_INDEX]=vec4f(normalW,writeGeometryInfo);\n#else\nfragData[PREPASS_NORMAL_INDEX]=vec4f(normalize((scene.view*vec4f(normalW,0.0)).rgb),writeGeometryInfo);\n#endif\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nfragData[PREPASS_WORLD_NORMAL_INDEX]=vec4f(normalW*0.5+0.5,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO\nfragData[PREPASS_ALBEDO_INDEX]=vec4f(baseColor.rgb,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO_SQRT\nfragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4f(sqrt(baseColor.rgb),writeGeometryInfo);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(SPECULAR)\nfragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec4(specularMapColor))*writeGeometryInfo; \n#else\nfragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec3(specularColor),1.0)*writeGeometryInfo;\n#endif\n#endif\n#include<meshBlendTagFragmentOutput>[0..8]\n#endif\n#endif\n#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY)\nfragmentOutputs.color=color;\n#endif\n#include<oitFragment>\n#if ORDER_INDEPENDENT_TRANSPARENCY\nif (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+color.rgb*color.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-color.a));} else {fragmentOutputs.backColor+=color;}\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, defaultUboDeclarationWGSL, objectIdFunctionsWGSL, prePassDeclarationWGSL, oitDeclarationWGSL, mainUVVaryingDeclarationWGSL, helperFunctionsWGSL, lightUboDeclarationWGSL, ltcHelperFunctionsWGSL, clusteredLightingFunctionsWGSL, clusteredLightingComputeWGSL, lightsFragmentFunctionsWGSL, shadowsFragmentFunctionsWGSL, samplerFragmentDeclarationWGSL, fresnelFunctionWGSL, reflectionFunctionWGSL, imageProcessingDeclarationWGSL, imageProcessingFunctionsWGSL, textureRepetitionFunctionsWGSL, bumpFragmentMainFunctionsWGSL, bumpFragmentFunctionsWGSL, clipPlaneFragmentDeclarationWGSL, logDepthDeclarationWGSL, fogFragmentDeclarationWGSL, clipPlaneFragmentWGSL, bumpFragmentWGSL, decalFragmentWGSL, defaultFragmentAlphaWGSL, depthPrePassWGSL, lightFragmentWGSL, logDepthFragmentWGSL, fogFragmentWGSL, meshBlendTagFragmentOutputWGSL, oitFragmentWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const defaultPixelShaderWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"default.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/default.fragment.ts"],"names":[],"mappings":"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","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { defaultUboDeclarationWGSL } from \"./ShadersInclude/defaultUboDeclaration\";\nimport { objectIdFunctionsWGSL } from \"./ShadersInclude/objectIdFunctions\";\nimport { prePassDeclarationWGSL } from \"./ShadersInclude/prePassDeclaration\";\nimport { oitDeclarationWGSL } from \"./ShadersInclude/oitDeclaration\";\nimport { mainUVVaryingDeclarationWGSL } from \"./ShadersInclude/mainUVVaryingDeclaration\";\nimport { helperFunctionsWGSL } from \"./ShadersInclude/helperFunctions\";\nimport { lightUboDeclarationWGSL } from \"./ShadersInclude/lightUboDeclaration\";\nimport { ltcHelperFunctionsWGSL } from \"./ShadersInclude/ltcHelperFunctions\";\nimport { clusteredLightingFunctionsWGSL } from \"./ShadersInclude/clusteredLightingFunctions\";\nimport { clusteredLightingComputeWGSL } from \"./ShadersInclude/clusteredLightingCompute\";\nimport { lightsFragmentFunctionsWGSL } from \"./ShadersInclude/lightsFragmentFunctions\";\nimport { shadowsFragmentFunctionsWGSL } from \"./ShadersInclude/shadowsFragmentFunctions\";\nimport { samplerFragmentDeclarationWGSL } from \"./ShadersInclude/samplerFragmentDeclaration\";\nimport { fresnelFunctionWGSL } from \"./ShadersInclude/fresnelFunction\";\nimport { reflectionFunctionWGSL } from \"./ShadersInclude/reflectionFunction\";\nimport { imageProcessingDeclarationWGSL } from \"./ShadersInclude/imageProcessingDeclaration\";\nimport { imageProcessingFunctionsWGSL } from \"./ShadersInclude/imageProcessingFunctions\";\nimport { textureRepetitionFunctionsWGSL } from \"./ShadersInclude/textureRepetitionFunctions\";\nimport { bumpFragmentMainFunctionsWGSL } from \"./ShadersInclude/bumpFragmentMainFunctions\";\nimport { bumpFragmentFunctionsWGSL } from \"./ShadersInclude/bumpFragmentFunctions\";\nimport { clipPlaneFragmentDeclarationWGSL } from \"./ShadersInclude/clipPlaneFragmentDeclaration\";\nimport { logDepthDeclarationWGSL } from \"./ShadersInclude/logDepthDeclaration\";\nimport { fogFragmentDeclarationWGSL } from \"./ShadersInclude/fogFragmentDeclaration\";\nimport { clipPlaneFragmentWGSL } from \"./ShadersInclude/clipPlaneFragment\";\nimport { bumpFragmentWGSL } from \"./ShadersInclude/bumpFragment\";\nimport { decalFragmentWGSL } from \"./ShadersInclude/decalFragment\";\nimport { defaultFragmentAlphaWGSL } from \"./ShadersInclude/defaultFragmentAlpha\";\nimport { depthPrePassWGSL } from \"./ShadersInclude/depthPrePass\";\nimport { lightFragmentWGSL } from \"./ShadersInclude/lightFragment\";\nimport { logDepthFragmentWGSL } from \"./ShadersInclude/logDepthFragment\";\nimport { fogFragmentWGSL } from \"./ShadersInclude/fogFragment\";\nimport { meshBlendTagFragmentOutputWGSL } from \"./ShadersInclude/meshBlendTagFragmentOutput\";\nimport { oitFragmentWGSL } from \"./ShadersInclude/oitFragment\";\n\nconst name = \"defaultPixelShader\";\nconst shader = `#include<defaultUboDeclaration>\n#include<prePassDeclaration>[SCENE_MRT_COUNT]\n#include<oitDeclaration>\n#define CUSTOM_FRAGMENT_BEGIN\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#include<mainUVVaryingDeclaration>[1..7]\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_SAMPLERNAME_,diffuse)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_SAMPLERNAME_,ambient)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_SAMPLERNAME_,opacity)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_SAMPLERNAME_,emissive)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_SAMPLERNAME_,lightmap)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_SAMPLERNAME_,decal)\n#ifdef REFRACTION\n#ifdef REFRACTIONMAP_3D\nvar refractionCubeSamplerSampler: sampler;var refractionCubeSampler: texture_cube<f32>;\n#else\nvar refraction2DSamplerSampler: sampler;var refraction2DSampler: texture_2d<f32>;\n#endif\n#endif\n#if defined(SPECULARTERM)\n#include<samplerFragmentDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_SAMPLERNAME_,specular)\n#endif\n#include<fresnelFunction>\n#ifdef REFLECTION\n#ifdef REFLECTIONMAP_3D\nvar reflectionCubeSamplerSampler: sampler;var reflectionCubeSampler: texture_cube<f32>;\n#else\nvar reflection2DSamplerSampler: sampler;var reflection2DSampler: texture_2d<f32>;\n#endif\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#else\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#endif\n#endif\n#include<reflectionFunction>\n#endif\n#include<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<textureRepetitionFunctions>\n#include<bumpFragmentMainFunctions>\n#include<bumpFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(scene.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f=normalize(cross(dpdx(fragmentInputs.vPositionW),dpdy(fragmentInputs.vPositionW)))* scene.vEyePosition.w;\n#endif\n#include<bumpFragment>\n#ifdef TWOSIDEDLIGHTING\nnormalW=select(-normalW,normalW,fragmentInputs.frontFacing);\n#endif\n#ifdef DIFFUSE\nbaseColor=TEXRD(diffuseSampler,diffuseSamplerSampler,fragmentInputs.vDiffuseUV+uvOffset);\n#if defined(ALPHATEST) && !defined(ALPHATEST_AFTERALLALPHACOMPUTATIONS)\nif (baseColor.a<uniforms.alphaCutOff) {discard;}\n#endif\n#ifdef ALPHAFROMDIFFUSE\nalpha*=baseColor.a;\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_ALPHA\nbaseColor=vec4f(baseColor.rgb*uniforms.vDiffuseInfos.y,baseColor.a);\n#endif\n#if defined(DECAL) && !defined(DECAL_AFTER_DETAIL)\nvar decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);\n#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#ifdef DEPTHPREPASS\n#include<defaultFragmentAlpha>\n#endif\n#define DEPTHPREPASS_SKIP_EARLY_RETURN\n#include<depthPrePass>\n#ifndef DEPTHPREPASS\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\n#ifdef DETAIL\nbaseColor=vec4f(baseColor.rgb*2.0*mix(0.5,detailColor.r,uniforms.vDetailInfos.y),baseColor.a);\n#endif\n#if defined(DECAL) && defined(DECAL_AFTER_DETAIL)\nvar decalColor: vec4f=textureSample(decalSampler,decalSamplerSampler,fragmentInputs.vDecalUV+uvOffset);\n#include<decalFragment>(surfaceAlbedo,baseColor,GAMMADECAL,_GAMMADECAL_NOTUSED_)\n#endif\n#define CUSTOM_FRAGMENT_UPDATE_DIFFUSE\nvar baseAmbientColor: vec3f= vec3f(1.,1.,1.);\n#ifdef AMBIENT\nbaseAmbientColor=TEXRD(ambientSampler,ambientSamplerSampler,fragmentInputs.vAmbientUV+uvOffset).rgb*uniforms.vAmbientInfos.y;\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_LIGHTS\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\nvar specularMapColor: vec4f=TEXRD(specularSampler,specularSamplerSampler,fragmentInputs.vSpecularUV+uvOffset);specularColor=specularMapColor.rgb;\n#ifdef GLOSSINESS\nglossiness=glossiness*specularMapColor.a;\n#endif\n#endif\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\nvar shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef LIGHTMAP\nvar lightmapColor: vec4f=TEXRD(lightmapSampler,lightmapSamplerSampler,fragmentInputs.vLightmapUV+uvOffset);\n#ifdef RGBDLIGHTMAP\nlightmapColor=vec4f(fromRGBD(lightmapColor),lightmapColor.a);\n#endif\nlightmapColor=vec4f(lightmapColor.rgb*uniforms.vLightmapInfos.y,lightmapColor.a);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\naggShadow=aggShadow/numLights;var refractionColor: vec4f= vec4f(0.,0.,0.,1.);\n#ifdef REFRACTION\nvar refractionVector: vec3f=normalize(refract(-viewDirectionW,normalW,uniforms.vRefractionInfos.y));\n#ifdef REFRACTIONMAP_3D\n#ifdef USE_LOCAL_REFRACTIONMAP_CUBIC\nrefractionVector=parallaxCorrectNormal(fragmentInputs.vPositionW,refractionVector,uniforms.vRefractionSize,uniforms.vRefractionPosition);\n#endif\nrefractionVector.y=refractionVector.y*uniforms.vRefractionInfos.w;var refractionLookup: vec4f=textureSample(refractionCubeSampler,refractionCubeSamplerSampler,refractionVector);if (dot(refractionVector,viewDirectionW)<1.0) {refractionColor=refractionLookup;}\n#else\nvar vRefractionUVW: vec3f= (uniforms.refractionMatrix*(scene.view* vec4f(fragmentInputs.vPositionW+refractionVector*uniforms.vRefractionInfos.z,1.0))).xyz;var refractionCoords: vec2f=vRefractionUVW.xy/vRefractionUVW.z;refractionCoords.y=1.0-refractionCoords.y;refractionColor=textureSample(refraction2DSampler,refraction2DSamplerSampler,refractionCoords);\n#endif\n#ifdef RGBDREFRACTION\nrefractionColor=vec4f(fromRGBD(refractionColor),refractionColor.a);\n#endif\n#ifdef IS_REFRACTION_LINEAR\nrefractionColor=vec4f(toGammaSpaceVec3(refractionColor.rgb),refractionColor.a);\n#endif\nrefractionColor=vec4f(refractionColor.rgb*uniforms.vRefractionInfos.x,refractionColor.a);\n#endif\nvar reflectionColor: vec4f= vec4f(0.,0.,0.,1.);\n#ifdef REFLECTION\nvar vReflectionUVW: vec3f=computeReflectionCoords( vec4f(fragmentInputs.vPositionW,1.0),normalW);\n#ifdef REFLECTIONMAP_OPPOSITEZ\nvReflectionUVW=vec3f(vReflectionUVW.x,vReflectionUVW.y,vReflectionUVW.z*-1.0);\n#endif\n#ifdef REFLECTIONMAP_3D\n#ifdef ROUGHNESS\nvar bias: f32=uniforms.vReflectionInfos.y;\n#ifdef SPECULARTERM\n#ifdef SPECULAR\n#ifdef GLOSSINESS\nbias*=(1.0-specularMapColor.a);\n#endif\n#endif\n#endif\nreflectionColor=textureSampleLevel(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW,bias);\n#else\nreflectionColor=textureSample(reflectionCubeSampler,reflectionCubeSamplerSampler,vReflectionUVW);\n#endif\n#else\nvar coords: vec2f=vReflectionUVW.xy;\n#ifdef REFLECTIONMAP_PROJECTION\ncoords/=vReflectionUVW.z;\n#endif\ncoords.y=1.0-coords.y;reflectionColor=textureSample(reflection2DSampler,reflection2DSamplerSampler,coords);\n#endif\n#ifdef RGBDREFLECTION\nreflectionColor=vec4f(fromRGBD(reflectionColor),reflectionColor.a);\n#endif\n#ifdef IS_REFLECTION_LINEAR\nreflectionColor=vec4f(toGammaSpaceVec3(reflectionColor.rgb),reflectionColor.a);\n#endif\nreflectionColor=vec4f(reflectionColor.rgb*uniforms.vReflectionInfos.x,reflectionColor.a);\n#ifdef REFLECTIONFRESNEL\nvar reflectionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.reflectionRightColor.a,uniforms.reflectionLeftColor.a);\n#ifdef REFLECTIONFRESNELFROMSPECULAR\n#ifdef SPECULARTERM\nreflectionColor=vec4f(reflectionColor.rgb*(specularColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb),reflectionColor.a);\n#else\nreflectionColor=vec4f(reflectionColor.rgb*(uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb),reflectionColor.a);\n#endif\n#else\nreflectionColor=vec4f(reflectionColor.rgb*(uniforms.reflectionLeftColor.rgb*(1.0-reflectionFresnelTerm)+reflectionFresnelTerm*uniforms.reflectionRightColor.rgb),reflectionColor.a);\n#endif\n#endif\n#endif\n#ifdef REFRACTIONFRESNEL\nvar refractionFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.refractionRightColor.a,uniforms.refractionLeftColor.a);refractionColor=vec4f(refractionColor.rgb*(uniforms.refractionLeftColor.rgb*(1.0-refractionFresnelTerm)+refractionFresnelTerm*uniforms.refractionRightColor.rgb),refractionColor.a);\n#endif\n#include<defaultFragmentAlpha>\nvar emissiveColor: vec3f=uniforms.vEmissiveColor;\n#ifdef EMISSIVE\nemissiveColor+=TEXRD(emissiveSampler,emissiveSamplerSampler,fragmentInputs.vEmissiveUV+uvOffset).rgb*uniforms.vEmissiveInfos.y;\n#endif\n#ifdef EMISSIVEFRESNEL\nvar emissiveFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.emissiveRightColor.a,uniforms.emissiveLeftColor.a);emissiveColor*=uniforms.emissiveLeftColor.rgb*(1.0-emissiveFresnelTerm)+emissiveFresnelTerm*uniforms.emissiveRightColor.rgb;\n#endif\n#ifdef DIFFUSEFRESNEL\nvar diffuseFresnelTerm: f32=computeFresnelTerm(viewDirectionW,normalW,uniforms.diffuseRightColor.a,uniforms.diffuseLeftColor.a);diffuseBase*=uniforms.diffuseLeftColor.rgb*(1.0-diffuseFresnelTerm)+diffuseFresnelTerm*uniforms.diffuseRightColor.rgb;\n#endif\n#ifdef EMISSIVEASILLUMINATION\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#else\n#ifdef LINKEMISSIVEWITHDIFFUSE\nvar finalDiffuse: vec3f=clamp((diffuseBase+emissiveColor)*diffuseColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#else\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor+emissiveColor+uniforms.vAmbientColor,vec3f(0.0),vec3f(1.0))*baseColor.rgb;\n#endif\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#ifdef SPECULAROVERALPHA\nalpha=clamp(alpha+dot(finalSpecular, vec3f(0.3,0.59,0.11)),0.0,1.0);\n#endif\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\n#ifdef REFLECTIONOVERALPHA\nalpha=clamp(alpha+dot(reflectionColor.rgb, vec3f(0.3,0.59,0.11)),0.0,1.0);\n#endif\n#ifdef EMISSIVEASILLUMINATION\nvar color: vec4f= vec4f(clamp(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+emissiveColor+refractionColor.rgb,vec3f(0.0),vec3f(1.0)),alpha);\n#else\nvar color: vec4f= vec4f(finalDiffuse*baseAmbientColor+finalSpecular+reflectionColor.rgb+refractionColor.rgb,alpha);\n#endif\n#ifdef LIGHTMAP\n#ifndef LIGHTMAPEXCLUDED\n#ifdef USELIGHTMAPASSHADOWMAP\ncolor=vec4f(color.rgb*lightmapColor.rgb,color.a);\n#else\ncolor=vec4f(color.rgb+lightmapColor.rgb,color.a);\n#endif\n#endif\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FOG\ncolor=vec4f(max(color.rgb,vec3f(0.)),color.a);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);\n#else\n#ifdef IMAGEPROCESSING\ncolor=vec4f(toLinearSpaceVec3(color.rgb),color.a);color=applyImageProcessing(color);\n#endif\n#endif\ncolor=vec4f(color.rgb,color.a*mesh.visibility);\n#ifdef PREMULTIPLYALPHA\ncolor=vec4f(color.rgb*color.a, color.a);\n#endif\n#define CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR\n#ifdef PREPASS\n#if SCENE_MRT_COUNT>0\n#ifdef ALPHATEST\nvar writeGeometryInfo: f32=1.0;\n#else\nvar writeGeometryInfo: f32=select(0.0,1.0,color.a>0.4);\n#endif\nvar fragData: array<vec4<f32>,SCENE_MRT_COUNT>;\n#ifdef PREPASS_MESH_BLEND_TAG\nvar meshBlendTagOutput: vec4<u32>=vec4u(0u);if (writeGeometryInfo>0.0) {meshBlendTagOutput=vec4u(u32(uniforms.meshBlendTag),0u,0u,0u);}\n#endif\n#ifdef PREPASS_COLOR\nfragData[PREPASS_COLOR_INDEX]=color; \n#endif\n#ifdef PREPASS_POSITION\nfragData[PREPASS_POSITION_INDEX]=vec4f(fragmentInputs.vPositionW,writeGeometryInfo);\n#endif\n#ifdef PREPASS_OBJECT_ID\nfragData[PREPASS_OBJECT_ID_INDEX]=encodeObjectId(uniforms.objectId)*writeGeometryInfo;\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nfragData[PREPASS_LOCAL_POSITION_INDEX]=vec4f(fragmentInputs.vPosition,writeGeometryInfo);\n#endif\n#ifdef PREPASS_VELOCITY\nvar a: vec2f=(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w)*0.5+0.5;var b: vec2f=(fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w)*0.5+0.5;var velocity: vec2f=abs(a-b);velocity= vec2f(pow(velocity.x,1.0/3.0),pow(velocity.y,1.0/3.0))*sign(a-b)*0.5+0.5;fragData[PREPASS_VELOCITY_INDEX]= vec4f(velocity,0.0,writeGeometryInfo);\n#elif defined(PREPASS_VELOCITY_LINEAR)\nvar velocity : vec2f=vec2f(0.5)*((fragmentInputs.vPreviousPosition.xy/fragmentInputs.vPreviousPosition.w) -\n(fragmentInputs.vCurrentPosition.xy/fragmentInputs.vCurrentPosition.w));fragData[PREPASS_VELOCITY_LINEAR_INDEX]=vec4f(velocity,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_IRRADIANCE\nfragData[PREPASS_IRRADIANCE_INDEX]=vec4f(0.0,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_DEPTH\nfragData[PREPASS_DEPTH_INDEX]=vec4f(fragmentInputs.vViewPos.z,0.0,0.0,writeGeometryInfo); \n#endif\n#ifdef PREPASS_SCREENSPACE_DEPTH\nfragData[PREPASS_SCREENSPACE_DEPTH_INDEX]=vec4f(fragmentInputs.position.z,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nfragData[PREPASS_NORMALIZED_VIEW_DEPTH_INDEX]=vec4f(fragmentInputs.vNormViewDepth,0.0,0.0,writeGeometryInfo);\n#endif\n#ifdef PREPASS_NORMAL\n#ifdef PREPASS_NORMAL_WORLDSPACE\nfragData[PREPASS_NORMAL_INDEX]=vec4f(normalW,writeGeometryInfo);\n#else\nfragData[PREPASS_NORMAL_INDEX]=vec4f(normalize((scene.view*vec4f(normalW,0.0)).rgb),writeGeometryInfo);\n#endif\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nfragData[PREPASS_WORLD_NORMAL_INDEX]=vec4f(normalW*0.5+0.5,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO\nfragData[PREPASS_ALBEDO_INDEX]=vec4f(baseColor.rgb,writeGeometryInfo);\n#endif\n#ifdef PREPASS_ALBEDO_SQRT\nfragData[PREPASS_ALBEDO_SQRT_INDEX]=vec4f(sqrt(baseColor.rgb),writeGeometryInfo);\n#endif\n#ifdef PREPASS_REFLECTIVITY\n#if defined(SPECULAR)\nfragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec4(specularMapColor))*writeGeometryInfo; \n#else\nfragData[PREPASS_REFLECTIVITY_INDEX]=vec4f(toLinearSpaceVec3(specularColor),1.0)*writeGeometryInfo;\n#endif\n#endif\n#include<meshBlendTagFragmentOutput>[0..8]\n#endif\n#endif\n#if !defined(PREPASS) && !defined(ORDER_INDEPENDENT_TRANSPARENCY)\nfragmentOutputs.color=color;\n#endif\n#include<oitFragment>\n#if ORDER_INDEPENDENT_TRANSPARENCY\nif (fragDepth==nearestDepth) {fragmentOutputs.frontColor=vec4f(fragmentOutputs.frontColor.rgb+color.rgb*color.a*alphaMultiplier,1.0-alphaMultiplier*(1.0-color.a));} else {fragmentOutputs.backColor+=color;}\n#endif\n#define CUSTOM_FRAGMENT_MAIN_END\n#endif\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, defaultUboDeclarationWGSL, objectIdFunctionsWGSL, prePassDeclarationWGSL, oitDeclarationWGSL, mainUVVaryingDeclarationWGSL, helperFunctionsWGSL, lightUboDeclarationWGSL, ltcHelperFunctionsWGSL, clusteredLightingFunctionsWGSL, clusteredLightingComputeWGSL, lightsFragmentFunctionsWGSL, shadowsFragmentFunctionsWGSL, samplerFragmentDeclarationWGSL, fresnelFunctionWGSL, reflectionFunctionWGSL, imageProcessingDeclarationWGSL, imageProcessingFunctionsWGSL, textureRepetitionFunctionsWGSL, bumpFragmentMainFunctionsWGSL, bumpFragmentFunctionsWGSL, clipPlaneFragmentDeclarationWGSL, logDepthDeclarationWGSL, fogFragmentDeclarationWGSL, clipPlaneFragmentWGSL, bumpFragmentWGSL, decalFragmentWGSL, defaultFragmentAlphaWGSL, depthPrePassWGSL, lightFragmentWGSL, logDepthFragmentWGSL, fogFragmentWGSL, meshBlendTagFragmentOutputWGSL, oitFragmentWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const defaultPixelShaderWGSL = { name, shader };\n"]}
@@ -144,7 +144,7 @@ vertexOutputs.vPositionUVW=positionUpdated;
144
144
  #define CUSTOM_VERTEX_UPDATE_NORMAL
145
145
  #include<instancesVertex>
146
146
  #if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)
147
- vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0);
147
+ vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=scene.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0);
148
148
  #endif
149
149
  #ifdef USE_VERTEX_PULLING
150
150
  #include<bonesVertex>(vertexInputs.matricesIndices,vp_matricesIndices,vertexInputs.matricesWeights,vp_matricesWeights,vertexInputs.matricesIndicesExtra,vp_matricesIndicesExtra,vertexInputs.matricesWeightsExtra,vp_matricesWeightsExtra)
@@ -1 +1 @@
1
- {"version":3,"file":"default.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/default.vertex.ts"],"names":[],"mappings":"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","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { defaultUboDeclarationWGSL } from \"./ShadersInclude/defaultUboDeclaration\";\nimport { uvAttributeDeclarationWGSL } from \"./ShadersInclude/uvAttributeDeclaration\";\nimport { helperFunctionsWGSL } from \"./ShadersInclude/helperFunctions\";\nimport { bonesDeclarationWGSL } from \"./ShadersInclude/bonesDeclaration\";\nimport { bakedVertexAnimationDeclarationWGSL } from \"./ShadersInclude/bakedVertexAnimationDeclaration\";\nimport { instancesDeclarationWGSL } from \"./ShadersInclude/instancesDeclaration\";\nimport { prePassVertexDeclarationWGSL } from \"./ShadersInclude/prePassVertexDeclaration\";\nimport { mainUVVaryingDeclarationWGSL } from \"./ShadersInclude/mainUVVaryingDeclaration\";\nimport { samplerVertexDeclarationWGSL } from \"./ShadersInclude/samplerVertexDeclaration\";\nimport { bumpVertexDeclarationWGSL } from \"./ShadersInclude/bumpVertexDeclaration\";\nimport { clipPlaneVertexDeclarationWGSL } from \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport { fogVertexDeclarationWGSL } from \"./ShadersInclude/fogVertexDeclaration\";\nimport { lightVxFragmentDeclarationWGSL } from \"./ShadersInclude/lightVxFragmentDeclaration\";\nimport { lightVxUboDeclarationWGSL } from \"./ShadersInclude/lightVxUboDeclaration\";\nimport { morphTargetsVertexGlobalDeclarationWGSL } from \"./ShadersInclude/morphTargetsVertexGlobalDeclaration\";\nimport { morphTargetsVertexDeclarationWGSL } from \"./ShadersInclude/morphTargetsVertexDeclaration\";\nimport { logDepthDeclarationWGSL } from \"./ShadersInclude/logDepthDeclaration\";\nimport { vertexPullingDeclarationWGSL } from \"./ShadersInclude/vertexPullingDeclaration\";\nimport { vertexPullingVertexWGSL } from \"./ShadersInclude/vertexPullingVertex\";\nimport { morphTargetsVertexGlobalWGSL } from \"./ShadersInclude/morphTargetsVertexGlobal\";\nimport { morphTargetsVertexWGSL } from \"./ShadersInclude/morphTargetsVertex\";\nimport { instancesVertexWGSL } from \"./ShadersInclude/instancesVertex\";\nimport { bonesVertexWGSL } from \"./ShadersInclude/bonesVertex\";\nimport { bakedVertexAnimationWGSL } from \"./ShadersInclude/bakedVertexAnimation\";\nimport { prePassVertexWGSL } from \"./ShadersInclude/prePassVertex\";\nimport { uvVariableDeclarationWGSL } from \"./ShadersInclude/uvVariableDeclaration\";\nimport { samplerVertexImplementationWGSL } from \"./ShadersInclude/samplerVertexImplementation\";\nimport { bumpVertexWGSL } from \"./ShadersInclude/bumpVertex\";\nimport { clipPlaneVertexWGSL } from \"./ShadersInclude/clipPlaneVertex\";\nimport { fogVertexWGSL } from \"./ShadersInclude/fogVertex\";\nimport { shadowsVertexWGSL } from \"./ShadersInclude/shadowsVertex\";\nimport { vertexColorMixingWGSL } from \"./ShadersInclude/vertexColorMixing\";\nimport { logDepthVertexWGSL } from \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"defaultVertexShader\";\nconst shader = `#include<defaultUboDeclaration>\n#define CUSTOM_VERTEX_BEGIN\n#ifndef USE_VERTEX_PULLING\nattribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef TANGENT\nattribute tangent: vec4f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#include<uvAttributeDeclaration>[2..7]\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#include<mainUVVaryingDeclaration>[1..7]\n#include<samplerVertexDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)\n#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)\n#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)\n#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)\n#if defined(SPECULARTERM)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular)\n#endif\n#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#include<logDepthDeclaration>\n#include<vertexPullingDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef USE_VERTEX_PULLING\nvar positionUpdated: vec3f=vec3f(0.0);\n#ifdef NORMAL\nvar normalUpdated: vec3f=vec3f(0.0);\n#endif\n#ifdef TANGENT\nvar tangentUpdated: vec4f=vec4f(0.0);\n#endif\n#ifdef UV1\nvar uvUpdated: vec2f=vec2f(0.0);\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=vec2f(0.0);\n#endif\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vec4f(0.0);\n#endif\n#else\nvar positionUpdated: vec3f=vertexInputs.position;\n#ifdef NORMAL\nvar normalUpdated: vec3f=vertexInputs.normal;\n#endif\n#ifdef TANGENT\nvar tangentUpdated: vec4f=vertexInputs.tangent;\n#endif\n#ifdef UV1\nvar uvUpdated: vec2f=vertexInputs.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=vertexInputs.uv2;\n#endif\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#endif\n#include<vertexPullingVertex>\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvertexOutputs.vPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0);\n#endif\n#ifdef USE_VERTEX_PULLING\n#include<bonesVertex>(vertexInputs.matricesIndices,vp_matricesIndices,vertexInputs.matricesWeights,vp_matricesWeights,vertexInputs.matricesIndicesExtra,vp_matricesIndicesExtra,vertexInputs.matricesWeightsExtra,vp_matricesWeightsExtra)\n#include<bakedVertexAnimation>(vertexInputs.matricesIndices,vp_matricesIndices,vertexInputs.matricesWeights,vp_matricesWeights,vertexInputs.matricesIndicesExtra,vp_matricesIndicesExtra,vertexInputs.matricesWeightsExtra,vp_matricesWeightsExtra)\n#else\n#include<bonesVertex>\n#include<bakedVertexAnimation>\n#endif\nvar worldPos: vec4f=finalWorld*vec4f(positionUpdated,1.0);\n#ifdef NORMAL\nvar normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;}\n#else\nvertexOutputs.position=scene.viewProjection*worldPos;\n#endif\nvertexOutputs.vPositionW= worldPos.xyz;\n#ifdef PREPASS\n#include<prePassVertex>\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvertexOutputs.vDirectionW=normalize((finalWorld* vec4f(positionUpdated,0.0)).xyz);\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\n#ifdef RIGHT_HANDED\nvertexOutputs.vViewDepth=-(scene.view*worldPos).z;\n#else\nvertexOutputs.vViewDepth=(scene.view*worldPos).z;\n#endif\n#endif\n#ifndef UV1\nvar uvUpdated: vec2f=vec2f(0.,0.);\n#endif\n#ifdef MAINUV1\nvertexOutputs.vMainUV1=uvUpdated;\n#endif\n#ifndef UV2\nvar uv2Updated: vec2f=vec2f(0.,0.);\n#endif\n#ifdef MAINUV2\nvertexOutputs.vMainUV2=uv2Updated;\n#endif\n#include<uvVariableDeclaration>[3..7]\n#include<samplerVertexImplementation>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)\n#if defined(SPECULARTERM)\n#include<samplerVertexImplementation>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x)\n#endif\n#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, defaultUboDeclarationWGSL, uvAttributeDeclarationWGSL, helperFunctionsWGSL, bonesDeclarationWGSL, bakedVertexAnimationDeclarationWGSL, instancesDeclarationWGSL, prePassVertexDeclarationWGSL, mainUVVaryingDeclarationWGSL, samplerVertexDeclarationWGSL, bumpVertexDeclarationWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, lightVxFragmentDeclarationWGSL, lightVxUboDeclarationWGSL, morphTargetsVertexGlobalDeclarationWGSL, morphTargetsVertexDeclarationWGSL, logDepthDeclarationWGSL, vertexPullingDeclarationWGSL, vertexPullingVertexWGSL, morphTargetsVertexGlobalWGSL, morphTargetsVertexWGSL, instancesVertexWGSL, bonesVertexWGSL, bakedVertexAnimationWGSL, prePassVertexWGSL, uvVariableDeclarationWGSL, samplerVertexImplementationWGSL, bumpVertexWGSL, clipPlaneVertexWGSL, fogVertexWGSL, shadowsVertexWGSL, vertexColorMixingWGSL, logDepthVertexWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const defaultVertexShaderWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"default.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/default.vertex.ts"],"names":[],"mappings":"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","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { defaultUboDeclarationWGSL } from \"./ShadersInclude/defaultUboDeclaration\";\nimport { uvAttributeDeclarationWGSL } from \"./ShadersInclude/uvAttributeDeclaration\";\nimport { helperFunctionsWGSL } from \"./ShadersInclude/helperFunctions\";\nimport { bonesDeclarationWGSL } from \"./ShadersInclude/bonesDeclaration\";\nimport { bakedVertexAnimationDeclarationWGSL } from \"./ShadersInclude/bakedVertexAnimationDeclaration\";\nimport { instancesDeclarationWGSL } from \"./ShadersInclude/instancesDeclaration\";\nimport { prePassVertexDeclarationWGSL } from \"./ShadersInclude/prePassVertexDeclaration\";\nimport { mainUVVaryingDeclarationWGSL } from \"./ShadersInclude/mainUVVaryingDeclaration\";\nimport { samplerVertexDeclarationWGSL } from \"./ShadersInclude/samplerVertexDeclaration\";\nimport { bumpVertexDeclarationWGSL } from \"./ShadersInclude/bumpVertexDeclaration\";\nimport { clipPlaneVertexDeclarationWGSL } from \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport { fogVertexDeclarationWGSL } from \"./ShadersInclude/fogVertexDeclaration\";\nimport { lightVxFragmentDeclarationWGSL } from \"./ShadersInclude/lightVxFragmentDeclaration\";\nimport { lightVxUboDeclarationWGSL } from \"./ShadersInclude/lightVxUboDeclaration\";\nimport { morphTargetsVertexGlobalDeclarationWGSL } from \"./ShadersInclude/morphTargetsVertexGlobalDeclaration\";\nimport { morphTargetsVertexDeclarationWGSL } from \"./ShadersInclude/morphTargetsVertexDeclaration\";\nimport { logDepthDeclarationWGSL } from \"./ShadersInclude/logDepthDeclaration\";\nimport { vertexPullingDeclarationWGSL } from \"./ShadersInclude/vertexPullingDeclaration\";\nimport { vertexPullingVertexWGSL } from \"./ShadersInclude/vertexPullingVertex\";\nimport { morphTargetsVertexGlobalWGSL } from \"./ShadersInclude/morphTargetsVertexGlobal\";\nimport { morphTargetsVertexWGSL } from \"./ShadersInclude/morphTargetsVertex\";\nimport { instancesVertexWGSL } from \"./ShadersInclude/instancesVertex\";\nimport { bonesVertexWGSL } from \"./ShadersInclude/bonesVertex\";\nimport { bakedVertexAnimationWGSL } from \"./ShadersInclude/bakedVertexAnimation\";\nimport { prePassVertexWGSL } from \"./ShadersInclude/prePassVertex\";\nimport { uvVariableDeclarationWGSL } from \"./ShadersInclude/uvVariableDeclaration\";\nimport { samplerVertexImplementationWGSL } from \"./ShadersInclude/samplerVertexImplementation\";\nimport { bumpVertexWGSL } from \"./ShadersInclude/bumpVertex\";\nimport { clipPlaneVertexWGSL } from \"./ShadersInclude/clipPlaneVertex\";\nimport { fogVertexWGSL } from \"./ShadersInclude/fogVertex\";\nimport { shadowsVertexWGSL } from \"./ShadersInclude/shadowsVertex\";\nimport { vertexColorMixingWGSL } from \"./ShadersInclude/vertexColorMixing\";\nimport { logDepthVertexWGSL } from \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"defaultVertexShader\";\nconst shader = `#include<defaultUboDeclaration>\n#define CUSTOM_VERTEX_BEGIN\n#ifndef USE_VERTEX_PULLING\nattribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef TANGENT\nattribute tangent: vec4f;\n#endif\n#ifdef UV1\nattribute uv: vec2f;\n#endif\n#include<uvAttributeDeclaration>[2..7]\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\n#include<prePassVertexDeclaration>\n#include<mainUVVaryingDeclaration>[1..7]\n#include<samplerVertexDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)\n#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)\n#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)\n#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)\n#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)\n#if defined(SPECULARTERM)\n#include<samplerVertexDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular)\n#endif\n#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)\n#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<bumpVertexDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#include<morphTargetsVertexGlobalDeclaration>\n#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvarying vPositionUVW: vec3f;\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvarying vDirectionW: vec3f;\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#include<logDepthDeclaration>\n#include<vertexPullingDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef USE_VERTEX_PULLING\nvar positionUpdated: vec3f=vec3f(0.0);\n#ifdef NORMAL\nvar normalUpdated: vec3f=vec3f(0.0);\n#endif\n#ifdef TANGENT\nvar tangentUpdated: vec4f=vec4f(0.0);\n#endif\n#ifdef UV1\nvar uvUpdated: vec2f=vec2f(0.0);\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=vec2f(0.0);\n#endif\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vec4f(0.0);\n#endif\n#else\nvar positionUpdated: vec3f=vertexInputs.position;\n#ifdef NORMAL\nvar normalUpdated: vec3f=vertexInputs.normal;\n#endif\n#ifdef TANGENT\nvar tangentUpdated: vec4f=vertexInputs.tangent;\n#endif\n#ifdef UV1\nvar uvUpdated: vec2f=vertexInputs.uv;\n#endif\n#ifdef UV2\nvar uv2Updated: vec2f=vertexInputs.uv2;\n#endif\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#endif\n#include<vertexPullingVertex>\n#include<morphTargetsVertexGlobal>\n#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]\n#ifdef REFLECTIONMAP_SKYBOX\nvertexOutputs.vPositionUVW=positionUpdated;\n#endif\n#define CUSTOM_VERTEX_UPDATE_POSITION\n#define CUSTOM_VERTEX_UPDATE_NORMAL\n#include<instancesVertex>\n#if defined(PREPASS) && ((defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && !defined(BONES_VELOCITY_ENABLED)\nvertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld*vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=scene.previousViewProjection*finalPreviousWorld*vec4f(positionUpdated,1.0);\n#endif\n#ifdef USE_VERTEX_PULLING\n#include<bonesVertex>(vertexInputs.matricesIndices,vp_matricesIndices,vertexInputs.matricesWeights,vp_matricesWeights,vertexInputs.matricesIndicesExtra,vp_matricesIndicesExtra,vertexInputs.matricesWeightsExtra,vp_matricesWeightsExtra)\n#include<bakedVertexAnimation>(vertexInputs.matricesIndices,vp_matricesIndices,vertexInputs.matricesWeights,vp_matricesWeights,vertexInputs.matricesIndicesExtra,vp_matricesIndicesExtra,vertexInputs.matricesWeightsExtra,vp_matricesWeightsExtra)\n#else\n#include<bonesVertex>\n#include<bakedVertexAnimation>\n#endif\nvar worldPos: vec4f=finalWorld*vec4f(positionUpdated,1.0);\n#ifdef NORMAL\nvar normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#if defined(INSTANCES) && defined(THIN_INSTANCES)\nvertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW);\n#else\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nvertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);\n#endif\n#endif\n#define CUSTOM_VERTEX_UPDATE_WORLDPOS\n#ifdef MULTIVIEW\nif (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;}\n#else\nvertexOutputs.position=scene.viewProjection*worldPos;\n#endif\nvertexOutputs.vPositionW= worldPos.xyz;\n#ifdef PREPASS\n#include<prePassVertex>\n#endif\n#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)\nvertexOutputs.vDirectionW=normalize((finalWorld* vec4f(positionUpdated,0.0)).xyz);\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\n#ifdef RIGHT_HANDED\nvertexOutputs.vViewDepth=-(scene.view*worldPos).z;\n#else\nvertexOutputs.vViewDepth=(scene.view*worldPos).z;\n#endif\n#endif\n#ifndef UV1\nvar uvUpdated: vec2f=vec2f(0.,0.);\n#endif\n#ifdef MAINUV1\nvertexOutputs.vMainUV1=uvUpdated;\n#endif\n#ifndef UV2\nvar uv2Updated: vec2f=vec2f(0.,0.);\n#endif\n#ifdef MAINUV2\nvertexOutputs.vMainUV2=uv2Updated;\n#endif\n#include<uvVariableDeclaration>[3..7]\n#include<samplerVertexImplementation>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)\n#if defined(SPECULARTERM)\n#include<samplerVertexImplementation>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x)\n#endif\n#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)\n#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)\n#include<bumpVertex>\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, defaultUboDeclarationWGSL, uvAttributeDeclarationWGSL, helperFunctionsWGSL, bonesDeclarationWGSL, bakedVertexAnimationDeclarationWGSL, instancesDeclarationWGSL, prePassVertexDeclarationWGSL, mainUVVaryingDeclarationWGSL, samplerVertexDeclarationWGSL, bumpVertexDeclarationWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, lightVxFragmentDeclarationWGSL, lightVxUboDeclarationWGSL, morphTargetsVertexGlobalDeclarationWGSL, morphTargetsVertexDeclarationWGSL, logDepthDeclarationWGSL, vertexPullingDeclarationWGSL, vertexPullingVertexWGSL, morphTargetsVertexGlobalWGSL, morphTargetsVertexWGSL, instancesVertexWGSL, bonesVertexWGSL, bakedVertexAnimationWGSL, prePassVertexWGSL, uvVariableDeclarationWGSL, samplerVertexImplementationWGSL, bumpVertexWGSL, clipPlaneVertexWGSL, fogVertexWGSL, shadowsVertexWGSL, vertexColorMixingWGSL, logDepthVertexWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const defaultVertexShaderWGSL = { name, shader };\n"]}
@@ -21,7 +21,7 @@ const shader = `#include<sceneUboDeclaration>
21
21
  attribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform minPixelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;
22
22
  #ifdef PREPASS
23
23
  #if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
24
- uniform previousWorld: mat4x4f;uniform previousViewProjection: mat4x4f;
24
+ uniform previousWorld: mat4x4f;
25
25
  #if IS_COMPOUND
26
26
  uniform previousPartWorld: array<mat4x4<f32>,MAX_PART_COUNT>;
27
27
  #endif
@@ -166,9 +166,9 @@ vertexOutputs.vGeometryNormalW=geometryNormalW;
166
166
  #if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
167
167
  vertexOutputs.vGeometryCurrentPosition=vertexOutputs.position;
168
168
  #if IS_COMPOUND
169
- vertexOutputs.vGeometryPreviousPosition=uniforms.previousViewProjection*uniforms.previousPartWorld[splat.partIndex]*vec4f(geometryPlanePositionL,1.0);
169
+ vertexOutputs.vGeometryPreviousPosition=scene.previousViewProjection*uniforms.previousPartWorld[splat.partIndex]*vec4f(geometryPlanePositionL,1.0);
170
170
  #else
171
- vertexOutputs.vGeometryPreviousPosition=uniforms.previousViewProjection*uniforms.previousWorld*vec4f(geometryPlanePositionL,1.0);
171
+ vertexOutputs.vGeometryPreviousPosition=scene.previousViewProjection*uniforms.previousWorld*vec4f(geometryPlanePositionL,1.0);
172
172
  #endif
173
173
  #endif
174
174
  #endif
@@ -1 +1 @@
1
- {"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AACvR,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { helperFunctionsWGSL } from \"./ShadersInclude/helperFunctions\";\nimport { clipPlaneVertexDeclarationWGSL } from \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport { fogVertexDeclarationWGSL } from \"./ShadersInclude/fogVertexDeclaration\";\nimport { logDepthDeclarationWGSL } from \"./ShadersInclude/logDepthDeclaration\";\nimport { gaussianSplattingSharedWGSL } from \"./ShadersInclude/gaussianSplattingShared\";\nimport { gaussianSplattingWGSL } from \"./ShadersInclude/gaussianSplatting\";\nimport { clipPlaneVertexWGSL } from \"./ShadersInclude/clipPlaneVertex\";\nimport { fogVertexWGSL } from \"./ShadersInclude/fogVertex\";\nimport { logDepthVertexWGSL } from \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<helperFunctions>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform minPixelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;\n#ifdef PREPASS\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nuniform previousWorld: mat4x4f;uniform previousViewProjection: mat4x4f;\n#if IS_COMPOUND\nuniform previousPartWorld: array<mat4x4<f32>,MAX_PART_COUNT>;\n#endif\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nuniform geometryDepthRange: vec2f;\n#endif\n#endif\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;\n#endif\nvar covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#ifdef USE_SOG\nvar sogQuatsTexture: texture_2d<f32>;uniform sogMeansMin: vec3f;uniform sogMeansMax: vec3f;\n#ifdef USE_SOG_V2\nvar sogCodebookTexture: texture_2d<f32>;\n#else\nuniform sogScalesMin: vec3f;uniform sogScalesMax: vec3f;uniform sogSh0Min: vec4f;uniform sogSh0Max: vec4f;uniform sogShnMin: f32;uniform sogShnMax: f32;\n#endif\n#if SH_DEGREE>0\nvar sogShNCentroidsTexture: texture_2d<f32>;var sogShNLabelsTexture: texture_2d<f32>;uniform sogShCoeffCount: f32;\n#endif\n#endif\n#if SH_DEGREE>0 && !defined(USE_SOG)\nvar shTexture0: texture_2d<u32>;\n#endif\n#if SH_DEGREE>1 && !defined(USE_SOG)\nvar shTexture1: texture_2d<u32>;\n#endif\n#if SH_DEGREE>2 && !defined(USE_SOG)\nvar shTexture2: texture_2d<u32>;\n#endif\n#if SH_DEGREE>3 && !defined(USE_SOG)\nvar shTexture3: texture_2d<u32>;var shTexture4: texture_2d<u32>;\n#endif\n#if IS_COMPOUND\nvar partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vColor: vec4f;varying vPosition: vec2f;\n#ifdef PREPASS\n#ifdef PREPASS_POSITION\nvarying vGeometryPositionW: vec3f;\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvarying vGeometryPositionL: vec3f;\n#endif\n#ifdef PREPASS_DEPTH\nvarying vGeometryViewDepth: f32;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying vGeometryNormalizedViewDepth: f32;\n#endif\n#ifdef PREPASS_NORMAL\nvarying vGeometryNormalV: vec3f;\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nvarying vGeometryNormalW: vec3f;\n#endif\n#if defined(PREPASS_ALBEDO) || defined(PREPASS_ALBEDO_SQRT)\nvarying vGeometryAlbedo: vec3f;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvarying vGeometryCurrentPosition: vec4f;varying vGeometryPreviousPosition: vec4f;\n#endif\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nlet splatIndex: f32=getSplatIndex(i32(vertexInputs.position.z+0.5),vertexInputs.splatIndex0,vertexInputs.splatIndex1,vertexInputs.splatIndex2,vertexInputs.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=vertexInputs.position.xy;\n#if defined(PREPASS_ALBEDO) || defined(PREPASS_ALBEDO_SQRT)\nvertexOutputs.vGeometryAlbedo=splat.color.xyz;\n#endif\n#if SH_DEGREE>0\nlet worldRot: mat3x3f= mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));\n#if defined(GS_DBG_ENABLED) && IS_COMPOUND\n{let _row3=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),3),0);\n#if SH_DEGREE>3\nlet _so4=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),4),0).x;\n#else\nlet _so4: f32=1.0;\n#endif\nvertexOutputs.vColor=vec4f(_row3.x*splat.color.xyz+computeSHWeighted(splat,eyeToSplatLocalSpace,_row3.y,_row3.z,_row3.w,_so4),splat.color.w*uniforms.alpha);}\n#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0\nvertexOutputs.vColor=vec4f(computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#endif\n#else\n#if defined(GS_DBG_ENABLED) && IS_COMPOUND\n{let _shDc=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),3),0).x;vertexOutputs.vColor=vec4f(_shDc*splat.color.xyz,splat.color.w*uniforms.alpha);}\n#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0\nvertexOutputs.vColor=vec4f(0.0,0.0,0.0,splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);\n#endif\n#endif\n#if IS_COMPOUND\nvertexOutputs.vColor.w*=uniforms.partVisibility[splat.partIndex];\n#endif\nvar scale: vec2f=vec2f(1.,1.);\n#define CUSTOM_VERTEX_UPDATE\nvertexOutputs.position=gaussianSplatting(vertexInputs.position.xy,worldPos.xyz,scale,covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize,uniforms.minPixelSize);\n#ifdef PREPASS\n#if defined(PREPASS_POSITION) || defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_DEPTH) || defined(PREPASS_NORMALIZED_VIEW_DEPTH) || defined(PREPASS_NORMAL) || defined(PREPASS_WORLD_NORMAL) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nlet geometrySplatViewPosition=(scene.view*worldPos).xyz;let viewRotation=mat3x3f(scene.view[0].xyz,scene.view[1].xyz,scene.view[2].xyz);\n#endif\n#if defined(PREPASS_POSITION) || defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvar geometryPlaneViewPosition=scene.inverseProjection*vertexOutputs.position;geometryPlaneViewPosition/=geometryPlaneViewPosition.w;let geometryPlanePositionW=worldPos.xyz+transpose(viewRotation)*(geometryPlaneViewPosition.xyz-geometrySplatViewPosition);\n#if defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nlet splatWorldRotation=mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let geometryPlanePositionL=splat.center.xyz+inverseMat3(splatWorldRotation)*(geometryPlanePositionW-worldPos.xyz);\n#endif\n#endif\n#ifdef PREPASS_POSITION\nvertexOutputs.vGeometryPositionW=geometryPlanePositionW;\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvertexOutputs.vGeometryPositionL=geometryPlanePositionL;\n#endif\n#ifdef PREPASS_DEPTH\nvertexOutputs.vGeometryViewDepth=geometrySplatViewPosition.z;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvertexOutputs.vGeometryNormalizedViewDepth=(geometrySplatViewPosition.z-uniforms.geometryDepthRange.x)/(uniforms.geometryDepthRange.y-uniforms.geometryDepthRange.x);\n#endif\n#if defined(PREPASS_NORMAL) || defined(PREPASS_WORLD_NORMAL)\nlet geometryNormalV=vec3f(0.0,0.0,select(-1.0,1.0,geometrySplatViewPosition.z<0.0));let geometryNormalW=normalize(transpose(viewRotation)*geometryNormalV);\n#ifdef PREPASS_NORMAL\nvertexOutputs.vGeometryNormalV=geometryNormalV;\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nvertexOutputs.vGeometryNormalW=geometryNormalW;\n#endif\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvertexOutputs.vGeometryCurrentPosition=vertexOutputs.position;\n#if IS_COMPOUND\nvertexOutputs.vGeometryPreviousPosition=uniforms.previousViewProjection*uniforms.previousPartWorld[splat.partIndex]*vec4f(geometryPlanePositionL,1.0);\n#else\nvertexOutputs.vGeometryPreviousPosition=uniforms.previousViewProjection*uniforms.previousWorld*vec4f(geometryPlanePositionL,1.0);\n#endif\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, helperFunctionsWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, logDepthDeclarationWGSL, gaussianSplattingSharedWGSL, gaussianSplattingWGSL, clipPlaneVertexWGSL, fogVertexWGSL, logDepthVertexWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gaussianSplattingVertexShaderWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"gaussianSplatting.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gaussianSplatting.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,uBAAuB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,aAAa,EAAE,kBAAkB,CAAC,CAAC;AACvR,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,iCAAiC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\nimport { sceneUboDeclarationWGSL } from \"./ShadersInclude/sceneUboDeclaration\";\nimport { meshUboDeclarationWGSL } from \"./ShadersInclude/meshUboDeclaration\";\nimport { helperFunctionsWGSL } from \"./ShadersInclude/helperFunctions\";\nimport { clipPlaneVertexDeclarationWGSL } from \"./ShadersInclude/clipPlaneVertexDeclaration\";\nimport { fogVertexDeclarationWGSL } from \"./ShadersInclude/fogVertexDeclaration\";\nimport { logDepthDeclarationWGSL } from \"./ShadersInclude/logDepthDeclaration\";\nimport { gaussianSplattingSharedWGSL } from \"./ShadersInclude/gaussianSplattingShared\";\nimport { gaussianSplattingWGSL } from \"./ShadersInclude/gaussianSplatting\";\nimport { clipPlaneVertexWGSL } from \"./ShadersInclude/clipPlaneVertex\";\nimport { fogVertexWGSL } from \"./ShadersInclude/fogVertex\";\nimport { logDepthVertexWGSL } from \"./ShadersInclude/logDepthVertex\";\n\nconst name = \"gaussianSplattingVertexShader\";\nconst shader = `#include<sceneUboDeclaration>\n#include<meshUboDeclaration>\n#include<helperFunctions>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<logDepthDeclaration>\nattribute splatIndex0: vec4f;attribute splatIndex1: vec4f;attribute splatIndex2: vec4f;attribute splatIndex3: vec4f;attribute position: vec3f;uniform invViewport: vec2f;uniform dataTextureSize: vec2f;uniform focal: vec2f;uniform kernelSize: f32;uniform minPixelSize: f32;uniform eyePosition: vec3f;uniform alpha: f32;\n#ifdef PREPASS\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nuniform previousWorld: mat4x4f;\n#if IS_COMPOUND\nuniform previousPartWorld: array<mat4x4<f32>,MAX_PART_COUNT>;\n#endif\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nuniform geometryDepthRange: vec2f;\n#endif\n#endif\n#if IS_COMPOUND\nuniform partWorld: array<mat4x4<f32>,MAX_PART_COUNT>;uniform partVisibility: array<f32,MAX_PART_COUNT>;\n#endif\nvar covariancesATexture: texture_2d<f32>;var covariancesBTexture: texture_2d<f32>;var centersTexture: texture_2d<f32>;var colorsTexture: texture_2d<f32>;\n#ifdef USE_SOG\nvar sogQuatsTexture: texture_2d<f32>;uniform sogMeansMin: vec3f;uniform sogMeansMax: vec3f;\n#ifdef USE_SOG_V2\nvar sogCodebookTexture: texture_2d<f32>;\n#else\nuniform sogScalesMin: vec3f;uniform sogScalesMax: vec3f;uniform sogSh0Min: vec4f;uniform sogSh0Max: vec4f;uniform sogShnMin: f32;uniform sogShnMax: f32;\n#endif\n#if SH_DEGREE>0\nvar sogShNCentroidsTexture: texture_2d<f32>;var sogShNLabelsTexture: texture_2d<f32>;uniform sogShCoeffCount: f32;\n#endif\n#endif\n#if SH_DEGREE>0 && !defined(USE_SOG)\nvar shTexture0: texture_2d<u32>;\n#endif\n#if SH_DEGREE>1 && !defined(USE_SOG)\nvar shTexture1: texture_2d<u32>;\n#endif\n#if SH_DEGREE>2 && !defined(USE_SOG)\nvar shTexture2: texture_2d<u32>;\n#endif\n#if SH_DEGREE>3 && !defined(USE_SOG)\nvar shTexture3: texture_2d<u32>;var shTexture4: texture_2d<u32>;\n#endif\n#if IS_COMPOUND\nvar partIndicesTexture: texture_2d<f32>;\n#endif\nvarying vColor: vec4f;varying vPosition: vec2f;\n#ifdef PREPASS\n#ifdef PREPASS_POSITION\nvarying vGeometryPositionW: vec3f;\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvarying vGeometryPositionL: vec3f;\n#endif\n#ifdef PREPASS_DEPTH\nvarying vGeometryViewDepth: f32;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvarying vGeometryNormalizedViewDepth: f32;\n#endif\n#ifdef PREPASS_NORMAL\nvarying vGeometryNormalV: vec3f;\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nvarying vGeometryNormalW: vec3f;\n#endif\n#if defined(PREPASS_ALBEDO) || defined(PREPASS_ALBEDO_SQRT)\nvarying vGeometryAlbedo: vec3f;\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvarying vGeometryCurrentPosition: vec4f;varying vGeometryPreviousPosition: vec4f;\n#endif\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n#include<gaussianSplatting>\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nlet splatIndex: f32=getSplatIndex(i32(vertexInputs.position.z+0.5),vertexInputs.splatIndex0,vertexInputs.splatIndex1,vertexInputs.splatIndex2,vertexInputs.splatIndex3);var splat: Splat=readSplat(splatIndex,uniforms.dataTextureSize);var covA: vec3f=splat.covA.xyz;var covB: vec3f=vec3f(splat.covA.w,splat.covB.xy);\n#if IS_COMPOUND\nlet splatWorld: mat4x4f=getPartWorld(splat.partIndex);\n#else\nlet splatWorld: mat4x4f=mesh.world;\n#endif\nlet worldPos: vec4f=splatWorld*vec4f(splat.center.xyz,1.0);vertexOutputs.vPosition=vertexInputs.position.xy;\n#if defined(PREPASS_ALBEDO) || defined(PREPASS_ALBEDO_SQRT)\nvertexOutputs.vGeometryAlbedo=splat.color.xyz;\n#endif\n#if SH_DEGREE>0\nlet worldRot: mat3x3f= mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let normWorldRot: mat3x3f=inverseMat3(worldRot);var eyeToSplatLocalSpace: vec3f=normalize(normWorldRot*(worldPos.xyz-uniforms.eyePosition.xyz));\n#if defined(GS_DBG_ENABLED) && IS_COMPOUND\n{let _row3=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),3),0);\n#if SH_DEGREE>3\nlet _so4=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),4),0).x;\n#else\nlet _so4: f32=1.0;\n#endif\nvertexOutputs.vColor=vec4f(_row3.x*splat.color.xyz+computeSHWeighted(splat,eyeToSplatLocalSpace,_row3.y,_row3.z,_row3.w,_so4),splat.color.w*uniforms.alpha);}\n#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0\nvertexOutputs.vColor=vec4f(computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz+computeSH(splat,eyeToSplatLocalSpace),splat.color.w*uniforms.alpha);\n#endif\n#else\n#if defined(GS_DBG_ENABLED) && IS_COMPOUND\n{let _shDc=textureLoad(dbgPartData,vec2i(i32(splat.partIndex),3),0).x;vertexOutputs.vColor=vec4f(_shDc*splat.color.xyz,splat.color.w*uniforms.alpha);}\n#elif defined(GS_DBG_ENABLED) && GS_DBG_SH_DC==0\nvertexOutputs.vColor=vec4f(0.0,0.0,0.0,splat.color.w*uniforms.alpha);\n#else\nvertexOutputs.vColor=vec4f(splat.color.xyz,splat.color.w*uniforms.alpha);\n#endif\n#endif\n#if IS_COMPOUND\nvertexOutputs.vColor.w*=uniforms.partVisibility[splat.partIndex];\n#endif\nvar scale: vec2f=vec2f(1.,1.);\n#define CUSTOM_VERTEX_UPDATE\nvertexOutputs.position=gaussianSplatting(vertexInputs.position.xy,worldPos.xyz,scale,covA,covB,splatWorld,scene.view,scene.projection,uniforms.focal,uniforms.invViewport,uniforms.kernelSize,uniforms.minPixelSize);\n#ifdef PREPASS\n#if defined(PREPASS_POSITION) || defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_DEPTH) || defined(PREPASS_NORMALIZED_VIEW_DEPTH) || defined(PREPASS_NORMAL) || defined(PREPASS_WORLD_NORMAL) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nlet geometrySplatViewPosition=(scene.view*worldPos).xyz;let viewRotation=mat3x3f(scene.view[0].xyz,scene.view[1].xyz,scene.view[2].xyz);\n#endif\n#if defined(PREPASS_POSITION) || defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvar geometryPlaneViewPosition=scene.inverseProjection*vertexOutputs.position;geometryPlaneViewPosition/=geometryPlaneViewPosition.w;let geometryPlanePositionW=worldPos.xyz+transpose(viewRotation)*(geometryPlaneViewPosition.xyz-geometrySplatViewPosition);\n#if defined(PREPASS_LOCAL_POSITION) || defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nlet splatWorldRotation=mat3x3f(splatWorld[0].xyz,splatWorld[1].xyz,splatWorld[2].xyz);let geometryPlanePositionL=splat.center.xyz+inverseMat3(splatWorldRotation)*(geometryPlanePositionW-worldPos.xyz);\n#endif\n#endif\n#ifdef PREPASS_POSITION\nvertexOutputs.vGeometryPositionW=geometryPlanePositionW;\n#endif\n#ifdef PREPASS_LOCAL_POSITION\nvertexOutputs.vGeometryPositionL=geometryPlanePositionL;\n#endif\n#ifdef PREPASS_DEPTH\nvertexOutputs.vGeometryViewDepth=geometrySplatViewPosition.z;\n#endif\n#ifdef PREPASS_NORMALIZED_VIEW_DEPTH\nvertexOutputs.vGeometryNormalizedViewDepth=(geometrySplatViewPosition.z-uniforms.geometryDepthRange.x)/(uniforms.geometryDepthRange.y-uniforms.geometryDepthRange.x);\n#endif\n#if defined(PREPASS_NORMAL) || defined(PREPASS_WORLD_NORMAL)\nlet geometryNormalV=vec3f(0.0,0.0,select(-1.0,1.0,geometrySplatViewPosition.z<0.0));let geometryNormalW=normalize(transpose(viewRotation)*geometryNormalV);\n#ifdef PREPASS_NORMAL\nvertexOutputs.vGeometryNormalV=geometryNormalV;\n#endif\n#ifdef PREPASS_WORLD_NORMAL\nvertexOutputs.vGeometryNormalW=geometryNormalW;\n#endif\n#endif\n#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)\nvertexOutputs.vGeometryCurrentPosition=vertexOutputs.position;\n#if IS_COMPOUND\nvertexOutputs.vGeometryPreviousPosition=scene.previousViewProjection*uniforms.previousPartWorld[splat.partIndex]*vec4f(geometryPlanePositionL,1.0);\n#else\nvertexOutputs.vGeometryPreviousPosition=scene.previousViewProjection*uniforms.previousWorld*vec4f(geometryPlanePositionL,1.0);\n#endif\n#endif\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<logDepthVertex>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [sceneUboDeclarationWGSL, meshUboDeclarationWGSL, helperFunctionsWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, logDepthDeclarationWGSL, gaussianSplattingSharedWGSL, gaussianSplattingWGSL, clipPlaneVertexWGSL, fogVertexWGSL, logDepthVertexWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const gaussianSplattingVertexShaderWGSL = { name, shader };\n"]}
@@ -209,7 +209,7 @@ let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>
209
209
  #elif defined(BOXEMITTER)
210
210
  let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=params.minEmitBox+(params.maxEmitBox-params.minEmitBox)*randoms2;newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;
211
211
  #elif defined(HEMISPHERICEMITTER)
212
- let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,abs(randY),randZ);newDirection=normalize(newPosition+params.directionRandomizer*randoms3);
212
+ let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,abs(randY),randZ);let hemisphereDirection : vec3<f32>=newPosition+params.directionRandomizer*randoms3;let hemisphereDirectionLength : f32=length(hemisphereDirection);newDirection=select(vec3<f32>(0.0),hemisphereDirection/hemisphereDirectionLength,hemisphereDirectionLength>0.0);
213
213
  #elif defined(SPHEREEMITTER)
214
214
  let randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,randY,randZ);
215
215
  #ifdef DIRECTEDSPHEREEMITTER
@@ -1 +1 @@
1
- {"version":3,"file":"gpuUpdateParticles.compute.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gpuUpdateParticles.compute.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,iCAAiC,CAAC;AAC/C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuVd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AAED,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 = \"gpuUpdateParticlesComputeShader\";\nconst shader = `struct Particle {position : vec3<f32>,\nage : f32,\nsize : vec3<f32>,\nlife : f32,\nseed : vec4<f32>,\ndirection : vec3<f32>,\ndummy0: f32,\n#ifdef CUSTOMEMITTER\ninitialPosition : vec3<f32>,\ndummy1: f32,\n#endif\n#ifndef COLORGRADIENTS\ncolor : vec4<f32>,\n#endif\n#ifndef BILLBOARD\ninitialDirection : vec3<f32>,\ndummy2: f32,\n#endif\n#ifdef NOISE\nnoiseCoordinates1 : vec3<f32>,\ndummy3: f32,\nnoiseCoordinates2 : vec3<f32>,\ndummy4: f32,\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nangle : f32,\n#else\nangle : vec2<f32>,\n#endif\n#ifdef ANIMATESHEET\ncellIndex : f32,\n#ifdef ANIMATESHEETRANDOMSTART\ncellStartOffset : f32,\n#endif\n#endif\n};struct Particles {particles : array<Particle>,};struct SimParams {currentCount : f32,\ntimeDelta : f32,\nstopFactor : f32,\nrandomTextureSize: i32,\nlifeTime : vec2<f32>,\nemitPower : vec2<f32>,\nemitIndex : f32,\nemitCount : f32,\n#ifndef COLORGRADIENTS\ncolor1 : vec4<f32>,\ncolor2 : vec4<f32>,\n#endif\nsizeRange : vec2<f32>,\nscaleRange : vec4<f32>,\nangleRange : vec4<f32>,\ngravity : vec3<f32>,\n#ifdef LIMITVELOCITYGRADIENTS\nlimitVelocityDamping : f32,\n#endif\n#ifdef ANIMATESHEET\ncellInfos : vec4<f32>,\n#endif\n#ifdef NOISE\nnoiseStrength : vec3<f32>,\n#endif\n#ifdef FLOWMAP\nflowMapProjection : mat4x4<f32>,\nflowMapStrength : f32,\n#endif\n#ifndef LOCAL\nemitterWM : mat4x4<f32>,\n#endif\n#ifdef ATTRACTORS\nattractorCount : i32,\nattractorPositionAndStrength : array<vec4<f32>,MAX_ATTRACTORS>,\n#endif\n#ifdef STARTSIZEGRADIENTS\nstartSizeGradientFactor : f32,\n#endif\n#ifdef LIFETIMEGRADIENTS\nlifeTimeGradientRange : vec2<f32>,\n#endif\n#ifdef MESHEMITTER\nmeshTriangleCount : i32,\nmeshTextureWidth : i32,\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#endif\n#ifdef BOXEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\nminEmitBox : vec3<f32>,\nmaxEmitBox : vec3<f32>,\n#endif\n#ifdef CONEEMITTER\nradius : vec2<f32>,\nconeAngle : f32,\nheight : vec2<f32>,\n#ifdef DIRECTEDCONEEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#else\ndirectionRandomizer : f32,\n#endif\n#endif\n#ifdef CYLINDEREMITTER\nradius : f32,\nheight : f32,\nradiusRange : f32,\n#ifdef DIRECTEDCYLINDEREMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#else\ndirectionRandomizer : f32,\n#endif\n#endif\n#ifdef HEMISPHERICEMITTER\nradius : f32,\nradiusRange : f32,\ndirectionRandomizer : f32,\n#endif\n#ifdef POINTEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#endif\n#ifdef SPHEREEMITTER\nradius : f32,\nradiusRange : f32,\n#ifdef DIRECTEDSPHEREEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#else\ndirectionRandomizer : f32,\n#endif\n#endif\n};@binding(0) @group(0) var<uniform> params : SimParams;@binding(1) @group(0) var<storage,read> particlesIn : Particles;@binding(2) @group(0) var<storage,read_write> particlesOut : Particles;@binding(3) @group(0) var randomTexture : texture_2d<f32>;@binding(4) @group(0) var randomTexture2 : texture_2d<f32>;\n#ifdef SIZEGRADIENTS\n@binding(0) @group(1) var sizeGradientSampler : sampler;@binding(1) @group(1) var sizeGradientTexture : texture_2d<f32>;\n#endif \n#ifdef ANGULARSPEEDGRADIENTS\n@binding(2) @group(1) var angularSpeedGradientSampler : sampler;@binding(3) @group(1) var angularSpeedGradientTexture : texture_2d<f32>;\n#endif \n#ifdef VELOCITYGRADIENTS\n@binding(4) @group(1) var velocityGradientSampler : sampler;@binding(5) @group(1) var velocityGradientTexture : texture_2d<f32>;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\n@binding(6) @group(1) var limitVelocityGradientSampler : sampler;@binding(7) @group(1) var limitVelocityGradientTexture : texture_2d<f32>;\n#endif\n#ifdef DRAGGRADIENTS\n@binding(8) @group(1) var dragGradientSampler : sampler;@binding(9) @group(1) var dragGradientTexture : texture_2d<f32>;\n#endif\n#ifdef NOISE\n@binding(10) @group(1) var noiseSampler : sampler;@binding(11) @group(1) var noiseTexture : texture_2d<f32>;\n#endif\n#ifdef FLOWMAP\n@binding(12) @group(1) var flowMapSampler : sampler;@binding(13) @group(1) var flowMapTexture : texture_2d<f32>;\n#endif\n#ifdef MESHEMITTER\n@binding(14) @group(1) var meshPositionTexture : texture_2d<f32>;\n#ifdef MESHNORMALS\n@binding(15) @group(1) var meshNormalTexture : texture_2d<f32>;\n#endif\n#endif\nfn getRandomVec3(offset : f32,vertexID : f32)->vec3<f32> {return textureLoad(randomTexture2,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0).rgb;}\nfn getRandomVec4(offset : f32,vertexID : f32)->vec4<f32> {return textureLoad(randomTexture,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0);}\n@compute @workgroup_size(64)\nfn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {let index : u32=GlobalInvocationID.x;let vertexID : f32=f32(index);if (index>=u32(params.currentCount)) {return;}\nlet PI : f32=3.14159;let timeDelta : f32=params.timeDelta;let newAge : f32=particlesIn.particles[index].age+timeDelta;let life : f32=particlesIn.particles[index].life;let seed : vec4<f32>=particlesIn.particles[index].seed;let direction : vec3<f32>=particlesIn.particles[index].direction;\n#ifdef EMITRATECTRL\nvar offsetFromEmitIndex : f32=vertexID-params.emitIndex;if (offsetFromEmitIndex<0.0) {offsetFromEmitIndex+=params.currentCount; }\nlet shouldEmit : bool=offsetFromEmitIndex<params.emitCount && params.stopFactor != 0.;\n#else\nlet shouldEmit : bool=newAge>=life && params.stopFactor != 0.;\n#endif\nif (shouldEmit) {var newPosition : vec3<f32>;var newDirection : vec3<f32>;let randoms : vec4<f32>=getRandomVec4(seed.x,vertexID);let outLife : f32=params.lifeTime.x+(params.lifeTime.y-params.lifeTime.x)*randoms.r;\n#ifdef LIFETIMEGRADIENTS\nparticlesOut.particles[index].life=params.lifeTimeGradientRange.x+(params.lifeTimeGradientRange.y-params.lifeTimeGradientRange.x)*randoms.r;\n#else\nparticlesOut.particles[index].life=outLife;\n#endif\n#ifdef EMITRATECTRL\nparticlesOut.particles[index].age=0.0;\n#else\nparticlesOut.particles[index].age=newAge-life;\n#endif\nparticlesOut.particles[index].seed=seed;var sizex : f32;\n#ifdef SIZEGRADIENTS \nlet sizeGradientRange=textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(0.,0.),0.).rg;sizex=sizeGradientRange.x+(sizeGradientRange.y-sizeGradientRange.x)*seed.y;\n#else\nsizex=params.sizeRange.x+(params.sizeRange.y-params.sizeRange.x)*randoms.g;\n#endif\n#ifdef STARTSIZEGRADIENTS\nsizex*=params.startSizeGradientFactor;\n#endif\nparticlesOut.particles[index].size=vec3<f32>(\nsizex,\nparams.scaleRange.x+(params.scaleRange.y-params.scaleRange.x)*randoms.b,\nparams.scaleRange.z+(params.scaleRange.w-params.scaleRange.z)*randoms.a);\n#ifndef COLORGRADIENTS\nparticlesOut.particles[index].color=params.color1+(params.color2-params.color1)*randoms.b;\n#endif\n#ifndef ANGULARSPEEDGRADIENTS \nparticlesOut.particles[index].angle=vec2<f32>(\nparams.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r,\nparams.angleRange.x+(params.angleRange.y-params.angleRange.x)*randoms.a);\n#else\nparticlesOut.particles[index].angle=params.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r;\n#endif \n#if defined(POINTEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=vec3<f32>(0.,0.,0.);newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#elif defined(BOXEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=params.minEmitBox+(params.maxEmitBox-params.minEmitBox)*randoms2;newDirection=params.direction1+(params.direction2-params.direction1)*randoms3; \n#elif defined(HEMISPHERICEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,abs(randY),randZ);newDirection=normalize(newPosition+params.directionRandomizer*randoms3);\n#elif defined(SPHEREEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,randY,randZ);\n#ifdef DIRECTEDSPHEREEMITTER\nnewDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#else\nnewDirection=normalize(newPosition+params.directionRandomizer*randoms3);\n#endif\n#elif defined(CYLINDEREMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let yPos : f32=(-0.5+randoms2.x)*params.height;var angle : f32=randoms2.y*PI*2.;let inverseRadiusRangeSquared : f32=(1.-params.radiusRange)*(1.-params.radiusRange);let positionRadius : f32=params.radius*sqrt(inverseRadiusRangeSquared+randoms2.z*(1.-inverseRadiusRangeSquared));let xPos : f32=positionRadius*cos(angle);let zPos : f32=positionRadius*sin(angle);newPosition=vec3<f32>(xPos,yPos,zPos);\n#ifdef DIRECTEDCYLINDEREMITTER\nnewDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#else\nangle=angle+(-0.5+randoms3.x)*PI*params.directionRandomizer;newDirection=vec3<f32>(cos(angle),(-0.5+randoms3.y)*params.directionRandomizer,sin(angle));newDirection=normalize(newDirection);\n#endif\n#elif defined(CONEEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let s : f32=2.0*PI*randoms2.x;\n#ifdef CONEEMITTERSPAWNPOINT\nlet h : f32=0.0001;\n#else\nvar h : f32=randoms2.y*params.height.y;h=1.-h*h; \n#endif\nvar lRadius : f32=params.radius.x-params.radius.x*randoms2.z*params.radius.y;lRadius=lRadius*h;let randX : f32=lRadius*sin(s);let randZ : f32=lRadius*cos(s);let randY : f32=h *params.height.x;newPosition=vec3<f32>(randX,randY,randZ); \nlet randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);\n#ifdef DIRECTEDCONEEMITTER\nnewDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#else\nif (abs(cos(params.coneAngle))==1.0) {newDirection=vec3<f32>(0.,1.0,0.);} else {newDirection=normalize(newPosition+params.directionRandomizer*randoms3); }\n#endif\n#elif defined(MESHEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);var triIdx : i32=i32(floor(randoms2.x*f32(params.meshTriangleCount)));triIdx=min(triIdx,params.meshTriangleCount-1);let baseTexel : i32=triIdx*3;let t0 : i32=baseTexel;let t1 : i32=baseTexel+1;let t2 : i32=baseTexel+2;let v0 : vec3<f32>=textureLoad(meshPositionTexture,vec2<i32>(t0 % params.meshTextureWidth,t0/params.meshTextureWidth),0).xyz;let v1 : vec3<f32>=textureLoad(meshPositionTexture,vec2<i32>(t1 % params.meshTextureWidth,t1/params.meshTextureWidth),0).xyz;let v2 : vec3<f32>=textureLoad(meshPositionTexture,vec2<i32>(t2 % params.meshTextureWidth,t2/params.meshTextureWidth),0).xyz;let bu : f32=randoms2.y;let bv : f32=randoms2.z*(1.0-bu);let bw : f32=1.0-bu-bv;newPosition=bu*v0+bv*v1+bw*v2;\n#ifdef MESHNORMALS\nlet n0 : vec3<f32>=textureLoad(meshNormalTexture,vec2<i32>(t0 % params.meshTextureWidth,t0/params.meshTextureWidth),0).xyz;let n1 : vec3<f32>=textureLoad(meshNormalTexture,vec2<i32>(t1 % params.meshTextureWidth,t1/params.meshTextureWidth),0).xyz;let n2 : vec3<f32>=textureLoad(meshNormalTexture,vec2<i32>(t2 % params.meshTextureWidth,t2/params.meshTextureWidth),0).xyz;newDirection=normalize(bu*n0+bv*n1+bw*n2);\n#else\nnewDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#endif\n#elif defined(CUSTOMEMITTER)\nnewPosition=particlesIn.particles[index].initialPosition;particlesOut.particles[index].initialPosition=newPosition;\n#else \nnewPosition=vec3<f32>(0.,0.,0.);newDirection=2.0*(getRandomVec3(seed.w,vertexID)-vec3<f32>(0.5,0.5,0.5));\n#endif\nlet power : f32=params.emitPower.x+(params.emitPower.y-params.emitPower.x)*randoms.a;\n#ifdef LOCAL\nparticlesOut.particles[index].position=newPosition;\n#else\nparticlesOut.particles[index].position=(params.emitterWM*vec4<f32>(newPosition,1.)).xyz;\n#endif\n#ifdef CUSTOMEMITTER\nparticlesOut.particles[index].direction=direction;\n#ifndef BILLBOARD \nparticlesOut.particles[index].initialDirection=direction;\n#endif\n#else\n#ifdef LOCAL\nlet initial : vec3<f32>=newDirection;\n#else \nlet initial : vec3<f32>=(params.emitterWM*vec4<f32>(newDirection,0.)).xyz;\n#endif\nparticlesOut.particles[index].direction=initial*power;\n#ifndef BILLBOARD \nparticlesOut.particles[index].initialDirection=initial;\n#endif\n#endif\n#ifdef ANIMATESHEET \nparticlesOut.particles[index].cellIndex=params.cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\nparticlesOut.particles[index].cellStartOffset=randoms.a*outLife;\n#endif \n#endif\n#ifdef NOISE\nparticlesOut.particles[index].noiseCoordinates1=particlesIn.particles[index].noiseCoordinates1;particlesOut.particles[index].noiseCoordinates2=particlesIn.particles[index].noiseCoordinates2;\n#endif\n} else {var directionScale : f32=timeDelta;particlesOut.particles[index].age=newAge;let ageGradient : f32=newAge/life;\n#ifdef VELOCITYGRADIENTS\nlet velocityGradientRange=textureSampleLevel(velocityGradientTexture,velocityGradientSampler,vec2<f32>(ageGradient,0.),0.).rg;directionScale=directionScale*(velocityGradientRange.x+(velocityGradientRange.y-velocityGradientRange.x)*seed.w);\n#endif\n#ifdef DRAGGRADIENTS\nlet dragGradientRange=textureSampleLevel(dragGradientTexture,dragGradientSampler,vec2<f32>(ageGradient,0.),0.).rg;directionScale=directionScale*(1.0-(dragGradientRange.x+(dragGradientRange.y-dragGradientRange.x)*seed.x));\n#endif\nlet position : vec3<f32>=particlesIn.particles[index].position;\n#if defined(CUSTOMEMITTER)\nparticlesOut.particles[index].position=position+(direction-position)*ageGradient; \nparticlesOut.particles[index].initialPosition=particlesIn.particles[index].initialPosition;\n#else\nparticlesOut.particles[index].position=position+direction*directionScale;\n#endif\nparticlesOut.particles[index].life=life;particlesOut.particles[index].seed=seed;\n#ifndef COLORGRADIENTS \nparticlesOut.particles[index].color=particlesIn.particles[index].color;\n#endif\n#ifdef SIZEGRADIENTS\nlet sizeGradientRange=textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(ageGradient,0.),0.).rg;particlesOut.particles[index].size=vec3<f32>(\nsizeGradientRange.x+(sizeGradientRange.y-sizeGradientRange.x)*seed.y,\nparticlesIn.particles[index].size.yz);\n#else\nparticlesOut.particles[index].size=particlesIn.particles[index].size;\n#endif \n#ifndef BILLBOARD \nparticlesOut.particles[index].initialDirection=particlesIn.particles[index].initialDirection;\n#endif\n#ifdef CUSTOMEMITTER\nparticlesOut.particles[index].direction=direction;\n#else\nvar updatedDirection : vec3<f32>=direction+params.gravity*timeDelta;\n#ifdef FLOWMAP\nvar clipSpace=(params.flowMapProjection*vec4f(position,1.));var ndcSpace=clipSpace.xyz/clipSpace.w;var flowMapUV=ndcSpace.xy*0.5+0.5;var flowMapValue=textureSampleLevel(flowMapTexture,flowMapSampler,flowMapUV,0.);var flowMapDirection=(flowMapValue.xyz*2.0-1.0)*flowMapValue.w;updatedDirection+=flowMapDirection*timeDelta*params.flowMapStrength;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\nlet limitVelocityRange=textureSampleLevel(limitVelocityGradientTexture,limitVelocityGradientSampler,vec2<f32>(ageGradient,0.),0.).rg;let limitVelocity : f32=limitVelocityRange.x+(limitVelocityRange.y-limitVelocityRange.x)*seed.y;let currentVelocity : f32=length(updatedDirection);if (currentVelocity>limitVelocity) {updatedDirection=updatedDirection*params.limitVelocityDamping;}\n#endif\n#ifdef ATTRACTORS\n{for (var i : i32=0; i<params.attractorCount; i=i+1) {let toAttractor : vec3<f32>=params.attractorPositionAndStrength[i].xyz-position;let distSq : f32=dot(toAttractor,toAttractor)+1.0;updatedDirection=updatedDirection+(params.attractorPositionAndStrength[i].w/distSq)*normalize(toAttractor)*timeDelta;}}\n#endif\nparticlesOut.particles[index].direction=updatedDirection;\n#ifdef NOISE\nlet noiseCoordinates1 : vec3<f32>=particlesIn.particles[index].noiseCoordinates1;let noiseCoordinates2 : vec3<f32>=particlesIn.particles[index].noiseCoordinates2;let fetchedR : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.x,noiseCoordinates1.y)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let fetchedG : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.z,noiseCoordinates2.x)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let fetchedB : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates2.y,noiseCoordinates2.z)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let force : vec3<f32>=vec3<f32>(-1.+2.*fetchedR,-1.+2.*fetchedG,-1.+2.*fetchedB)*params.noiseStrength;particlesOut.particles[index].direction=particlesOut.particles[index].direction+force*timeDelta;particlesOut.particles[index].noiseCoordinates1=noiseCoordinates1;particlesOut.particles[index].noiseCoordinates2=noiseCoordinates2;\n#endif \n#endif \n#ifdef ANGULARSPEEDGRADIENTS\nlet angularSpeedRange=textureSampleLevel(angularSpeedGradientTexture,angularSpeedGradientSampler,vec2<f32>(ageGradient,0.),0.).rg;let angularSpeed : f32=angularSpeedRange.x+(angularSpeedRange.y-angularSpeedRange.x)*seed.z;particlesOut.particles[index].angle=particlesIn.particles[index].angle+angularSpeed*timeDelta;\n#else\nlet angle : vec2<f32>=particlesIn.particles[index].angle;particlesOut.particles[index].angle=vec2<f32>(angle.x+angle.y*timeDelta,angle.y);\n#endif\n#ifdef ANIMATESHEET \nvar offsetAge : f32=particlesOut.particles[index].age;let dist : f32=params.cellInfos.y-params.cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\nlet cellStartOffset : f32=particlesIn.particles[index].cellStartOffset;particlesOut.particles[index].cellStartOffset=cellStartOffset;offsetAge=offsetAge+cellStartOffset;\n#else\nlet cellStartOffset : f32=0.;\n#endif \nvar ratio : f32;if (params.cellInfos.w==1.0) {ratio=clamp(((cellStartOffset+params.cellInfos.z*offsetAge) % life)/life,0.,1.0);}\nelse {ratio=clamp((cellStartOffset+params.cellInfos.z*offsetAge)/life,0.,1.0);}\nparticlesOut.particles[index].cellIndex=f32(i32(params.cellInfos.x+ratio*dist));\n#endif\n}}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n\n/** @internal */\nexport const gpuUpdateParticlesComputeShaderWGSL = { name, shader };\n"]}
1
+ {"version":3,"file":"gpuUpdateParticles.compute.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gpuUpdateParticles.compute.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,iCAAiC,CAAC;AAC/C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuVd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AAED,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 = \"gpuUpdateParticlesComputeShader\";\nconst shader = `struct Particle {position : vec3<f32>,\nage : f32,\nsize : vec3<f32>,\nlife : f32,\nseed : vec4<f32>,\ndirection : vec3<f32>,\ndummy0: f32,\n#ifdef CUSTOMEMITTER\ninitialPosition : vec3<f32>,\ndummy1: f32,\n#endif\n#ifndef COLORGRADIENTS\ncolor : vec4<f32>,\n#endif\n#ifndef BILLBOARD\ninitialDirection : vec3<f32>,\ndummy2: f32,\n#endif\n#ifdef NOISE\nnoiseCoordinates1 : vec3<f32>,\ndummy3: f32,\nnoiseCoordinates2 : vec3<f32>,\ndummy4: f32,\n#endif\n#ifdef ANGULARSPEEDGRADIENTS\nangle : f32,\n#else\nangle : vec2<f32>,\n#endif\n#ifdef ANIMATESHEET\ncellIndex : f32,\n#ifdef ANIMATESHEETRANDOMSTART\ncellStartOffset : f32,\n#endif\n#endif\n};struct Particles {particles : array<Particle>,};struct SimParams {currentCount : f32,\ntimeDelta : f32,\nstopFactor : f32,\nrandomTextureSize: i32,\nlifeTime : vec2<f32>,\nemitPower : vec2<f32>,\nemitIndex : f32,\nemitCount : f32,\n#ifndef COLORGRADIENTS\ncolor1 : vec4<f32>,\ncolor2 : vec4<f32>,\n#endif\nsizeRange : vec2<f32>,\nscaleRange : vec4<f32>,\nangleRange : vec4<f32>,\ngravity : vec3<f32>,\n#ifdef LIMITVELOCITYGRADIENTS\nlimitVelocityDamping : f32,\n#endif\n#ifdef ANIMATESHEET\ncellInfos : vec4<f32>,\n#endif\n#ifdef NOISE\nnoiseStrength : vec3<f32>,\n#endif\n#ifdef FLOWMAP\nflowMapProjection : mat4x4<f32>,\nflowMapStrength : f32,\n#endif\n#ifndef LOCAL\nemitterWM : mat4x4<f32>,\n#endif\n#ifdef ATTRACTORS\nattractorCount : i32,\nattractorPositionAndStrength : array<vec4<f32>,MAX_ATTRACTORS>,\n#endif\n#ifdef STARTSIZEGRADIENTS\nstartSizeGradientFactor : f32,\n#endif\n#ifdef LIFETIMEGRADIENTS\nlifeTimeGradientRange : vec2<f32>,\n#endif\n#ifdef MESHEMITTER\nmeshTriangleCount : i32,\nmeshTextureWidth : i32,\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#endif\n#ifdef BOXEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\nminEmitBox : vec3<f32>,\nmaxEmitBox : vec3<f32>,\n#endif\n#ifdef CONEEMITTER\nradius : vec2<f32>,\nconeAngle : f32,\nheight : vec2<f32>,\n#ifdef DIRECTEDCONEEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#else\ndirectionRandomizer : f32,\n#endif\n#endif\n#ifdef CYLINDEREMITTER\nradius : f32,\nheight : f32,\nradiusRange : f32,\n#ifdef DIRECTEDCYLINDEREMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#else\ndirectionRandomizer : f32,\n#endif\n#endif\n#ifdef HEMISPHERICEMITTER\nradius : f32,\nradiusRange : f32,\ndirectionRandomizer : f32,\n#endif\n#ifdef POINTEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#endif\n#ifdef SPHEREEMITTER\nradius : f32,\nradiusRange : f32,\n#ifdef DIRECTEDSPHEREEMITTER\ndirection1 : vec3<f32>,\ndirection2 : vec3<f32>,\n#else\ndirectionRandomizer : f32,\n#endif\n#endif\n};@binding(0) @group(0) var<uniform> params : SimParams;@binding(1) @group(0) var<storage,read> particlesIn : Particles;@binding(2) @group(0) var<storage,read_write> particlesOut : Particles;@binding(3) @group(0) var randomTexture : texture_2d<f32>;@binding(4) @group(0) var randomTexture2 : texture_2d<f32>;\n#ifdef SIZEGRADIENTS\n@binding(0) @group(1) var sizeGradientSampler : sampler;@binding(1) @group(1) var sizeGradientTexture : texture_2d<f32>;\n#endif \n#ifdef ANGULARSPEEDGRADIENTS\n@binding(2) @group(1) var angularSpeedGradientSampler : sampler;@binding(3) @group(1) var angularSpeedGradientTexture : texture_2d<f32>;\n#endif \n#ifdef VELOCITYGRADIENTS\n@binding(4) @group(1) var velocityGradientSampler : sampler;@binding(5) @group(1) var velocityGradientTexture : texture_2d<f32>;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\n@binding(6) @group(1) var limitVelocityGradientSampler : sampler;@binding(7) @group(1) var limitVelocityGradientTexture : texture_2d<f32>;\n#endif\n#ifdef DRAGGRADIENTS\n@binding(8) @group(1) var dragGradientSampler : sampler;@binding(9) @group(1) var dragGradientTexture : texture_2d<f32>;\n#endif\n#ifdef NOISE\n@binding(10) @group(1) var noiseSampler : sampler;@binding(11) @group(1) var noiseTexture : texture_2d<f32>;\n#endif\n#ifdef FLOWMAP\n@binding(12) @group(1) var flowMapSampler : sampler;@binding(13) @group(1) var flowMapTexture : texture_2d<f32>;\n#endif\n#ifdef MESHEMITTER\n@binding(14) @group(1) var meshPositionTexture : texture_2d<f32>;\n#ifdef MESHNORMALS\n@binding(15) @group(1) var meshNormalTexture : texture_2d<f32>;\n#endif\n#endif\nfn getRandomVec3(offset : f32,vertexID : f32)->vec3<f32> {return textureLoad(randomTexture2,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0).rgb;}\nfn getRandomVec4(offset : f32,vertexID : f32)->vec4<f32> {return textureLoad(randomTexture,vec2<i32>(i32(vertexID*offset/params.currentCount*f32(params.randomTextureSize)) % params.randomTextureSize,0),0);}\n@compute @workgroup_size(64)\nfn main(@builtin(global_invocation_id) GlobalInvocationID : vec3<u32>) {let index : u32=GlobalInvocationID.x;let vertexID : f32=f32(index);if (index>=u32(params.currentCount)) {return;}\nlet PI : f32=3.14159;let timeDelta : f32=params.timeDelta;let newAge : f32=particlesIn.particles[index].age+timeDelta;let life : f32=particlesIn.particles[index].life;let seed : vec4<f32>=particlesIn.particles[index].seed;let direction : vec3<f32>=particlesIn.particles[index].direction;\n#ifdef EMITRATECTRL\nvar offsetFromEmitIndex : f32=vertexID-params.emitIndex;if (offsetFromEmitIndex<0.0) {offsetFromEmitIndex+=params.currentCount; }\nlet shouldEmit : bool=offsetFromEmitIndex<params.emitCount && params.stopFactor != 0.;\n#else\nlet shouldEmit : bool=newAge>=life && params.stopFactor != 0.;\n#endif\nif (shouldEmit) {var newPosition : vec3<f32>;var newDirection : vec3<f32>;let randoms : vec4<f32>=getRandomVec4(seed.x,vertexID);let outLife : f32=params.lifeTime.x+(params.lifeTime.y-params.lifeTime.x)*randoms.r;\n#ifdef LIFETIMEGRADIENTS\nparticlesOut.particles[index].life=params.lifeTimeGradientRange.x+(params.lifeTimeGradientRange.y-params.lifeTimeGradientRange.x)*randoms.r;\n#else\nparticlesOut.particles[index].life=outLife;\n#endif\n#ifdef EMITRATECTRL\nparticlesOut.particles[index].age=0.0;\n#else\nparticlesOut.particles[index].age=newAge-life;\n#endif\nparticlesOut.particles[index].seed=seed;var sizex : f32;\n#ifdef SIZEGRADIENTS \nlet sizeGradientRange=textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(0.,0.),0.).rg;sizex=sizeGradientRange.x+(sizeGradientRange.y-sizeGradientRange.x)*seed.y;\n#else\nsizex=params.sizeRange.x+(params.sizeRange.y-params.sizeRange.x)*randoms.g;\n#endif\n#ifdef STARTSIZEGRADIENTS\nsizex*=params.startSizeGradientFactor;\n#endif\nparticlesOut.particles[index].size=vec3<f32>(\nsizex,\nparams.scaleRange.x+(params.scaleRange.y-params.scaleRange.x)*randoms.b,\nparams.scaleRange.z+(params.scaleRange.w-params.scaleRange.z)*randoms.a);\n#ifndef COLORGRADIENTS\nparticlesOut.particles[index].color=params.color1+(params.color2-params.color1)*randoms.b;\n#endif\n#ifndef ANGULARSPEEDGRADIENTS \nparticlesOut.particles[index].angle=vec2<f32>(\nparams.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r,\nparams.angleRange.x+(params.angleRange.y-params.angleRange.x)*randoms.a);\n#else\nparticlesOut.particles[index].angle=params.angleRange.z+(params.angleRange.w-params.angleRange.z)*randoms.r;\n#endif \n#if defined(POINTEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=vec3<f32>(0.,0.,0.);newDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#elif defined(BOXEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);newPosition=params.minEmitBox+(params.maxEmitBox-params.minEmitBox)*randoms2;newDirection=params.direction1+(params.direction2-params.direction1)*randoms3; \n#elif defined(HEMISPHERICEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,abs(randY),randZ);let hemisphereDirection : vec3<f32>=newPosition+params.directionRandomizer*randoms3;let hemisphereDirectionLength : f32=length(hemisphereDirection);newDirection=select(vec3<f32>(0.0),hemisphereDirection/hemisphereDirectionLength,hemisphereDirectionLength>0.0);\n#elif defined(SPHEREEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let phi : f32=2.0*PI*randoms2.x;let theta : f32=acos(-1.0+2.0*randoms2.y);let randX : f32=cos(phi)*sin(theta);let randY : f32=cos(theta);let randZ : f32=sin(phi)*sin(theta);newPosition=(params.radius-(params.radius*params.radiusRange*randoms2.z))*vec3<f32>(randX,randY,randZ);\n#ifdef DIRECTEDSPHEREEMITTER\nnewDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#else\nnewDirection=normalize(newPosition+params.directionRandomizer*randoms3);\n#endif\n#elif defined(CYLINDEREMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);let yPos : f32=(-0.5+randoms2.x)*params.height;var angle : f32=randoms2.y*PI*2.;let inverseRadiusRangeSquared : f32=(1.-params.radiusRange)*(1.-params.radiusRange);let positionRadius : f32=params.radius*sqrt(inverseRadiusRangeSquared+randoms2.z*(1.-inverseRadiusRangeSquared));let xPos : f32=positionRadius*cos(angle);let zPos : f32=positionRadius*sin(angle);newPosition=vec3<f32>(xPos,yPos,zPos);\n#ifdef DIRECTEDCYLINDEREMITTER\nnewDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#else\nangle=angle+(-0.5+randoms3.x)*PI*params.directionRandomizer;newDirection=vec3<f32>(cos(angle),(-0.5+randoms3.y)*params.directionRandomizer,sin(angle));newDirection=normalize(newDirection);\n#endif\n#elif defined(CONEEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let s : f32=2.0*PI*randoms2.x;\n#ifdef CONEEMITTERSPAWNPOINT\nlet h : f32=0.0001;\n#else\nvar h : f32=randoms2.y*params.height.y;h=1.-h*h; \n#endif\nvar lRadius : f32=params.radius.x-params.radius.x*randoms2.z*params.radius.y;lRadius=lRadius*h;let randX : f32=lRadius*sin(s);let randZ : f32=lRadius*cos(s);let randY : f32=h *params.height.x;newPosition=vec3<f32>(randX,randY,randZ); \nlet randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);\n#ifdef DIRECTEDCONEEMITTER\nnewDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#else\nif (abs(cos(params.coneAngle))==1.0) {newDirection=vec3<f32>(0.,1.0,0.);} else {newDirection=normalize(newPosition+params.directionRandomizer*randoms3); }\n#endif\n#elif defined(MESHEMITTER)\nlet randoms2 : vec3<f32>=getRandomVec3(seed.y,vertexID);let randoms3 : vec3<f32>=getRandomVec3(seed.z,vertexID);var triIdx : i32=i32(floor(randoms2.x*f32(params.meshTriangleCount)));triIdx=min(triIdx,params.meshTriangleCount-1);let baseTexel : i32=triIdx*3;let t0 : i32=baseTexel;let t1 : i32=baseTexel+1;let t2 : i32=baseTexel+2;let v0 : vec3<f32>=textureLoad(meshPositionTexture,vec2<i32>(t0 % params.meshTextureWidth,t0/params.meshTextureWidth),0).xyz;let v1 : vec3<f32>=textureLoad(meshPositionTexture,vec2<i32>(t1 % params.meshTextureWidth,t1/params.meshTextureWidth),0).xyz;let v2 : vec3<f32>=textureLoad(meshPositionTexture,vec2<i32>(t2 % params.meshTextureWidth,t2/params.meshTextureWidth),0).xyz;let bu : f32=randoms2.y;let bv : f32=randoms2.z*(1.0-bu);let bw : f32=1.0-bu-bv;newPosition=bu*v0+bv*v1+bw*v2;\n#ifdef MESHNORMALS\nlet n0 : vec3<f32>=textureLoad(meshNormalTexture,vec2<i32>(t0 % params.meshTextureWidth,t0/params.meshTextureWidth),0).xyz;let n1 : vec3<f32>=textureLoad(meshNormalTexture,vec2<i32>(t1 % params.meshTextureWidth,t1/params.meshTextureWidth),0).xyz;let n2 : vec3<f32>=textureLoad(meshNormalTexture,vec2<i32>(t2 % params.meshTextureWidth,t2/params.meshTextureWidth),0).xyz;newDirection=normalize(bu*n0+bv*n1+bw*n2);\n#else\nnewDirection=params.direction1+(params.direction2-params.direction1)*randoms3;\n#endif\n#elif defined(CUSTOMEMITTER)\nnewPosition=particlesIn.particles[index].initialPosition;particlesOut.particles[index].initialPosition=newPosition;\n#else \nnewPosition=vec3<f32>(0.,0.,0.);newDirection=2.0*(getRandomVec3(seed.w,vertexID)-vec3<f32>(0.5,0.5,0.5));\n#endif\nlet power : f32=params.emitPower.x+(params.emitPower.y-params.emitPower.x)*randoms.a;\n#ifdef LOCAL\nparticlesOut.particles[index].position=newPosition;\n#else\nparticlesOut.particles[index].position=(params.emitterWM*vec4<f32>(newPosition,1.)).xyz;\n#endif\n#ifdef CUSTOMEMITTER\nparticlesOut.particles[index].direction=direction;\n#ifndef BILLBOARD \nparticlesOut.particles[index].initialDirection=direction;\n#endif\n#else\n#ifdef LOCAL\nlet initial : vec3<f32>=newDirection;\n#else \nlet initial : vec3<f32>=(params.emitterWM*vec4<f32>(newDirection,0.)).xyz;\n#endif\nparticlesOut.particles[index].direction=initial*power;\n#ifndef BILLBOARD \nparticlesOut.particles[index].initialDirection=initial;\n#endif\n#endif\n#ifdef ANIMATESHEET \nparticlesOut.particles[index].cellIndex=params.cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\nparticlesOut.particles[index].cellStartOffset=randoms.a*outLife;\n#endif \n#endif\n#ifdef NOISE\nparticlesOut.particles[index].noiseCoordinates1=particlesIn.particles[index].noiseCoordinates1;particlesOut.particles[index].noiseCoordinates2=particlesIn.particles[index].noiseCoordinates2;\n#endif\n} else {var directionScale : f32=timeDelta;particlesOut.particles[index].age=newAge;let ageGradient : f32=newAge/life;\n#ifdef VELOCITYGRADIENTS\nlet velocityGradientRange=textureSampleLevel(velocityGradientTexture,velocityGradientSampler,vec2<f32>(ageGradient,0.),0.).rg;directionScale=directionScale*(velocityGradientRange.x+(velocityGradientRange.y-velocityGradientRange.x)*seed.w);\n#endif\n#ifdef DRAGGRADIENTS\nlet dragGradientRange=textureSampleLevel(dragGradientTexture,dragGradientSampler,vec2<f32>(ageGradient,0.),0.).rg;directionScale=directionScale*(1.0-(dragGradientRange.x+(dragGradientRange.y-dragGradientRange.x)*seed.x));\n#endif\nlet position : vec3<f32>=particlesIn.particles[index].position;\n#if defined(CUSTOMEMITTER)\nparticlesOut.particles[index].position=position+(direction-position)*ageGradient; \nparticlesOut.particles[index].initialPosition=particlesIn.particles[index].initialPosition;\n#else\nparticlesOut.particles[index].position=position+direction*directionScale;\n#endif\nparticlesOut.particles[index].life=life;particlesOut.particles[index].seed=seed;\n#ifndef COLORGRADIENTS \nparticlesOut.particles[index].color=particlesIn.particles[index].color;\n#endif\n#ifdef SIZEGRADIENTS\nlet sizeGradientRange=textureSampleLevel(sizeGradientTexture,sizeGradientSampler,vec2<f32>(ageGradient,0.),0.).rg;particlesOut.particles[index].size=vec3<f32>(\nsizeGradientRange.x+(sizeGradientRange.y-sizeGradientRange.x)*seed.y,\nparticlesIn.particles[index].size.yz);\n#else\nparticlesOut.particles[index].size=particlesIn.particles[index].size;\n#endif \n#ifndef BILLBOARD \nparticlesOut.particles[index].initialDirection=particlesIn.particles[index].initialDirection;\n#endif\n#ifdef CUSTOMEMITTER\nparticlesOut.particles[index].direction=direction;\n#else\nvar updatedDirection : vec3<f32>=direction+params.gravity*timeDelta;\n#ifdef FLOWMAP\nvar clipSpace=(params.flowMapProjection*vec4f(position,1.));var ndcSpace=clipSpace.xyz/clipSpace.w;var flowMapUV=ndcSpace.xy*0.5+0.5;var flowMapValue=textureSampleLevel(flowMapTexture,flowMapSampler,flowMapUV,0.);var flowMapDirection=(flowMapValue.xyz*2.0-1.0)*flowMapValue.w;updatedDirection+=flowMapDirection*timeDelta*params.flowMapStrength;\n#endif\n#ifdef LIMITVELOCITYGRADIENTS\nlet limitVelocityRange=textureSampleLevel(limitVelocityGradientTexture,limitVelocityGradientSampler,vec2<f32>(ageGradient,0.),0.).rg;let limitVelocity : f32=limitVelocityRange.x+(limitVelocityRange.y-limitVelocityRange.x)*seed.y;let currentVelocity : f32=length(updatedDirection);if (currentVelocity>limitVelocity) {updatedDirection=updatedDirection*params.limitVelocityDamping;}\n#endif\n#ifdef ATTRACTORS\n{for (var i : i32=0; i<params.attractorCount; i=i+1) {let toAttractor : vec3<f32>=params.attractorPositionAndStrength[i].xyz-position;let distSq : f32=dot(toAttractor,toAttractor)+1.0;updatedDirection=updatedDirection+(params.attractorPositionAndStrength[i].w/distSq)*normalize(toAttractor)*timeDelta;}}\n#endif\nparticlesOut.particles[index].direction=updatedDirection;\n#ifdef NOISE\nlet noiseCoordinates1 : vec3<f32>=particlesIn.particles[index].noiseCoordinates1;let noiseCoordinates2 : vec3<f32>=particlesIn.particles[index].noiseCoordinates2;let fetchedR : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.x,noiseCoordinates1.y)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let fetchedG : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates1.z,noiseCoordinates2.x)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let fetchedB : f32=textureSampleLevel(noiseTexture,noiseSampler,vec2<f32>(noiseCoordinates2.y,noiseCoordinates2.z)*vec2<f32>(0.5,0.5)+vec2<f32>(0.5,0.5),0.).r;let force : vec3<f32>=vec3<f32>(-1.+2.*fetchedR,-1.+2.*fetchedG,-1.+2.*fetchedB)*params.noiseStrength;particlesOut.particles[index].direction=particlesOut.particles[index].direction+force*timeDelta;particlesOut.particles[index].noiseCoordinates1=noiseCoordinates1;particlesOut.particles[index].noiseCoordinates2=noiseCoordinates2;\n#endif \n#endif \n#ifdef ANGULARSPEEDGRADIENTS\nlet angularSpeedRange=textureSampleLevel(angularSpeedGradientTexture,angularSpeedGradientSampler,vec2<f32>(ageGradient,0.),0.).rg;let angularSpeed : f32=angularSpeedRange.x+(angularSpeedRange.y-angularSpeedRange.x)*seed.z;particlesOut.particles[index].angle=particlesIn.particles[index].angle+angularSpeed*timeDelta;\n#else\nlet angle : vec2<f32>=particlesIn.particles[index].angle;particlesOut.particles[index].angle=vec2<f32>(angle.x+angle.y*timeDelta,angle.y);\n#endif\n#ifdef ANIMATESHEET \nvar offsetAge : f32=particlesOut.particles[index].age;let dist : f32=params.cellInfos.y-params.cellInfos.x;\n#ifdef ANIMATESHEETRANDOMSTART\nlet cellStartOffset : f32=particlesIn.particles[index].cellStartOffset;particlesOut.particles[index].cellStartOffset=cellStartOffset;offsetAge=offsetAge+cellStartOffset;\n#else\nlet cellStartOffset : f32=0.;\n#endif \nvar ratio : f32;if (params.cellInfos.w==1.0) {ratio=clamp(((cellStartOffset+params.cellInfos.z*offsetAge) % life)/life,0.,1.0);}\nelse {ratio=clamp((cellStartOffset+params.cellInfos.z*offsetAge)/life,0.,1.0);}\nparticlesOut.particles[index].cellIndex=f32(i32(params.cellInfos.x+ratio*dist));\n#endif\n}}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n\n/** @internal */\nexport const gpuUpdateParticlesComputeShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const gsSortCountComputeShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -0,0 +1,19 @@
1
+ // Do not edit.
2
+ import { ShaderStore } from "../Engines/shaderStore.js";
3
+ const name = "gsSortCountComputeShader";
4
+ const shader = `struct GsSortPassParams {count : u32,
5
+ numBlocks : u32,
6
+ shift : u32,
7
+ chunkCount : u32,}
8
+ @group(0) @binding(0) var<storage,read> params : GsSortPassParams;@group(0) @binding(1) var<storage,read> keysIn : array<u32>;@group(0) @binding(2) var<storage,read_write> sumTable : array<u32>;var<workgroup> hist : array<atomic<u32>,16>;@compute @workgroup_size(256,1,1)
9
+ fn main(@builtin(local_invocation_id) lid : vec3u,@builtin(workgroup_id) wid : vec3u) {let t=lid.x;let block=wid.y*65535u+wid.x;if (t<16u) {atomicStore(&hist[t],0u);}
10
+ workgroupBarrier();let base=block*1024u;for (var j=0u; j<4u; j++) {let idx=base+j*256u+t;if (idx<params.count) {atomicAdd(&hist[(keysIn[idx]>>params.shift) & 15u],1u);}}
11
+ workgroupBarrier();if (t<16u && block<params.numBlocks) {sumTable[t*params.numBlocks+block]=atomicLoad(&hist[t]);}}
12
+ `;
13
+ // Sideeffect
14
+ if (!ShaderStore.ShadersStoreWGSL[name]) {
15
+ ShaderStore.ShadersStoreWGSL[name] = shader;
16
+ }
17
+ /** @internal */
18
+ export const gsSortCountComputeShaderWGSL = { name, shader };
19
+ //# sourceMappingURL=gsSortCount.compute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gsSortCount.compute.js","sourceRoot":"","sources":["../../../../dev/core/src/ShadersWGSL/gsSortCount.compute.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG;;;;;;;;CAQd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"gsSortCountComputeShader\";\nconst shader = `struct GsSortPassParams {count : u32,\nnumBlocks : u32,\nshift : u32,\nchunkCount : u32,}\n@group(0) @binding(0) var<storage,read> params : GsSortPassParams;@group(0) @binding(1) var<storage,read> keysIn : array<u32>;@group(0) @binding(2) var<storage,read_write> sumTable : array<u32>;var<workgroup> hist : array<atomic<u32>,16>;@compute @workgroup_size(256,1,1)\nfn main(@builtin(local_invocation_id) lid : vec3u,@builtin(workgroup_id) wid : vec3u) {let t=lid.x;let block=wid.y*65535u+wid.x;if (t<16u) {atomicStore(&hist[t],0u);}\nworkgroupBarrier();let base=block*1024u;for (var j=0u; j<4u; j++) {let idx=base+j*256u+t;if (idx<params.count) {atomicAdd(&hist[(keysIn[idx]>>params.shift) & 15u],1u);}}\nworkgroupBarrier();if (t<16u && block<params.numBlocks) {sumTable[t*params.numBlocks+block]=atomicLoad(&hist[t]);}}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\n\n/** @internal */\nexport const gsSortCountComputeShaderWGSL = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const gsSortKeysComputeShaderWGSL: {
3
+ name: string;
4
+ shader: string;
5
+ };