@babylonjs/core 7.23.1 → 7.25.0

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 (295) hide show
  1. package/Animations/animation.js +3 -3
  2. package/Animations/animation.js.map +1 -1
  3. package/Audio/sound.js +15 -7
  4. package/Audio/sound.js.map +1 -1
  5. package/Behaviors/Meshes/followBehavior.js +3 -3
  6. package/Behaviors/Meshes/followBehavior.js.map +1 -1
  7. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +2 -2
  8. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  9. package/Compute/computeEffect.js +4 -4
  10. package/Compute/computeEffect.js.map +1 -1
  11. package/Engines/Extensions/engine.prefilteredCubeTexture.js +2 -3
  12. package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
  13. package/Engines/Processors/Expressions/shaderDefineExpression.js +1 -1
  14. package/Engines/Processors/Expressions/shaderDefineExpression.js.map +1 -1
  15. package/Engines/WebGPU/webgpuHardwareTexture.js +2 -2
  16. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  17. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +2 -2
  18. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  19. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +12 -10
  20. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  21. package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
  22. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  23. package/Engines/abstractEngine.js +2 -2
  24. package/Engines/abstractEngine.js.map +1 -1
  25. package/Engines/engineCapabilities.d.ts +2 -0
  26. package/Engines/engineCapabilities.js.map +1 -1
  27. package/Engines/nativeEngine.js +3 -2
  28. package/Engines/nativeEngine.js.map +1 -1
  29. package/Engines/nullEngine.js +1 -0
  30. package/Engines/nullEngine.js.map +1 -1
  31. package/Engines/thinEngine.js +2 -0
  32. package/Engines/thinEngine.js.map +1 -1
  33. package/Engines/webgpuEngine.js +1 -0
  34. package/Engines/webgpuEngine.js.map +1 -1
  35. package/LensFlares/lensFlareSystem.js +2 -2
  36. package/LensFlares/lensFlareSystem.js.map +1 -1
  37. package/Loading/sceneLoader.js +3 -3
  38. package/Loading/sceneLoader.js.map +1 -1
  39. package/Materials/Node/Blocks/Dual/lightBlock.js +17 -8
  40. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  41. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +2 -2
  42. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  43. package/Materials/Node/Blocks/PBR/reflectionBlock.js +1 -2
  44. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  45. package/Materials/Node/Blocks/PBR/refractionBlock.js +1 -2
  46. package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
  47. package/Materials/Node/Blocks/colorMergerBlock.js +1 -1
  48. package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
  49. package/Materials/Node/Blocks/vectorMergerBlock.js +1 -1
  50. package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
  51. package/Materials/PBR/pbrBaseMaterial.js +1 -2
  52. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  53. package/Materials/PBR/pbrSubSurfaceConfiguration.js +1 -2
  54. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  55. package/Materials/Textures/Filtering/hdrFiltering.d.ts +0 -2
  56. package/Materials/Textures/Filtering/hdrFiltering.js +12 -4
  57. package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
  58. package/Materials/Textures/Loaders/textureLoaderManager.d.ts +14 -1
  59. package/Materials/Textures/Loaders/textureLoaderManager.js +50 -21
  60. package/Materials/Textures/Loaders/textureLoaderManager.js.map +1 -1
  61. package/Materials/Textures/Procedurals/proceduralTexture.d.ts +15 -1
  62. package/Materials/Textures/Procedurals/proceduralTexture.js +24 -1
  63. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  64. package/Materials/Textures/index.d.ts +6 -0
  65. package/Materials/Textures/index.js +8 -0
  66. package/Materials/Textures/index.js.map +1 -1
  67. package/Materials/Textures/texture.js +2 -2
  68. package/Materials/Textures/texture.js.map +1 -1
  69. package/Materials/effect.functions.js +4 -4
  70. package/Materials/effect.functions.js.map +1 -1
  71. package/Maths/math.color.js +6 -7
  72. package/Maths/math.color.js.map +1 -1
  73. package/Maths/math.path.js +5 -5
  74. package/Maths/math.path.js.map +1 -1
  75. package/Maths/math.scalar.d.ts +33 -191
  76. package/Maths/math.scalar.functions.d.ts +147 -0
  77. package/Maths/math.scalar.functions.js +247 -0
  78. package/Maths/math.scalar.functions.js.map +1 -1
  79. package/Maths/math.scalar.js +15 -303
  80. package/Maths/math.scalar.js.map +1 -1
  81. package/Meshes/Builders/decalBuilder.js +3 -3
  82. package/Meshes/Builders/decalBuilder.js.map +1 -1
  83. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +8 -1
  84. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +30 -13
  85. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  86. package/Meshes/Node/Blocks/conditionBlock.js +2 -2
  87. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  88. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +4 -4
  89. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  90. package/Meshes/Node/Blocks/noiseBlock.js +3 -3
  91. package/Meshes/Node/Blocks/noiseBlock.js.map +1 -1
  92. package/Meshes/geodesicMesh.js +3 -3
  93. package/Meshes/geodesicMesh.js.map +1 -1
  94. package/Meshes/trailMesh.js +4 -4
  95. package/Meshes/trailMesh.js.map +1 -1
  96. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +7 -7
  97. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
  98. package/Misc/PerformanceViewer/performanceViewerCollector.js +2 -1
  99. package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
  100. package/Misc/basis.js +2 -3
  101. package/Misc/basis.js.map +1 -1
  102. package/Misc/dds.js +9 -9
  103. package/Misc/dds.js.map +1 -1
  104. package/Misc/dumpTools.js +2 -2
  105. package/Misc/dumpTools.js.map +1 -1
  106. package/Misc/environmentTextureTools.js +4 -4
  107. package/Misc/environmentTextureTools.js.map +1 -1
  108. package/Misc/reflector.js +3 -3
  109. package/Misc/reflector.js.map +1 -1
  110. package/Misc/screenshotTools.d.ts +2 -1
  111. package/Misc/screenshotTools.js +3 -2
  112. package/Misc/screenshotTools.js.map +1 -1
  113. package/Misc/tools.d.ts +6 -3
  114. package/Misc/tools.js +5 -3
  115. package/Misc/tools.js.map +1 -1
  116. package/Particles/EmitterTypes/coneParticleEmitter.js +10 -10
  117. package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
  118. package/Particles/EmitterTypes/cylinderParticleEmitter.js +9 -9
  119. package/Particles/EmitterTypes/cylinderParticleEmitter.js.map +1 -1
  120. package/Particles/EmitterTypes/hemisphericParticleEmitter.js +7 -7
  121. package/Particles/EmitterTypes/hemisphericParticleEmitter.js.map +1 -1
  122. package/Particles/EmitterTypes/meshParticleEmitter.js +4 -4
  123. package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
  124. package/Particles/EmitterTypes/pointParticleEmitter.js +4 -4
  125. package/Particles/EmitterTypes/pointParticleEmitter.js.map +1 -1
  126. package/Particles/EmitterTypes/sphereParticleEmitter.js +10 -10
  127. package/Particles/EmitterTypes/sphereParticleEmitter.js.map +1 -1
  128. package/Particles/gpuParticleSystem.js +2 -2
  129. package/Particles/gpuParticleSystem.js.map +1 -1
  130. package/Particles/pointsCloudSystem.js +8 -8
  131. package/Particles/pointsCloudSystem.js.map +1 -1
  132. package/Physics/v1/Plugins/ammoJSPlugin.js +2 -2
  133. package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
  134. package/Physics/v2/physicsAggregate.js +2 -2
  135. package/Physics/v2/physicsAggregate.js.map +1 -1
  136. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js +2 -2
  137. package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js.map +1 -1
  138. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -2
  139. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  140. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +4 -4
  141. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  142. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +2 -2
  143. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  144. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +4 -0
  145. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +6 -0
  146. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  147. package/PostProcesses/postProcess.d.ts +4 -0
  148. package/PostProcesses/postProcess.js +1 -0
  149. package/PostProcesses/postProcess.js.map +1 -1
  150. package/Rendering/IBLShadows/iblShadowsAccumulationPass.d.ts +0 -2
  151. package/Rendering/IBLShadows/iblShadowsAccumulationPass.js +46 -3
  152. package/Rendering/IBLShadows/iblShadowsAccumulationPass.js.map +1 -1
  153. package/Rendering/IBLShadows/iblShadowsImportanceSamplingRenderer.d.ts +0 -5
  154. package/Rendering/IBLShadows/iblShadowsImportanceSamplingRenderer.js +33 -5
  155. package/Rendering/IBLShadows/iblShadowsImportanceSamplingRenderer.js.map +1 -1
  156. package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +8 -3
  157. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +56 -18
  158. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  159. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.d.ts +0 -2
  160. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js +20 -2
  161. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js.map +1 -1
  162. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.d.ts +2 -14
  163. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +108 -36
  164. package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
  165. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +0 -2
  166. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +23 -11
  167. package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
  168. package/Rendering/depthPeelingRenderer.d.ts +7 -3
  169. package/Rendering/depthPeelingRenderer.js +38 -3
  170. package/Rendering/depthPeelingRenderer.js.map +1 -1
  171. package/Rendering/index.d.ts +44 -0
  172. package/Rendering/index.js +46 -0
  173. package/Rendering/index.js.map +1 -1
  174. package/Shaders/iblCombineVoxelGrids.fragment.d.ts +5 -0
  175. package/Shaders/{combineVoxelGrids.fragment.js → iblCombineVoxelGrids.fragment.js} +3 -3
  176. package/Shaders/iblCombineVoxelGrids.fragment.js.map +1 -0
  177. package/Shaders/iblGenerateVoxelMip.fragment.d.ts +5 -0
  178. package/Shaders/{generateVoxelMip.fragment.js → iblGenerateVoxelMip.fragment.js} +3 -3
  179. package/Shaders/iblGenerateVoxelMip.fragment.js.map +1 -0
  180. package/Shaders/iblShadowVoxelTracing.fragment.js +18 -10
  181. package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
  182. package/Shaders/iblShadowsImportanceSamplingDebug.fragment.js +2 -1
  183. package/Shaders/iblShadowsImportanceSamplingDebug.fragment.js.map +1 -1
  184. package/Shaders/{voxelGrid.fragment.d.ts → iblVoxelGrid.fragment.d.ts} +1 -1
  185. package/Shaders/{voxelGrid.fragment.js → iblVoxelGrid.fragment.js} +3 -3
  186. package/Shaders/iblVoxelGrid.fragment.js.map +1 -0
  187. package/Shaders/{voxelSlabDebug.fragment.d.ts → iblVoxelGrid.vertex.d.ts} +1 -1
  188. package/Shaders/{voxelGrid.vertex.js → iblVoxelGrid.vertex.js} +8 -4
  189. package/Shaders/iblVoxelGrid.vertex.js.map +1 -0
  190. package/Shaders/iblVoxelGrid2dArrayDebug.fragment.d.ts +5 -0
  191. package/Shaders/{voxelGrid2dArrayDebug.fragment.js → iblVoxelGrid2dArrayDebug.fragment.js} +3 -3
  192. package/Shaders/iblVoxelGrid2dArrayDebug.fragment.js.map +1 -0
  193. package/Shaders/iblVoxelGrid3dDebug.fragment.d.ts +5 -0
  194. package/Shaders/{voxelGrid3dDebug.fragment.js → iblVoxelGrid3dDebug.fragment.js} +3 -3
  195. package/Shaders/iblVoxelGrid3dDebug.fragment.js.map +1 -0
  196. package/Shaders/{combineVoxelGrids.fragment.d.ts → iblVoxelSlabDebug.fragment.d.ts} +1 -1
  197. package/Shaders/{voxelSlabDebug.fragment.js → iblVoxelSlabDebug.fragment.js} +3 -3
  198. package/Shaders/iblVoxelSlabDebug.fragment.js.map +1 -0
  199. package/Shaders/iblVoxelSlabDebug.vertex.d.ts +5 -0
  200. package/Shaders/{voxelSlabDebug.vertex.js → iblVoxelSlabDebug.vertex.js} +3 -3
  201. package/Shaders/iblVoxelSlabDebug.vertex.js.map +1 -0
  202. package/ShadersWGSL/ShadersInclude/lightFragment.js +7 -7
  203. package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
  204. package/ShadersWGSL/copyTexture3DLayerToTexture.fragment.d.ts +5 -0
  205. package/ShadersWGSL/copyTexture3DLayerToTexture.fragment.js +10 -0
  206. package/ShadersWGSL/copyTexture3DLayerToTexture.fragment.js.map +1 -0
  207. package/ShadersWGSL/default.fragment.js +4 -0
  208. package/ShadersWGSL/default.fragment.js.map +1 -1
  209. package/ShadersWGSL/hdrFiltering.fragment.d.ts +9 -0
  210. package/ShadersWGSL/hdrFiltering.fragment.js +18 -0
  211. package/ShadersWGSL/hdrFiltering.fragment.js.map +1 -0
  212. package/ShadersWGSL/hdrFiltering.vertex.d.ts +5 -0
  213. package/ShadersWGSL/hdrFiltering.vertex.js +16 -0
  214. package/ShadersWGSL/hdrFiltering.vertex.js.map +1 -0
  215. package/ShadersWGSL/iblCombineVoxelGrids.fragment.d.ts +5 -0
  216. package/ShadersWGSL/iblCombineVoxelGrids.fragment.js +10 -0
  217. package/ShadersWGSL/iblCombineVoxelGrids.fragment.js.map +1 -0
  218. package/ShadersWGSL/iblGenerateVoxelMip.fragment.d.ts +5 -0
  219. package/ShadersWGSL/iblGenerateVoxelMip.fragment.js +26 -0
  220. package/ShadersWGSL/iblGenerateVoxelMip.fragment.js.map +1 -0
  221. package/ShadersWGSL/iblShadowAccumulation.fragment.d.ts +5 -0
  222. package/ShadersWGSL/iblShadowAccumulation.fragment.js +24 -0
  223. package/ShadersWGSL/iblShadowAccumulation.fragment.js.map +1 -0
  224. package/ShadersWGSL/iblShadowDebug.fragment.d.ts +5 -0
  225. package/ShadersWGSL/iblShadowDebug.fragment.js +16 -0
  226. package/ShadersWGSL/iblShadowDebug.fragment.js.map +1 -0
  227. package/ShadersWGSL/iblShadowGBufferDebug.fragment.d.ts +5 -0
  228. package/ShadersWGSL/iblShadowGBufferDebug.fragment.js +17 -0
  229. package/ShadersWGSL/iblShadowGBufferDebug.fragment.js.map +1 -0
  230. package/ShadersWGSL/iblShadowSpatialBlur.fragment.d.ts +5 -0
  231. package/ShadersWGSL/iblShadowSpatialBlur.fragment.js +20 -0
  232. package/ShadersWGSL/iblShadowSpatialBlur.fragment.js.map +1 -0
  233. package/ShadersWGSL/iblShadowVoxelTracing.fragment.d.ts +5 -0
  234. package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +163 -0
  235. package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -0
  236. package/ShadersWGSL/iblShadowsCdfx.fragment.d.ts +5 -0
  237. package/ShadersWGSL/iblShadowsCdfx.fragment.js +12 -0
  238. package/ShadersWGSL/iblShadowsCdfx.fragment.js.map +1 -0
  239. package/ShadersWGSL/iblShadowsCdfy.fragment.d.ts +5 -0
  240. package/ShadersWGSL/iblShadowsCdfy.fragment.js +33 -0
  241. package/ShadersWGSL/iblShadowsCdfy.fragment.js.map +1 -0
  242. package/ShadersWGSL/iblShadowsCombine.fragment.d.ts +5 -0
  243. package/ShadersWGSL/iblShadowsCombine.fragment.js +10 -0
  244. package/ShadersWGSL/iblShadowsCombine.fragment.js.map +1 -0
  245. package/ShadersWGSL/iblShadowsIcdfx.fragment.d.ts +5 -0
  246. package/ShadersWGSL/iblShadowsIcdfx.fragment.js +18 -0
  247. package/ShadersWGSL/iblShadowsIcdfx.fragment.js.map +1 -0
  248. package/ShadersWGSL/iblShadowsIcdfy.fragment.d.ts +5 -0
  249. package/ShadersWGSL/iblShadowsIcdfy.fragment.js +17 -0
  250. package/ShadersWGSL/iblShadowsIcdfy.fragment.js.map +1 -0
  251. package/ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment.d.ts +5 -0
  252. package/ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment.js +41 -0
  253. package/ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment.js.map +1 -0
  254. package/{Shaders/voxelGrid3dDebug.fragment.d.ts → ShadersWGSL/iblVoxelGrid.fragment.d.ts} +1 -1
  255. package/ShadersWGSL/iblVoxelGrid.fragment.js +15 -0
  256. package/ShadersWGSL/iblVoxelGrid.fragment.js.map +1 -0
  257. package/ShadersWGSL/iblVoxelGrid.vertex.d.ts +5 -0
  258. package/ShadersWGSL/iblVoxelGrid.vertex.js +14 -0
  259. package/ShadersWGSL/iblVoxelGrid.vertex.js.map +1 -0
  260. package/ShadersWGSL/iblVoxelGrid2dArrayDebug.fragment.d.ts +5 -0
  261. package/ShadersWGSL/iblVoxelGrid2dArrayDebug.fragment.js +10 -0
  262. package/ShadersWGSL/iblVoxelGrid2dArrayDebug.fragment.js.map +1 -0
  263. package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.d.ts +5 -0
  264. package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.js +22 -0
  265. package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.js.map +1 -0
  266. package/ShadersWGSL/iblVoxelSlabDebug.fragment.d.ts +5 -0
  267. package/ShadersWGSL/iblVoxelSlabDebug.fragment.js +12 -0
  268. package/ShadersWGSL/iblVoxelSlabDebug.fragment.js.map +1 -0
  269. package/ShadersWGSL/iblVoxelSlabDebug.vertex.d.ts +5 -0
  270. package/ShadersWGSL/iblVoxelSlabDebug.vertex.js +10 -0
  271. package/ShadersWGSL/iblVoxelSlabDebug.vertex.js.map +1 -0
  272. package/{Shaders/generateVoxelMip.fragment.d.ts → ShadersWGSL/oitBackBlend.fragment.d.ts} +1 -1
  273. package/ShadersWGSL/oitBackBlend.fragment.js +11 -0
  274. package/ShadersWGSL/oitBackBlend.fragment.js.map +1 -0
  275. package/{Shaders/voxelGrid.vertex.d.ts → ShadersWGSL/oitFinal.fragment.d.ts} +1 -1
  276. package/ShadersWGSL/oitFinal.fragment.js +14 -0
  277. package/ShadersWGSL/oitFinal.fragment.js.map +1 -0
  278. package/ShadersWGSL/pbr.fragment.js +17 -8
  279. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  280. package/{Shaders/voxelSlabDebug.vertex.d.ts → ShadersWGSL/procedural.vertex.d.ts} +1 -1
  281. package/ShadersWGSL/procedural.vertex.js +16 -0
  282. package/ShadersWGSL/procedural.vertex.js.map +1 -0
  283. package/XR/features/WebXRHandTracking.d.ts +5 -0
  284. package/XR/features/WebXRHandTracking.js +34 -12
  285. package/XR/features/WebXRHandTracking.js.map +1 -1
  286. package/package.json +2 -2
  287. package/Shaders/combineVoxelGrids.fragment.js.map +0 -1
  288. package/Shaders/generateVoxelMip.fragment.js.map +0 -1
  289. package/Shaders/voxelGrid.fragment.js.map +0 -1
  290. package/Shaders/voxelGrid.vertex.js.map +0 -1
  291. package/Shaders/voxelGrid2dArrayDebug.fragment.d.ts +0 -5
  292. package/Shaders/voxelGrid2dArrayDebug.fragment.js.map +0 -1
  293. package/Shaders/voxelGrid3dDebug.fragment.js.map +0 -1
  294. package/Shaders/voxelSlabDebug.fragment.js.map +0 -1
  295. package/Shaders/voxelSlabDebug.vertex.js.map +0 -1
@@ -43,4 +43,50 @@ export * from "../Shaders/outline.fragment.js";
43
43
  export * from "../Shaders/outline.vertex.js";
44
44
  export * from "../ShadersWGSL/outline.fragment.js";
45
45
  export * from "../ShadersWGSL/outline.vertex.js";
46
+ // IBL Shadows
47
+ export * from "../Shaders/copyTexture3DLayerToTexture.fragment.js";
48
+ export * from "../ShadersWGSL/copyTexture3DLayerToTexture.fragment.js";
49
+ export * from "../Shaders/iblShadowVoxelTracing.fragment.js";
50
+ export * from "../ShadersWGSL/iblShadowVoxelTracing.fragment.js";
51
+ export * from "../Shaders/iblShadowDebug.fragment.js";
52
+ export * from "../ShadersWGSL/iblShadowDebug.fragment.js";
53
+ export * from "../ShadersWGSL/iblShadowSpatialBlur.fragment.js";
54
+ export * from "../Shaders/iblShadowSpatialBlur.fragment.js";
55
+ export * from "../ShadersWGSL/iblShadowAccumulation.fragment.js";
56
+ export * from "../Shaders/iblShadowAccumulation.fragment.js";
57
+ export * from "../Shaders/iblShadowsCombine.fragment.js";
58
+ export * from "../ShadersWGSL/iblShadowsCombine.fragment.js";
59
+ export * from "../ShadersWGSL/iblCombineVoxelGrids.fragment.js";
60
+ export * from "../Shaders/iblCombineVoxelGrids.fragment.js";
61
+ export * from "../Shaders/iblGenerateVoxelMip.fragment.js";
62
+ export * from "../ShadersWGSL/iblGenerateVoxelMip.fragment.js";
63
+ export * from "../Shaders/iblShadowGBufferDebug.fragment.js";
64
+ export * from "../ShadersWGSL/iblShadowGBufferDebug.fragment.js";
65
+ export * from "../ShadersWGSL/iblShadowsCdfx.fragment.js";
66
+ export * from "../Shaders/iblShadowsCdfx.fragment.js";
67
+ export * from "../ShadersWGSL/iblShadowsCdfy.fragment.js";
68
+ export * from "../Shaders/iblShadowsCdfy.fragment.js";
69
+ export * from "../ShadersWGSL/iblShadowsIcdfx.fragment.js";
70
+ export * from "../Shaders/iblShadowsIcdfx.fragment.js";
71
+ export * from "../ShadersWGSL/iblShadowsIcdfy.fragment.js";
72
+ export * from "../Shaders/iblShadowsIcdfy.fragment.js";
73
+ export * from "../ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment.js";
74
+ export * from "../Shaders/iblShadowsImportanceSamplingDebug.fragment.js";
75
+ export * from "../Shaders/iblVoxelGrid2dArrayDebug.fragment.js";
76
+ export * from "../ShadersWGSL/iblVoxelGrid2dArrayDebug.fragment.js";
77
+ export * from "../Shaders/iblVoxelGrid.fragment.js";
78
+ export * from "../Shaders/iblVoxelGrid.vertex.js";
79
+ export * from "../ShadersWGSL/iblVoxelGrid.fragment.js";
80
+ export * from "../ShadersWGSL/iblVoxelGrid.vertex.js";
81
+ export * from "../Shaders/iblVoxelGrid3dDebug.fragment.js";
82
+ export * from "../ShadersWGSL/iblVoxelGrid3dDebug.fragment.js";
83
+ export * from "../Shaders/iblVoxelSlabDebug.vertex.js";
84
+ export * from "../Shaders/iblVoxelSlabDebug.fragment.js";
85
+ export * from "../ShadersWGSL/iblVoxelSlabDebug.vertex.js";
86
+ export * from "../ShadersWGSL/iblVoxelSlabDebug.fragment.js";
87
+ // Depth Peeling Renderer
88
+ export * from "../Shaders/oitBackBlend.fragment.js";
89
+ export * from "../Shaders/oitFinal.fragment.js";
90
+ export * from "../ShadersWGSL/oitBackBlend.fragment.js";
91
+ export * from "../ShadersWGSL/oitFinal.fragment.js";
46
92
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Rendering/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAE3C,QAAQ;AACR,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAE5C,WAAW;AACX,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAE/C,wBAAwB;AACxB,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAE1D,iBAAiB;AACjB,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAE3C,mBAAmB;AACnB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./boundingBoxRenderer\";\r\nexport * from \"./depthRenderer\";\r\nexport * from \"./depthRendererSceneComponent\";\r\nexport * from \"./depthPeelingRenderer\";\r\nexport * from \"./depthPeelingSceneComponent\";\r\nexport * from \"./edgesRenderer\";\r\nexport * from \"./geometryBufferRenderer\";\r\nexport * from \"./geometryBufferRendererSceneComponent\";\r\nexport * from \"./IBLShadows/iblShadowsRenderPipeline\";\r\nexport * from \"./prePassRenderer\";\r\nexport * from \"./prePassRendererSceneComponent\";\r\nexport * from \"./subSurfaceSceneComponent\";\r\nexport * from \"./outlineRenderer\";\r\nexport * from \"./renderingGroup\";\r\nexport * from \"./renderingManager\";\r\nexport * from \"./utilityLayerRenderer\";\r\nexport * from \"./fluidRenderer/index\";\r\nexport * from \"./reflectiveShadowMap\";\r\nexport * from \"./GlobalIllumination/index\";\r\n\r\n// Depth\r\nexport * from \"../Shaders/depth.fragment\";\r\nexport * from \"../Shaders/depth.vertex\";\r\nexport * from \"../ShadersWGSL/depth.fragment\";\r\nexport * from \"../ShadersWGSL/depth.vertex\";\r\n\r\n// Geometry\r\nexport * from \"../Shaders/geometry.fragment\";\r\nexport * from \"../Shaders/geometry.vertex\";\r\nexport * from \"../ShadersWGSL/geometry.fragment\";\r\nexport * from \"../ShadersWGSL/geometry.vertex\";\r\n\r\n// Bounding Box Renderer\r\nexport * from \"../Shaders/boundingBoxRenderer.fragment\";\r\nexport * from \"../Shaders/boundingBoxRenderer.vertex\";\r\nexport * from \"../ShadersWGSL/boundingBoxRenderer.fragment\";\r\nexport * from \"../ShadersWGSL/boundingBoxRenderer.vertex\";\r\n\r\n// Edges Renderer\r\nexport * from \"../Shaders/line.fragment\";\r\nexport * from \"../Shaders/line.vertex\";\r\nexport * from \"../ShadersWGSL/line.fragment\";\r\nexport * from \"../ShadersWGSL/line.vertex\";\r\n\r\n// Outline Renderer\r\nexport * from \"../Shaders/outline.fragment\";\r\nexport * from \"../Shaders/outline.vertex\";\r\nexport * from \"../ShadersWGSL/outline.fragment\";\r\nexport * from \"../ShadersWGSL/outline.vertex\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Rendering/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAE3C,QAAQ;AACR,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAE5C,WAAW;AACX,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAE/C,wBAAwB;AACxB,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAE1D,iBAAiB;AACjB,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAE3C,mBAAmB;AACnB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAE9C,cAAc;AACd,cAAc,iDAAiD,CAAC;AAChE,cAAc,qDAAqD,CAAC;AACpE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AACjE,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,yCAAyC,CAAC;AACxD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAE1D,yBAAyB;AACzB,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./boundingBoxRenderer\";\r\nexport * from \"./depthRenderer\";\r\nexport * from \"./depthRendererSceneComponent\";\r\nexport * from \"./depthPeelingRenderer\";\r\nexport * from \"./depthPeelingSceneComponent\";\r\nexport * from \"./edgesRenderer\";\r\nexport * from \"./geometryBufferRenderer\";\r\nexport * from \"./geometryBufferRendererSceneComponent\";\r\nexport * from \"./IBLShadows/iblShadowsRenderPipeline\";\r\nexport * from \"./prePassRenderer\";\r\nexport * from \"./prePassRendererSceneComponent\";\r\nexport * from \"./subSurfaceSceneComponent\";\r\nexport * from \"./outlineRenderer\";\r\nexport * from \"./renderingGroup\";\r\nexport * from \"./renderingManager\";\r\nexport * from \"./utilityLayerRenderer\";\r\nexport * from \"./fluidRenderer/index\";\r\nexport * from \"./reflectiveShadowMap\";\r\nexport * from \"./GlobalIllumination/index\";\r\n\r\n// Depth\r\nexport * from \"../Shaders/depth.fragment\";\r\nexport * from \"../Shaders/depth.vertex\";\r\nexport * from \"../ShadersWGSL/depth.fragment\";\r\nexport * from \"../ShadersWGSL/depth.vertex\";\r\n\r\n// Geometry\r\nexport * from \"../Shaders/geometry.fragment\";\r\nexport * from \"../Shaders/geometry.vertex\";\r\nexport * from \"../ShadersWGSL/geometry.fragment\";\r\nexport * from \"../ShadersWGSL/geometry.vertex\";\r\n\r\n// Bounding Box Renderer\r\nexport * from \"../Shaders/boundingBoxRenderer.fragment\";\r\nexport * from \"../Shaders/boundingBoxRenderer.vertex\";\r\nexport * from \"../ShadersWGSL/boundingBoxRenderer.fragment\";\r\nexport * from \"../ShadersWGSL/boundingBoxRenderer.vertex\";\r\n\r\n// Edges Renderer\r\nexport * from \"../Shaders/line.fragment\";\r\nexport * from \"../Shaders/line.vertex\";\r\nexport * from \"../ShadersWGSL/line.fragment\";\r\nexport * from \"../ShadersWGSL/line.vertex\";\r\n\r\n// Outline Renderer\r\nexport * from \"../Shaders/outline.fragment\";\r\nexport * from \"../Shaders/outline.vertex\";\r\nexport * from \"../ShadersWGSL/outline.fragment\";\r\nexport * from \"../ShadersWGSL/outline.vertex\";\r\n\r\n// IBL Shadows\r\nexport * from \"../Shaders/copyTexture3DLayerToTexture.fragment\";\r\nexport * from \"../ShadersWGSL/copyTexture3DLayerToTexture.fragment\";\r\nexport * from \"../Shaders/iblShadowVoxelTracing.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowVoxelTracing.fragment\";\r\nexport * from \"../Shaders/iblShadowDebug.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowDebug.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowSpatialBlur.fragment\";\r\nexport * from \"../Shaders/iblShadowSpatialBlur.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowAccumulation.fragment\";\r\nexport * from \"../Shaders/iblShadowAccumulation.fragment\";\r\nexport * from \"../Shaders/iblShadowsCombine.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowsCombine.fragment\";\r\nexport * from \"../ShadersWGSL/iblCombineVoxelGrids.fragment\";\r\nexport * from \"../Shaders/iblCombineVoxelGrids.fragment\";\r\nexport * from \"../Shaders/iblGenerateVoxelMip.fragment\";\r\nexport * from \"../ShadersWGSL/iblGenerateVoxelMip.fragment\";\r\nexport * from \"../Shaders/iblShadowGBufferDebug.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowGBufferDebug.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowsCdfx.fragment\";\r\nexport * from \"../Shaders/iblShadowsCdfx.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowsCdfy.fragment\";\r\nexport * from \"../Shaders/iblShadowsCdfy.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowsIcdfx.fragment\";\r\nexport * from \"../Shaders/iblShadowsIcdfx.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowsIcdfy.fragment\";\r\nexport * from \"../Shaders/iblShadowsIcdfy.fragment\";\r\nexport * from \"../ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment\";\r\nexport * from \"../Shaders/iblShadowsImportanceSamplingDebug.fragment\";\r\nexport * from \"../Shaders/iblVoxelGrid2dArrayDebug.fragment\";\r\nexport * from \"../ShadersWGSL/iblVoxelGrid2dArrayDebug.fragment\";\r\nexport * from \"../Shaders/iblVoxelGrid.fragment\";\r\nexport * from \"../Shaders/iblVoxelGrid.vertex\";\r\nexport * from \"../ShadersWGSL/iblVoxelGrid.fragment\";\r\nexport * from \"../ShadersWGSL/iblVoxelGrid.vertex\";\r\nexport * from \"../Shaders/iblVoxelGrid3dDebug.fragment\";\r\nexport * from \"../ShadersWGSL/iblVoxelGrid3dDebug.fragment\";\r\nexport * from \"../Shaders/iblVoxelSlabDebug.vertex\";\r\nexport * from \"../Shaders/iblVoxelSlabDebug.fragment\";\r\nexport * from \"../ShadersWGSL/iblVoxelSlabDebug.vertex\";\r\nexport * from \"../ShadersWGSL/iblVoxelSlabDebug.fragment\";\r\n\r\n// Depth Peeling Renderer\r\nexport * from \"../Shaders/oitBackBlend.fragment\";\r\nexport * from \"../Shaders/oitFinal.fragment\";\r\nexport * from \"../ShadersWGSL/oitBackBlend.fragment\";\r\nexport * from \"../ShadersWGSL/oitFinal.fragment\";\r\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const iblCombineVoxelGridsPixelShader: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -1,9 +1,9 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "../Engines/shaderStore.js";
3
- const name = "combineVoxelGridsPixelShader";
3
+ const name = "iblCombineVoxelGridsPixelShader";
4
4
  const shader = `precision highp float;precision highp sampler3D;varying vec2 vUV;uniform sampler3D voxelXaxisSampler;uniform sampler3D voxelYaxisSampler;uniform sampler3D voxelZaxisSampler;uniform float layer;void main(void) {vec3 coordZ=vec3(vUV.x,vUV.y,layer);float voxelZ=texture(voxelZaxisSampler,coordZ).r;vec3 coordX=vec3(1.0-layer,vUV.y,vUV.x);float voxelX=texture(voxelXaxisSampler,coordX).r;vec3 coordY=vec3(layer,vUV.x,vUV.y);float voxelY=texture(voxelYaxisSampler,coordY).r;float voxel=(voxelX>0.0 || voxelY>0.0 || voxelZ>0.0) ? 1.0 : 0.0;glFragColor=vec4(vec3(voxel),1.0);}`;
5
5
  // Sideeffect
6
6
  ShaderStore.ShadersStore[name] = shader;
7
7
  /** @internal */
8
- export const combineVoxelGridsPixelShader = { name, shader };
9
- //# sourceMappingURL=combineVoxelGrids.fragment.js.map
8
+ export const iblCombineVoxelGridsPixelShader = { name, shader };
9
+ //# sourceMappingURL=iblCombineVoxelGrids.fragment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iblCombineVoxelGrids.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblCombineVoxelGrids.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,iCAAiC,CAAC;AAC/C,MAAM,MAAM,GAAG,2jBAA2jB,CAAC;AAC3kB,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"iblCombineVoxelGridsPixelShader\";\nconst shader = `precision highp float;precision highp sampler3D;varying vec2 vUV;uniform sampler3D voxelXaxisSampler;uniform sampler3D voxelYaxisSampler;uniform sampler3D voxelZaxisSampler;uniform float layer;void main(void) {vec3 coordZ=vec3(vUV.x,vUV.y,layer);float voxelZ=texture(voxelZaxisSampler,coordZ).r;vec3 coordX=vec3(1.0-layer,vUV.y,vUV.x);float voxelX=texture(voxelXaxisSampler,coordX).r;vec3 coordY=vec3(layer,vUV.x,vUV.y);float voxelY=texture(voxelYaxisSampler,coordY).r;float voxel=(voxelX>0.0 || voxelY>0.0 || voxelZ>0.0) ? 1.0 : 0.0;glFragColor=vec4(vec3(voxel),1.0);}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblCombineVoxelGridsPixelShader = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const iblGenerateVoxelMipPixelShader: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -1,6 +1,6 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "../Engines/shaderStore.js";
3
- const name = "generateVoxelMipPixelShader";
3
+ const name = "iblGenerateVoxelMipPixelShader";
4
4
  const shader = `precision highp float;precision highp sampler3D;varying vec2 vUV;uniform sampler3D srcMip;uniform int layerNum;void main(void) {ivec3 Coords=ivec3(2)*ivec3(gl_FragCoord.x,gl_FragCoord.y,layerNum);uint tex =
5
5
  uint(texelFetch(srcMip,Coords+ivec3(0,0,0),0).x>0.0f ? 1u : 0u)
6
6
  << 0u |
@@ -21,5 +21,5 @@ uint(texelFetch(srcMip,Coords+ivec3(1,1,1),0).x>0.0f ? 1u : 0u)
21
21
  // Sideeffect
22
22
  ShaderStore.ShadersStore[name] = shader;
23
23
  /** @internal */
24
- export const generateVoxelMipPixelShader = { name, shader };
25
- //# sourceMappingURL=generateVoxelMip.fragment.js.map
24
+ export const iblGenerateVoxelMipPixelShader = { name, shader };
25
+ //# sourceMappingURL=iblGenerateVoxelMip.fragment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iblGenerateVoxelMip.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblGenerateVoxelMip.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,gCAAgC,CAAC;AAC9C,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;4EAgB6D,CAAC;AAC7E,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"iblGenerateVoxelMipPixelShader\";\nconst shader = `precision highp float;precision highp sampler3D;varying vec2 vUV;uniform sampler3D srcMip;uniform int layerNum;void main(void) {ivec3 Coords=ivec3(2)*ivec3(gl_FragCoord.x,gl_FragCoord.y,layerNum);uint tex =\nuint(texelFetch(srcMip,Coords+ivec3(0,0,0),0).x>0.0f ? 1u : 0u)\n<< 0u |\nuint(texelFetch(srcMip,Coords+ivec3(1,0,0),0).x>0.0f ? 1u : 0u)\n<< 1u |\nuint(texelFetch(srcMip,Coords+ivec3(0,1,0),0).x>0.0f ? 1u : 0u)\n<< 2u |\nuint(texelFetch(srcMip,Coords+ivec3(1,1,0),0).x>0.0f ? 1u : 0u)\n<< 3u |\nuint(texelFetch(srcMip,Coords+ivec3(0,0,1),0).x>0.0f ? 1u : 0u)\n<< 4u |\nuint(texelFetch(srcMip,Coords+ivec3(1,0,1),0).x>0.0f ? 1u : 0u)\n<< 5u |\nuint(texelFetch(srcMip,Coords+ivec3(0,1,1),0).x>0.0f ? 1u : 0u)\n<< 6u |\nuint(texelFetch(srcMip,Coords+ivec3(1,1,1),0).x>0.0f ? 1u : 0u)\n<< 7u;glFragColor.rgb=vec3(float(tex)/255.0f,0.0f,0.0f);glFragColor.a=1.0;}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblGenerateVoxelMipPixelShader = { name, shader };\n"]}
@@ -5,7 +5,7 @@ const shader = `precision highp sampler2D;precision highp sampler3D;
5
5
  #define PI 3.1415927
6
6
  varying vec2 vUV;
7
7
  #define DISABLE_UNIFORMITY_ANALYSIS
8
- uniform sampler2D depthSampler;uniform sampler2D linearDepthSampler;uniform sampler2D worldNormalSampler;uniform sampler2D worldPositionSampler;uniform sampler2D blueNoiseSampler;uniform sampler2D icdfxSampler;uniform sampler2D icdfySampler;uniform sampler3D voxelGridSampler;uniform vec4 shadowParameters;
8
+ uniform sampler2D depthSampler;uniform sampler2D worldNormalSampler;uniform sampler2D worldPositionSampler;uniform sampler2D blueNoiseSampler;uniform sampler2D icdfxSampler;uniform sampler2D icdfySampler;uniform sampler3D voxelGridSampler;uniform vec4 shadowParameters;
9
9
  #define SHADOWdirs shadowParameters.x
10
10
  #define SHADOWframe shadowParameters.y
11
11
  #define SHADOWdownscale shadowParameters.z
@@ -86,14 +86,18 @@ float nearPlaneZ,float noise) {float csZDir=projMtx[2][2]>0.0 ? 1.0 : -1.0;float
86
86
  csZDir*(csOrigin.z+ssMaxDist*csDirection.z)<csZDir*nearPlaneZ
87
87
  ?
88
88
  (nearPlaneZ-csOrigin.z)/csDirection.z
89
- : ssMaxDist;vec3 csEndPoint=csOrigin+rayLength*csDirection;vec4 H0=projMtx*vec4(csOrigin,1.0);vec4 H1=projMtx*vec4(csEndPoint,1.0);vec2 Z0=vec2(csOrigin.z,1.0)/H0.w;vec2 Z1=vec2(csEndPoint.z,1.0)/H1.w;vec2 P0=csZBufferSize*(0.5*H0.xy*Z0.y+0.5);vec2 P1=csZBufferSize*(0.5*H1.xy*Z1.y+0.5);P1+=vec2(distanceSquared(P0,P1)<0.0001 ? 0.01 : 0.0);vec2 delta=P1-P0;bool permute=false;if (abs(delta.x)<abs(delta.y)) {permute=true;P0=P0.yx;P1=P1.yx;delta=delta.yx;}
90
- float stepDirection=sign(delta.x);float invdx=stepDirection/delta.x;vec2 dP=ssStride*vec2(stepDirection,invdx*delta.y);vec2 dZ=ssStride*invdx*(Z1-Z0);float opacity=0.0;vec2 P=P0+noise*dP;vec2 Z=Z0+noise*dZ;float end=P1.x*stepDirection;float rayZMax=csZDir*Z.x/Z.y;float sceneDepth=rayZMax;Z+=dZ;for (float stepCount=0.0; opacity<1.0 && P.x*stepDirection<end &&
91
- sceneDepth>0.0 && stepCount<ssSamples;stepCount++,P+=dP,
89
+ : ssMaxDist;vec3 csEndPoint=csOrigin+rayLength*csDirection;vec4 H0=projMtx*vec4(csOrigin,1.0);vec4 H1=projMtx*vec4(csEndPoint,1.0);
90
+ #ifndef IS_NDC_HALF_ZRANGE
91
+ float Z0=(0.5*H0.z/H0.w+0.5);float Z1=(0.5*H1.z/H1.w+0.5);
92
+ #else
93
+ float Z0=(H0.z/H0.w);float Z1=(H1.z/H1.w);
94
+ #endif
95
+ vec2 P0=csZBufferSize*(0.5*H0.xy/H0.w+0.5);vec2 P1=csZBufferSize*(0.5*H1.xy/H1.w+0.5);P1+=vec2(distanceSquared(P0,P1)<0.0001 ? 0.01 : 0.0);vec2 delta=P1-P0;bool permute=false;if (abs(delta.x)<abs(delta.y)) {permute=true;P0=P0.yx;P1=P1.yx;delta=delta.yx;}
96
+ float stepDirection=sign(delta.x);float invdx=stepDirection/delta.x;vec2 dP=ssStride*vec2(stepDirection,invdx*delta.y);float dZ=ssStride*invdx*(Z1-Z0);float opacity=0.0;vec2 P=P0+noise*dP;float Z=Z0+noise*dZ;float end=P1.x*stepDirection;Z+=dZ;for (float stepCount=0.0;opacity<1.0 && P.x*stepDirection<end && stepCount<ssSamples;stepCount++,P+=dP,
92
97
  Z+=dZ) {
93
- vec2 linearZ_alpha =
94
- texelFetch(linearDepthSampler,ivec2(permute ? P.yx : P),0).xy;sceneDepth=csZDir*linearZ_alpha.x;if (sceneDepth<=0.0)
95
- break;float rayZMin=rayZMax;rayZMax=csZDir*Z.x/Z.y;opacity+=max(opacity,step(rayZMax,sceneDepth+ssThickness) *
96
- step(sceneDepth,rayZMin));}
98
+ ivec2 coords=ivec2(permute ? P.yx : P);float sceneDepth=texelFetch(depthSampler,coords,0).x;float thicknessScale=pow(1.0-sceneDepth,1.6);opacity +=
99
+ max(opacity,step(Z+dZ,sceneDepth+thicknessScale*ssThickness) *
100
+ step(sceneDepth,Z));}
97
101
  return opacity;}
98
102
  #if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
99
103
  float voxelShadow(vec3 wsOrigin,vec3 wsDirection,vec3 wsNormal,
@@ -117,12 +121,16 @@ return anyHitVoxels(ray_vs) ? 1.0f : 0.0f;
117
121
  void main(void) {uint nbDirs=uint(SHADOWdirs);uint frameId=uint(SHADOWframe);int downscale=int(SHADOWdownscale);float envRot=SHADOWenvRot;vec2 Resolution=vec2(textureSize(depthSampler,0));ivec2 currentPixel=ivec2(vUV*Resolution);ivec2 PixelCoord=ivec2(vec2(currentPixel*downscale)+PixelOffset.xy);uint GlobalIndex =
118
122
  (frameId*uint(Resolution.y)+uint(PixelCoord.y))*uint(Resolution.x) +
119
123
  uint(PixelCoord.x);vec3 N=texelFetch(worldNormalSampler,PixelCoord,0).xyz;N=N*vec3(2.0)-vec3(1.0);if (length(N)<0.01) {glFragColor=vec4(1.0,1.0,0.0,1.0);return;}
120
- float normalizedRotation=envRot/(2.0*PI);float depth=texelFetch(depthSampler,PixelCoord,0).x;depth=depth*2.0-1.0;vec2 temp=(vec2(PixelCoord)+vec2(0.5))*2.0/Resolution-vec2(1.0);vec2 temp2=vUV*vec2(2.0)-vec2(1.0);vec4 VP=invProjMtx*vec4(temp.x,-temp.y,depth,1.0);VP/=VP.w;N=normalize(N);vec3 noise=texelFetch(blueNoiseSampler,PixelCoord & 0xFF,0).xyz;noise.z=fract(noise.z+goldenSequence(frameId*nbDirs));vec2 linearZ_alpha=texelFetch(linearDepthSampler,PixelCoord,0).xy;linearZ_alpha.x*=-1.0;
124
+ float normalizedRotation=envRot/(2.0*PI);float depth=texelFetch(depthSampler,PixelCoord,0).x;
125
+ #ifndef IS_NDC_HALF_ZRANGE
126
+ depth=depth*2.0-1.0;
127
+ #endif
128
+ vec2 temp=(vec2(PixelCoord)+vec2(0.5))*2.0/Resolution-vec2(1.0);vec2 temp2=vUV*vec2(2.0)-vec2(1.0);vec4 VP=invProjMtx*vec4(temp.x,-temp.y,depth,1.0);VP/=VP.w;N=normalize(N);vec3 noise=texelFetch(blueNoiseSampler,PixelCoord & 0xFF,0).xyz;noise.z=fract(noise.z+goldenSequence(frameId*nbDirs));
121
129
  #ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
122
130
  float heat=0.0f;
123
131
  #endif
124
132
  float shadowAccum=0.0;for (uint i=0u; i<nbDirs; i++) {uint dirId=nbDirs*GlobalIndex+i;vec4 L;{vec2 r=plasticSequence(frameId*nbDirs+i);r=fract(r+vec2(2.0)*abs(noise.xy-vec2(0.5)));vec2 T;T.x=textureLod(icdfxSampler,vec2(r.x,0.0),0.0).x;T.y=textureLod(icdfySampler,vec2(T.x,r.y),0.0).x;T.x-=normalizedRotation;L=vec4(uv_to_normal(T),0);}
125
- float edge_tint_const=linearZ_alpha.y>0.0 ? -0.001 : -0.1;float cosNL=dot(N,L.xyz);float opacity=cosNL<edge_tint_const ? 1.0 : 0.0;if (cosNL>edge_tint_const) {vec4 VP2=VP;VP2.y*=-1.0;vec4 unormWP=invViewMtx*VP2;vec3 WP=(wsNormalizationMtx*unormWP).xyz;vec2 vxNoise =
133
+ float edge_tint_const=-0.001;float cosNL=dot(N,L.xyz);float opacity=cosNL<edge_tint_const ? 1.0 : 0.0;if (cosNL>edge_tint_const) {vec4 VP2=VP;VP2.y*=-1.0;vec4 unormWP=invViewMtx*VP2;vec3 WP=(wsNormalizationMtx*unormWP).xyz;vec2 vxNoise =
126
134
  vec2(uint2float(hash(dirId*2u)),uint2float(hash(dirId*2u+1u)));
127
135
  #ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION
128
136
  VoxelMarchDiagnosticInfo voxel_march_diagnostic_info;opacity=max(opacity,
@@ -1 +1 @@
1
- {"version":3,"file":"iblShadowVoxelTracing.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblShadowVoxelTracing.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,kCAAkC,CAAC;AAChD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+Ib,CAAC;AACH,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"iblShadowVoxelTracingPixelShader\";\nconst shader = `precision highp sampler2D;precision highp sampler3D;\n#define PI 3.1415927\nvarying vec2 vUV;\n#define DISABLE_UNIFORMITY_ANALYSIS\nuniform sampler2D depthSampler;uniform sampler2D linearDepthSampler;uniform sampler2D worldNormalSampler;uniform sampler2D worldPositionSampler;uniform sampler2D blueNoiseSampler;uniform sampler2D icdfxSampler;uniform sampler2D icdfySampler;uniform sampler3D voxelGridSampler;uniform vec4 shadowParameters;\n#define SHADOWdirs shadowParameters.x\n#define SHADOWframe shadowParameters.y\n#define SHADOWdownscale shadowParameters.z\n#define SHADOWenvRot shadowParameters.w\nuniform vec4 offsetDataParameters;\n#define PixelOffset offsetDataParameters.xy\n#define highestMipLevel offsetDataParameters.z\nuniform vec4 sssParameters;\n#define SSSsamples sssParameters.x\n#define SSSstride sssParameters.y\n#define SSSmaxDistance sssParameters.z\n#define SSSthickness sssParameters.w\nuniform vec4 shadowOpacity;uniform mat4 projMtx;uniform mat4 viewMtx;uniform mat4 invProjMtx;uniform mat4 invViewMtx;uniform mat4 wsNormalizationMtx;uniform mat4 invVPMtx;\n#define PI 3.1415927\n#define GOLD 0.618034\nstruct AABB3f {vec3 m_min;vec3 m_max;};struct Ray {vec3 orig;vec3 dir;vec3 dir_rcp;float t_min;float t_max;};Ray make_ray(const vec3 origin,const vec3 direction,const float tmin,\nconst float tmax) {Ray ray;ray.orig=origin;ray.dir=direction;ray.dir_rcp=1.0f/direction;ray.t_min=tmin;ray.t_max=tmax;return ray;}\nbool ray_box_intersection(const in AABB3f aabb,const in Ray ray,\nout float distance_near,out float distance_far) {vec3 tbot=ray.dir_rcp*(aabb.m_min-ray.orig);vec3 ttop=ray.dir_rcp*(aabb.m_max-ray.orig);vec3 tmin=min(ttop,tbot);vec3 tmax=max(ttop,tbot);distance_near=max(ray.t_min,max(tmin.x,max(tmin.y,tmin.z)));distance_far=min(ray.t_max,min(tmax.x,min(tmax.y,tmax.z)));return distance_near<=distance_far;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nstruct VoxelMarchDiagnosticInfo {float heat;ivec3 voxel_intersect_coords;};\n#endif\nuint hash(uint i) {i ^= i>>16u;i*=0x7FEB352Du;i ^= i>>15u;i*=0x846CA68Bu;i ^= i>>16u;return i;}\nfloat uint2float(uint i) {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}\nvec3 uv_to_normal(vec2 uv) {vec3 N;vec2 uvRange=uv;float theta=uvRange.x*2.0*PI;float phi=uvRange.y*PI;N.x=cos(theta)*sin(phi);N.z=sin(theta)*sin(phi);N.y=cos(phi);return N;}\nvec2 plasticSequence(const uint rstate) {return vec2(uint2float(rstate*3242174889u),\nuint2float(rstate*2447445414u));}\nfloat goldenSequence(const uint rstate) {return uint2float(rstate*2654435769u);}\nfloat distanceSquared(vec2 a,vec2 b) {vec2 diff=a-b;return dot(diff,diff);}\nvoid genTB(const vec3 N,out vec3 T,out vec3 B) {float s=N.z<0.0 ? -1.0 : 1.0;float a=-1.0/(s+N.z);float b=N.x*N.y*a;T=vec3(1.0+s*N.x*N.x*a,s*b,-s*N.x);B=vec3(b,s+N.y*N.y*a,-N.y);}\nint stack[24]; \n#define PUSH(i) stack[stackLevel++]=i; \n#define POP() stack[--stackLevel] \n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nbool anyHitVoxels(const Ray ray_vs,\nout VoxelMarchDiagnosticInfo voxel_march_diagnostic_info) {\n#else\nbool anyHitVoxels(const Ray ray_vs) {\n#endif\nvec3 invD=ray_vs.dir_rcp;vec3 D=ray_vs.dir;vec3 O=ray_vs.orig;ivec3 negD=ivec3(lessThan(D,vec3(0,0,0)));int voxel0=negD.x | negD.y<<1 | negD.z<<2;vec3 t0=-O*invD,t1=(vec3(1.0)-O)*invD;int maxLod=int(highestMipLevel);int stackLevel=0;\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nuint steps=0u;\n#endif\nPUSH(maxLod<<24);while (stackLevel>0) {int elem=POP();ivec4 Coords =\nivec4(elem & 0xFF,elem>>8 & 0xFF,elem>>16 & 0xFF,elem>>24);if (Coords.w==0) {\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nvoxel_march_diagnostic_info.heat=float(steps)/24.0;\n#endif\nreturn true;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\n++steps;\n#endif\nfloat invRes=exp2(float(Coords.w-maxLod));vec3 bbmin=invRes*vec3(Coords.xyz+negD);vec3 bbmax=invRes*vec3(Coords.xyz-negD+ivec3(1));vec3 mint=mix(t0,t1,bbmin);vec3 maxt=mix(t0,t1,bbmax);vec3 midt=0.5*(mint+maxt);mint.x=max(0.0,mint.x);midt.x=max(0.0,midt.x);int nodeMask=int(\nround(texelFetch(voxelGridSampler,Coords.xyz,Coords.w).x*255.0));Coords.w--;int voxelBit=voxel0;Coords.xyz=(Coords.xyz<<1)+negD;int packedCoords =\nCoords.x | Coords.y<<8 | Coords.z<<16 | Coords.w<<24;if (max(mint.x,max(mint.y,mint.z))<min(midt.x,min(midt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(mint.y,mint.z))<min(maxt.x,min(midt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(midt.y,mint.z))<min(maxt.x,min(maxt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(midt.y,mint.z))<min(midt.x,min(maxt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x4;packedCoords ^= 0x10000;if (max(mint.x,max(midt.y,midt.z))<min(midt.x,min(maxt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(midt.y,midt.z))<min(maxt.x,min(maxt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(mint.y,midt.z))<min(maxt.x,min(midt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(mint.y,midt.z))<min(midt.x,min(midt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nvoxel_march_diagnostic_info.heat=float(steps)/24.0;\n#endif\nreturn false;}\nfloat screenSpaceShadow(vec3 csOrigin,vec3 csDirection,vec2 csZBufferSize,\nfloat nearPlaneZ,float noise) {float csZDir=projMtx[2][2]>0.0 ? 1.0 : -1.0;float ssSamples=SSSsamples;float ssMaxDist=SSSmaxDistance;float ssStride=SSSstride;float ssThickness=SSSthickness;float rayLength =\ncsZDir*(csOrigin.z+ssMaxDist*csDirection.z)<csZDir*nearPlaneZ\n? \n(nearPlaneZ-csOrigin.z)/csDirection.z\n: ssMaxDist;vec3 csEndPoint=csOrigin+rayLength*csDirection;vec4 H0=projMtx*vec4(csOrigin,1.0);vec4 H1=projMtx*vec4(csEndPoint,1.0);vec2 Z0=vec2(csOrigin.z,1.0)/H0.w;vec2 Z1=vec2(csEndPoint.z,1.0)/H1.w;vec2 P0=csZBufferSize*(0.5*H0.xy*Z0.y+0.5);vec2 P1=csZBufferSize*(0.5*H1.xy*Z1.y+0.5);P1+=vec2(distanceSquared(P0,P1)<0.0001 ? 0.01 : 0.0);vec2 delta=P1-P0;bool permute=false;if (abs(delta.x)<abs(delta.y)) {permute=true;P0=P0.yx;P1=P1.yx;delta=delta.yx;}\nfloat stepDirection=sign(delta.x);float invdx=stepDirection/delta.x;vec2 dP=ssStride*vec2(stepDirection,invdx*delta.y);vec2 dZ=ssStride*invdx*(Z1-Z0);float opacity=0.0;vec2 P=P0+noise*dP;vec2 Z=Z0+noise*dZ;float end=P1.x*stepDirection;float rayZMax=csZDir*Z.x/Z.y;float sceneDepth=rayZMax;Z+=dZ;for (float stepCount=0.0; opacity<1.0 && P.x*stepDirection<end &&\nsceneDepth>0.0 && stepCount<ssSamples;stepCount++,P+=dP,\nZ+=dZ) { \nvec2 linearZ_alpha =\ntexelFetch(linearDepthSampler,ivec2(permute ? P.yx : P),0).xy;sceneDepth=csZDir*linearZ_alpha.x;if (sceneDepth<=0.0)\nbreak;float rayZMin=rayZMax;rayZMax=csZDir*Z.x/Z.y;opacity+=max(opacity,step(rayZMax,sceneDepth+ssThickness) *\nstep(sceneDepth,rayZMin));}\nreturn opacity;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nfloat voxelShadow(vec3 wsOrigin,vec3 wsDirection,vec3 wsNormal,\nvec2 DitherNoise,\nout VoxelMarchDiagnosticInfo voxel_march_diagnostic_info) {\n#else\nfloat voxelShadow(vec3 wsOrigin,vec3 wsDirection,vec3 wsNormal,\nvec2 DitherNoise) {\n#endif\nfloat vxResolution=float(textureSize(voxelGridSampler,0).x);vec3 T,B;genTB(wsDirection,T,B);vec2 DitherXY=sqrt(DitherNoise.x)*vec2(cos(2.0*PI*DitherNoise.y),\nsin(2.0*PI*DitherNoise.y));vec3 Dithering =\n(2.0*wsNormal+3.0*wsDirection+DitherXY.x*T+DitherXY.y*B) /\nvxResolution;vec3 O=0.5*wsOrigin+0.5+Dithering;Ray ray_vs=make_ray(O,wsDirection,0.0,10.0);AABB3f voxel_aabb;voxel_aabb.m_min=vec3(0);voxel_aabb.m_max=vec3(1);float near,far;if (!ray_box_intersection(voxel_aabb,ray_vs,near,far))\nreturn 0.0;ray_vs.t_min=max(ray_vs.t_min,near);ray_vs.t_max=min(ray_vs.t_max,far);\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nreturn anyHitVoxels(ray_vs,voxel_march_diagnostic_info) ? 1.0f : 0.0f;\n#else\nreturn anyHitVoxels(ray_vs) ? 1.0f : 0.0f;\n#endif\n}\nvoid main(void) {uint nbDirs=uint(SHADOWdirs);uint frameId=uint(SHADOWframe);int downscale=int(SHADOWdownscale);float envRot=SHADOWenvRot;vec2 Resolution=vec2(textureSize(depthSampler,0));ivec2 currentPixel=ivec2(vUV*Resolution);ivec2 PixelCoord=ivec2(vec2(currentPixel*downscale)+PixelOffset.xy);uint GlobalIndex =\n(frameId*uint(Resolution.y)+uint(PixelCoord.y))*uint(Resolution.x) +\nuint(PixelCoord.x);vec3 N=texelFetch(worldNormalSampler,PixelCoord,0).xyz;N=N*vec3(2.0)-vec3(1.0);if (length(N)<0.01) {glFragColor=vec4(1.0,1.0,0.0,1.0);return;}\nfloat normalizedRotation=envRot/(2.0*PI);float depth=texelFetch(depthSampler,PixelCoord,0).x;depth=depth*2.0-1.0;vec2 temp=(vec2(PixelCoord)+vec2(0.5))*2.0/Resolution-vec2(1.0);vec2 temp2=vUV*vec2(2.0)-vec2(1.0);vec4 VP=invProjMtx*vec4(temp.x,-temp.y,depth,1.0);VP/=VP.w;N=normalize(N);vec3 noise=texelFetch(blueNoiseSampler,PixelCoord & 0xFF,0).xyz;noise.z=fract(noise.z+goldenSequence(frameId*nbDirs));vec2 linearZ_alpha=texelFetch(linearDepthSampler,PixelCoord,0).xy;linearZ_alpha.x*=-1.0;\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nfloat heat=0.0f;\n#endif\nfloat shadowAccum=0.0;for (uint i=0u; i<nbDirs; i++) {uint dirId=nbDirs*GlobalIndex+i;vec4 L;{vec2 r=plasticSequence(frameId*nbDirs+i);r=fract(r+vec2(2.0)*abs(noise.xy-vec2(0.5)));vec2 T;T.x=textureLod(icdfxSampler,vec2(r.x,0.0),0.0).x;T.y=textureLod(icdfySampler,vec2(T.x,r.y),0.0).x;T.x-=normalizedRotation;L=vec4(uv_to_normal(T),0);}\nfloat edge_tint_const=linearZ_alpha.y>0.0 ? -0.001 : -0.1;float cosNL=dot(N,L.xyz);float opacity=cosNL<edge_tint_const ? 1.0 : 0.0;if (cosNL>edge_tint_const) {vec4 VP2=VP;VP2.y*=-1.0;vec4 unormWP=invViewMtx*VP2;vec3 WP=(wsNormalizationMtx*unormWP).xyz;vec2 vxNoise =\nvec2(uint2float(hash(dirId*2u)),uint2float(hash(dirId*2u+1u)));\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nVoxelMarchDiagnosticInfo voxel_march_diagnostic_info;opacity=max(opacity,\nshadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise,\nvoxel_march_diagnostic_info));heat+=voxel_march_diagnostic_info.heat;\n#else\nopacity =\nmax(opacity,shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise));\n#endif\nvec3 VL=(viewMtx*L).xyz;float nearPlaneZ =\n-projMtx[3][2]/projMtx[2][2]; \nfloat ssShadow=shadowOpacity.y *\nscreenSpaceShadow(VP2.xyz,VL,Resolution,nearPlaneZ,\nabs(2.0*noise.z-1.0));opacity=max(opacity,ssShadow);shadowAccum+=min(1.0-opacity,smoothstep(-0.1,0.2,cosNL));} else {shadowAccum+=min(1.0-opacity,smoothstep(-0.1,0.2,cosNL));}\nnoise.z=fract(noise.z+GOLD);}\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\ngl_FragColor =\nvec4(shadowAccum/float(nbDirs),heat/float(nbDirs),0.0,1.0);\n#else\ngl_FragColor=vec4(shadowAccum/float(nbDirs),0.0,0.0,1.0);\n#endif\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblShadowVoxelTracingPixelShader = { name, shader };\n"]}
1
+ {"version":3,"file":"iblShadowVoxelTracing.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblShadowVoxelTracing.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,kCAAkC,CAAC;AAChD,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuJb,CAAC;AACH,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"iblShadowVoxelTracingPixelShader\";\nconst shader = `precision highp sampler2D;precision highp sampler3D;\n#define PI 3.1415927\nvarying vec2 vUV;\n#define DISABLE_UNIFORMITY_ANALYSIS\nuniform sampler2D depthSampler;uniform sampler2D worldNormalSampler;uniform sampler2D worldPositionSampler;uniform sampler2D blueNoiseSampler;uniform sampler2D icdfxSampler;uniform sampler2D icdfySampler;uniform sampler3D voxelGridSampler;uniform vec4 shadowParameters;\n#define SHADOWdirs shadowParameters.x\n#define SHADOWframe shadowParameters.y\n#define SHADOWdownscale shadowParameters.z\n#define SHADOWenvRot shadowParameters.w\nuniform vec4 offsetDataParameters;\n#define PixelOffset offsetDataParameters.xy\n#define highestMipLevel offsetDataParameters.z\nuniform vec4 sssParameters;\n#define SSSsamples sssParameters.x\n#define SSSstride sssParameters.y\n#define SSSmaxDistance sssParameters.z\n#define SSSthickness sssParameters.w\nuniform vec4 shadowOpacity;uniform mat4 projMtx;uniform mat4 viewMtx;uniform mat4 invProjMtx;uniform mat4 invViewMtx;uniform mat4 wsNormalizationMtx;uniform mat4 invVPMtx;\n#define PI 3.1415927\n#define GOLD 0.618034\nstruct AABB3f {vec3 m_min;vec3 m_max;};struct Ray {vec3 orig;vec3 dir;vec3 dir_rcp;float t_min;float t_max;};Ray make_ray(const vec3 origin,const vec3 direction,const float tmin,\nconst float tmax) {Ray ray;ray.orig=origin;ray.dir=direction;ray.dir_rcp=1.0f/direction;ray.t_min=tmin;ray.t_max=tmax;return ray;}\nbool ray_box_intersection(const in AABB3f aabb,const in Ray ray,\nout float distance_near,out float distance_far) {vec3 tbot=ray.dir_rcp*(aabb.m_min-ray.orig);vec3 ttop=ray.dir_rcp*(aabb.m_max-ray.orig);vec3 tmin=min(ttop,tbot);vec3 tmax=max(ttop,tbot);distance_near=max(ray.t_min,max(tmin.x,max(tmin.y,tmin.z)));distance_far=min(ray.t_max,min(tmax.x,min(tmax.y,tmax.z)));return distance_near<=distance_far;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nstruct VoxelMarchDiagnosticInfo {float heat;ivec3 voxel_intersect_coords;};\n#endif\nuint hash(uint i) {i ^= i>>16u;i*=0x7FEB352Du;i ^= i>>15u;i*=0x846CA68Bu;i ^= i>>16u;return i;}\nfloat uint2float(uint i) {return uintBitsToFloat(0x3F800000u | (i>>9u))-1.0;}\nvec3 uv_to_normal(vec2 uv) {vec3 N;vec2 uvRange=uv;float theta=uvRange.x*2.0*PI;float phi=uvRange.y*PI;N.x=cos(theta)*sin(phi);N.z=sin(theta)*sin(phi);N.y=cos(phi);return N;}\nvec2 plasticSequence(const uint rstate) {return vec2(uint2float(rstate*3242174889u),\nuint2float(rstate*2447445414u));}\nfloat goldenSequence(const uint rstate) {return uint2float(rstate*2654435769u);}\nfloat distanceSquared(vec2 a,vec2 b) {vec2 diff=a-b;return dot(diff,diff);}\nvoid genTB(const vec3 N,out vec3 T,out vec3 B) {float s=N.z<0.0 ? -1.0 : 1.0;float a=-1.0/(s+N.z);float b=N.x*N.y*a;T=vec3(1.0+s*N.x*N.x*a,s*b,-s*N.x);B=vec3(b,s+N.y*N.y*a,-N.y);}\nint stack[24]; \n#define PUSH(i) stack[stackLevel++]=i; \n#define POP() stack[--stackLevel] \n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nbool anyHitVoxels(const Ray ray_vs,\nout VoxelMarchDiagnosticInfo voxel_march_diagnostic_info) {\n#else\nbool anyHitVoxels(const Ray ray_vs) {\n#endif\nvec3 invD=ray_vs.dir_rcp;vec3 D=ray_vs.dir;vec3 O=ray_vs.orig;ivec3 negD=ivec3(lessThan(D,vec3(0,0,0)));int voxel0=negD.x | negD.y<<1 | negD.z<<2;vec3 t0=-O*invD,t1=(vec3(1.0)-O)*invD;int maxLod=int(highestMipLevel);int stackLevel=0;\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nuint steps=0u;\n#endif\nPUSH(maxLod<<24);while (stackLevel>0) {int elem=POP();ivec4 Coords =\nivec4(elem & 0xFF,elem>>8 & 0xFF,elem>>16 & 0xFF,elem>>24);if (Coords.w==0) {\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nvoxel_march_diagnostic_info.heat=float(steps)/24.0;\n#endif\nreturn true;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\n++steps;\n#endif\nfloat invRes=exp2(float(Coords.w-maxLod));vec3 bbmin=invRes*vec3(Coords.xyz+negD);vec3 bbmax=invRes*vec3(Coords.xyz-negD+ivec3(1));vec3 mint=mix(t0,t1,bbmin);vec3 maxt=mix(t0,t1,bbmax);vec3 midt=0.5*(mint+maxt);mint.x=max(0.0,mint.x);midt.x=max(0.0,midt.x);int nodeMask=int(\nround(texelFetch(voxelGridSampler,Coords.xyz,Coords.w).x*255.0));Coords.w--;int voxelBit=voxel0;Coords.xyz=(Coords.xyz<<1)+negD;int packedCoords =\nCoords.x | Coords.y<<8 | Coords.z<<16 | Coords.w<<24;if (max(mint.x,max(mint.y,mint.z))<min(midt.x,min(midt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(mint.y,mint.z))<min(maxt.x,min(midt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(midt.y,mint.z))<min(maxt.x,min(maxt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(midt.y,mint.z))<min(midt.x,min(maxt.y,midt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x4;packedCoords ^= 0x10000;if (max(mint.x,max(midt.y,midt.z))<min(midt.x,min(maxt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(midt.x,max(midt.y,midt.z))<min(maxt.x,min(maxt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x2;packedCoords ^= 0x00100;if (max(midt.x,max(mint.y,midt.z))<min(maxt.x,min(midt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);voxelBit ^= 0x1;packedCoords ^= 0x00001;if (max(mint.x,max(mint.y,midt.z))<min(midt.x,min(midt.y,maxt.z)) &&\n(1<<voxelBit & nodeMask) != 0)\nPUSH(packedCoords);}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nvoxel_march_diagnostic_info.heat=float(steps)/24.0;\n#endif\nreturn false;}\nfloat screenSpaceShadow(vec3 csOrigin,vec3 csDirection,vec2 csZBufferSize,\nfloat nearPlaneZ,float noise) {float csZDir=projMtx[2][2]>0.0 ? 1.0 : -1.0;float ssSamples=SSSsamples;float ssMaxDist=SSSmaxDistance;float ssStride=SSSstride;float ssThickness=SSSthickness;float rayLength =\ncsZDir*(csOrigin.z+ssMaxDist*csDirection.z)<csZDir*nearPlaneZ\n? \n(nearPlaneZ-csOrigin.z)/csDirection.z\n: ssMaxDist;vec3 csEndPoint=csOrigin+rayLength*csDirection;vec4 H0=projMtx*vec4(csOrigin,1.0);vec4 H1=projMtx*vec4(csEndPoint,1.0);\n#ifndef IS_NDC_HALF_ZRANGE\nfloat Z0=(0.5*H0.z/H0.w+0.5);float Z1=(0.5*H1.z/H1.w+0.5);\n#else\nfloat Z0=(H0.z/H0.w);float Z1=(H1.z/H1.w);\n#endif\nvec2 P0=csZBufferSize*(0.5*H0.xy/H0.w+0.5);vec2 P1=csZBufferSize*(0.5*H1.xy/H1.w+0.5);P1+=vec2(distanceSquared(P0,P1)<0.0001 ? 0.01 : 0.0);vec2 delta=P1-P0;bool permute=false;if (abs(delta.x)<abs(delta.y)) {permute=true;P0=P0.yx;P1=P1.yx;delta=delta.yx;}\nfloat stepDirection=sign(delta.x);float invdx=stepDirection/delta.x;vec2 dP=ssStride*vec2(stepDirection,invdx*delta.y);float dZ=ssStride*invdx*(Z1-Z0);float opacity=0.0;vec2 P=P0+noise*dP;float Z=Z0+noise*dZ;float end=P1.x*stepDirection;Z+=dZ;for (float stepCount=0.0;opacity<1.0 && P.x*stepDirection<end && stepCount<ssSamples;stepCount++,P+=dP,\nZ+=dZ) { \nivec2 coords=ivec2(permute ? P.yx : P);float sceneDepth=texelFetch(depthSampler,coords,0).x;float thicknessScale=pow(1.0-sceneDepth,1.6);opacity +=\nmax(opacity,step(Z+dZ,sceneDepth+thicknessScale*ssThickness) *\nstep(sceneDepth,Z));}\nreturn opacity;}\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nfloat voxelShadow(vec3 wsOrigin,vec3 wsDirection,vec3 wsNormal,\nvec2 DitherNoise,\nout VoxelMarchDiagnosticInfo voxel_march_diagnostic_info) {\n#else\nfloat voxelShadow(vec3 wsOrigin,vec3 wsDirection,vec3 wsNormal,\nvec2 DitherNoise) {\n#endif\nfloat vxResolution=float(textureSize(voxelGridSampler,0).x);vec3 T,B;genTB(wsDirection,T,B);vec2 DitherXY=sqrt(DitherNoise.x)*vec2(cos(2.0*PI*DitherNoise.y),\nsin(2.0*PI*DitherNoise.y));vec3 Dithering =\n(2.0*wsNormal+3.0*wsDirection+DitherXY.x*T+DitherXY.y*B) /\nvxResolution;vec3 O=0.5*wsOrigin+0.5+Dithering;Ray ray_vs=make_ray(O,wsDirection,0.0,10.0);AABB3f voxel_aabb;voxel_aabb.m_min=vec3(0);voxel_aabb.m_max=vec3(1);float near,far;if (!ray_box_intersection(voxel_aabb,ray_vs,near,far))\nreturn 0.0;ray_vs.t_min=max(ray_vs.t_min,near);ray_vs.t_max=min(ray_vs.t_max,far);\n#if VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nreturn anyHitVoxels(ray_vs,voxel_march_diagnostic_info) ? 1.0f : 0.0f;\n#else\nreturn anyHitVoxels(ray_vs) ? 1.0f : 0.0f;\n#endif\n}\nvoid main(void) {uint nbDirs=uint(SHADOWdirs);uint frameId=uint(SHADOWframe);int downscale=int(SHADOWdownscale);float envRot=SHADOWenvRot;vec2 Resolution=vec2(textureSize(depthSampler,0));ivec2 currentPixel=ivec2(vUV*Resolution);ivec2 PixelCoord=ivec2(vec2(currentPixel*downscale)+PixelOffset.xy);uint GlobalIndex =\n(frameId*uint(Resolution.y)+uint(PixelCoord.y))*uint(Resolution.x) +\nuint(PixelCoord.x);vec3 N=texelFetch(worldNormalSampler,PixelCoord,0).xyz;N=N*vec3(2.0)-vec3(1.0);if (length(N)<0.01) {glFragColor=vec4(1.0,1.0,0.0,1.0);return;}\nfloat normalizedRotation=envRot/(2.0*PI);float depth=texelFetch(depthSampler,PixelCoord,0).x;\n#ifndef IS_NDC_HALF_ZRANGE\ndepth=depth*2.0-1.0;\n#endif\nvec2 temp=(vec2(PixelCoord)+vec2(0.5))*2.0/Resolution-vec2(1.0);vec2 temp2=vUV*vec2(2.0)-vec2(1.0);vec4 VP=invProjMtx*vec4(temp.x,-temp.y,depth,1.0);VP/=VP.w;N=normalize(N);vec3 noise=texelFetch(blueNoiseSampler,PixelCoord & 0xFF,0).xyz;noise.z=fract(noise.z+goldenSequence(frameId*nbDirs));\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nfloat heat=0.0f;\n#endif\nfloat shadowAccum=0.0;for (uint i=0u; i<nbDirs; i++) {uint dirId=nbDirs*GlobalIndex+i;vec4 L;{vec2 r=plasticSequence(frameId*nbDirs+i);r=fract(r+vec2(2.0)*abs(noise.xy-vec2(0.5)));vec2 T;T.x=textureLod(icdfxSampler,vec2(r.x,0.0),0.0).x;T.y=textureLod(icdfySampler,vec2(T.x,r.y),0.0).x;T.x-=normalizedRotation;L=vec4(uv_to_normal(T),0);}\nfloat edge_tint_const=-0.001;float cosNL=dot(N,L.xyz);float opacity=cosNL<edge_tint_const ? 1.0 : 0.0;if (cosNL>edge_tint_const) {vec4 VP2=VP;VP2.y*=-1.0;vec4 unormWP=invViewMtx*VP2;vec3 WP=(wsNormalizationMtx*unormWP).xyz;vec2 vxNoise =\nvec2(uint2float(hash(dirId*2u)),uint2float(hash(dirId*2u+1u)));\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\nVoxelMarchDiagnosticInfo voxel_march_diagnostic_info;opacity=max(opacity,\nshadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise,\nvoxel_march_diagnostic_info));heat+=voxel_march_diagnostic_info.heat;\n#else\nopacity =\nmax(opacity,shadowOpacity.x*voxelShadow(WP,L.xyz,N,vxNoise));\n#endif\nvec3 VL=(viewMtx*L).xyz;float nearPlaneZ =\n-projMtx[3][2]/projMtx[2][2]; \nfloat ssShadow=shadowOpacity.y *\nscreenSpaceShadow(VP2.xyz,VL,Resolution,nearPlaneZ,\nabs(2.0*noise.z-1.0));opacity=max(opacity,ssShadow);shadowAccum+=min(1.0-opacity,smoothstep(-0.1,0.2,cosNL));} else {shadowAccum+=min(1.0-opacity,smoothstep(-0.1,0.2,cosNL));}\nnoise.z=fract(noise.z+GOLD);}\n#ifdef VOXEL_MARCH_DIAGNOSTIC_INFO_OPTION\ngl_FragColor =\nvec4(shadowAccum/float(nbDirs),heat/float(nbDirs),0.0,1.0);\n#else\ngl_FragColor=vec4(shadowAccum/float(nbDirs),0.0,0.0,1.0);\n#endif\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblShadowVoxelTracingPixelShader = { name, shader };\n"]}
@@ -40,7 +40,8 @@ texture2D(cdfx,(uv-vec2(0.0,cdfxStart))*vec2(1.0,1.0/cdfxVSize))
40
40
  .r;float icdfxColour=texture2D(icdfx,(uv-vec2(0.0,icdfxStart)) *
41
41
  vec2(1.0,1.0/cdfxVSize))
42
42
  .r;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {colour=backgroundColour;} else if (uv.y>iblStart) {colour+=iblColour;} else if (uv.y>cdfyStart && uv.x<0.5) {colour.r+=0.003*cdfyColour;} else if (uv.y>cdfyStart && uv.x>0.5) {colour.r+=icdfyColour;} else if (uv.y>cdfxStart) {colour.r+=0.00003*cdfxColour;} else if (uv.y>icdfxStart) {colour.r+=icdfxColour;}
43
- gl_FragColor=vec4(colour,1.0);glFragColor.rgb=mix(gl_FragColor.rgb,backgroundColour,0.5);}`;
43
+ gl_FragColor=vec4(colour,1.0);glFragColor.rgb=mix(gl_FragColor.rgb,backgroundColour,0.5);}
44
+ `;
44
45
  // Sideeffect
45
46
  ShaderStore.ShadersStore[name] = shader;
46
47
  /** @internal */
@@ -1 +1 @@
1
- {"version":3,"file":"iblShadowsImportanceSamplingDebug.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblShadowsImportanceSamplingDebug.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,8CAA8C,CAAC;AAC5D,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2FAuC4E,CAAC;AAC5F,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,4CAA4C,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"iblShadowsImportanceSamplingDebugPixelShader\";\nconst shader = `precision highp samplerCube;\n#define PI 3.1415927\nvarying vec2 vUV;uniform sampler2D cdfy;uniform sampler2D icdfy;uniform sampler2D cdfx;uniform sampler2D icdfx;\n#ifdef IBL_USE_CUBE_MAP\nuniform samplerCube iblSource;\n#else\nuniform sampler2D iblSource;\n#endif\nuniform sampler2D textureSampler;\n#define cdfyVSize 0.4\n#define cdfxVSize 0.1\n#define cdfyHSize 0.5\nuniform vec4 sizeParams;\n#define offsetX sizeParams.x\n#define offsetY sizeParams.y\n#define widthScale sizeParams.z\n#define heightScale sizeParams.w\n#ifdef IBL_USE_CUBE_MAP\nvec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*2.0*PI-PI;float latitude=PI*0.5-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}\n#endif\nvoid main(void) {vec3 colour=vec3(0.0);vec2 uv =\nvec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec3 backgroundColour=texture2D(textureSampler,vUV).rgb;const float iblStart=1.0-cdfyVSize;const float cdfyStart=1.0-2.0*cdfyVSize;const float cdfxStart=1.0-2.0*cdfyVSize-cdfxVSize;const float icdfxStart=1.0-2.0*cdfyVSize-2.0*cdfxVSize;\n#ifdef IBL_USE_CUBE_MAP\nvec3 direction=equirectangularToCubemapDirection(\n(uv-vec2(0.0,iblStart))*vec2(1.0,1.0/cdfyVSize));vec3 iblColour=textureCubeLodEXT(iblSource,direction,0.0).rgb;\n#else\nvec3 iblColour=texture2D(iblSource,(uv-vec2(0.0,iblStart)) *\nvec2(1.0,1.0/cdfyVSize))\n.rgb;\n#endif\nfloat cdfyColour =\ntexture2D(cdfy,(uv-vec2(0.0,cdfyStart))*vec2(2.0,1.0/cdfyVSize))\n.r;float icdfyColour =\ntexture2D(icdfy,(uv-vec2(0.5,cdfyStart))*vec2(2.0,1.0/cdfyVSize))\n.r;float cdfxColour =\ntexture2D(cdfx,(uv-vec2(0.0,cdfxStart))*vec2(1.0,1.0/cdfxVSize))\n.r;float icdfxColour=texture2D(icdfx,(uv-vec2(0.0,icdfxStart)) *\nvec2(1.0,1.0/cdfxVSize))\n.r;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {colour=backgroundColour;} else if (uv.y>iblStart) {colour+=iblColour;} else if (uv.y>cdfyStart && uv.x<0.5) {colour.r+=0.003*cdfyColour;} else if (uv.y>cdfyStart && uv.x>0.5) {colour.r+=icdfyColour;} else if (uv.y>cdfxStart) {colour.r+=0.00003*cdfxColour;} else if (uv.y>icdfxStart) {colour.r+=icdfxColour;}\ngl_FragColor=vec4(colour,1.0);glFragColor.rgb=mix(gl_FragColor.rgb,backgroundColour,0.5);}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblShadowsImportanceSamplingDebugPixelShader = { name, shader };\n"]}
1
+ {"version":3,"file":"iblShadowsImportanceSamplingDebug.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblShadowsImportanceSamplingDebug.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,8CAA8C,CAAC;AAC5D,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,4CAA4C,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"iblShadowsImportanceSamplingDebugPixelShader\";\nconst shader = `precision highp samplerCube;\n#define PI 3.1415927\nvarying vec2 vUV;uniform sampler2D cdfy;uniform sampler2D icdfy;uniform sampler2D cdfx;uniform sampler2D icdfx;\n#ifdef IBL_USE_CUBE_MAP\nuniform samplerCube iblSource;\n#else\nuniform sampler2D iblSource;\n#endif\nuniform sampler2D textureSampler;\n#define cdfyVSize 0.4\n#define cdfxVSize 0.1\n#define cdfyHSize 0.5\nuniform vec4 sizeParams;\n#define offsetX sizeParams.x\n#define offsetY sizeParams.y\n#define widthScale sizeParams.z\n#define heightScale sizeParams.w\n#ifdef IBL_USE_CUBE_MAP\nvec3 equirectangularToCubemapDirection(vec2 uv) {float longitude=uv.x*2.0*PI-PI;float latitude=PI*0.5-uv.y*PI;vec3 direction;direction.x=cos(latitude)*sin(longitude);direction.y=sin(latitude);direction.z=cos(latitude)*cos(longitude);return direction;}\n#endif\nvoid main(void) {vec3 colour=vec3(0.0);vec2 uv =\nvec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec3 backgroundColour=texture2D(textureSampler,vUV).rgb;const float iblStart=1.0-cdfyVSize;const float cdfyStart=1.0-2.0*cdfyVSize;const float cdfxStart=1.0-2.0*cdfyVSize-cdfxVSize;const float icdfxStart=1.0-2.0*cdfyVSize-2.0*cdfxVSize;\n#ifdef IBL_USE_CUBE_MAP\nvec3 direction=equirectangularToCubemapDirection(\n(uv-vec2(0.0,iblStart))*vec2(1.0,1.0/cdfyVSize));vec3 iblColour=textureCubeLodEXT(iblSource,direction,0.0).rgb;\n#else\nvec3 iblColour=texture2D(iblSource,(uv-vec2(0.0,iblStart)) *\nvec2(1.0,1.0/cdfyVSize))\n.rgb;\n#endif\nfloat cdfyColour =\ntexture2D(cdfy,(uv-vec2(0.0,cdfyStart))*vec2(2.0,1.0/cdfyVSize))\n.r;float icdfyColour =\ntexture2D(icdfy,(uv-vec2(0.5,cdfyStart))*vec2(2.0,1.0/cdfyVSize))\n.r;float cdfxColour =\ntexture2D(cdfx,(uv-vec2(0.0,cdfxStart))*vec2(1.0,1.0/cdfxVSize))\n.r;float icdfxColour=texture2D(icdfx,(uv-vec2(0.0,icdfxStart)) *\nvec2(1.0,1.0/cdfxVSize))\n.r;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {colour=backgroundColour;} else if (uv.y>iblStart) {colour+=iblColour;} else if (uv.y>cdfyStart && uv.x<0.5) {colour.r+=0.003*cdfyColour;} else if (uv.y>cdfyStart && uv.x>0.5) {colour.r+=icdfyColour;} else if (uv.y>cdfxStart) {colour.r+=0.00003*cdfxColour;} else if (uv.y>icdfxStart) {colour.r+=icdfxColour;}\ngl_FragColor=vec4(colour,1.0);glFragColor.rgb=mix(gl_FragColor.rgb,backgroundColour,0.5);}\n`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblShadowsImportanceSamplingDebugPixelShader = { name, shader };\n"]}
@@ -1,5 +1,5 @@
1
1
  /** @internal */
2
- export declare const voxelGridPixelShader: {
2
+ export declare const iblVoxelGridPixelShader: {
3
3
  name: string;
4
4
  shader: string;
5
5
  };
@@ -1,6 +1,6 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "../Engines/shaderStore.js";
3
- const name = "voxelGridPixelShader";
3
+ const name = "iblVoxelGridPixelShader";
4
4
  const shader = `precision highp float;layout(location=0) out highp float glFragData[MAX_DRAW_BUFFERS];varying vec3 vNormalizedPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;if (normPos.z<nearPlane || normPos.z>farPlane) {discard;}
5
5
  glFragData[0]=normPos.z<nearPlane+stepSize ? 1.0 : 0.0;glFragData[1]=normPos.z>=nearPlane+stepSize && normPos.z<nearPlane+2.0*stepSize ? 1.0 : 0.0;glFragData[2]=normPos.z>=nearPlane+2.0*stepSize && normPos.z<nearPlane+3.0*stepSize ? 1.0 : 0.0;glFragData[3]=normPos.z>=nearPlane+3.0*stepSize && normPos.z<nearPlane+4.0*stepSize ? 1.0 : 0.0;
6
6
  #if MAX_DRAW_BUFFERS>4
@@ -10,5 +10,5 @@ glFragData[4]=normPos.z>=nearPlane+4.0*stepSize && normPos.z<nearPlane+5.0*stepS
10
10
  // Sideeffect
11
11
  ShaderStore.ShadersStore[name] = shader;
12
12
  /** @internal */
13
- export const voxelGridPixelShader = { name, shader };
14
- //# sourceMappingURL=voxelGrid.fragment.js.map
13
+ export const iblVoxelGridPixelShader = { name, shader };
14
+ //# sourceMappingURL=iblVoxelGrid.fragment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iblVoxelGrid.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblVoxelGrid.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,yBAAyB,CAAC;AACvC,MAAM,MAAM,GAAG;;;;;EAKb,CAAC;AACH,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"iblVoxelGridPixelShader\";\nconst shader = `precision highp float;layout(location=0) out highp float glFragData[MAX_DRAW_BUFFERS];varying vec3 vNormalizedPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;if (normPos.z<nearPlane || normPos.z>farPlane) {discard;}\nglFragData[0]=normPos.z<nearPlane+stepSize ? 1.0 : 0.0;glFragData[1]=normPos.z>=nearPlane+stepSize && normPos.z<nearPlane+2.0*stepSize ? 1.0 : 0.0;glFragData[2]=normPos.z>=nearPlane+2.0*stepSize && normPos.z<nearPlane+3.0*stepSize ? 1.0 : 0.0;glFragData[3]=normPos.z>=nearPlane+3.0*stepSize && normPos.z<nearPlane+4.0*stepSize ? 1.0 : 0.0;\n#if MAX_DRAW_BUFFERS>4\nglFragData[4]=normPos.z>=nearPlane+4.0*stepSize && normPos.z<nearPlane+5.0*stepSize ? 1.0 : 0.0;glFragData[5]=normPos.z>=nearPlane+5.0*stepSize && normPos.z<nearPlane+6.0*stepSize ? 1.0 : 0.0;glFragData[6]=normPos.z>=nearPlane+6.0*stepSize && normPos.z<nearPlane+7.0*stepSize ? 1.0 : 0.0;glFragData[7]=normPos.z>=nearPlane+7.0*stepSize && normPos.z<nearPlane+8.0*stepSize ? 1.0 : 0.0;\n#endif\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblVoxelGridPixelShader = { name, shader };\n"]}
@@ -1,5 +1,5 @@
1
1
  /** @internal */
2
- export declare const voxelSlabDebugPixelShader: {
2
+ export declare const iblVoxelGridVertexShader: {
3
3
  name: string;
4
4
  shader: string;
5
5
  };
@@ -1,9 +1,13 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "../Engines/shaderStore.js";
3
- const name = "voxelGridVertexShader";
4
- const shader = `attribute vec3 position;attribute vec3 normal;varying vec3 vNormalizedPosition;uniform mat4 world;uniform mat4 invWorldScale;uniform mat4 viewMatrix;void main(void) {gl_Position=viewMatrix*invWorldScale*world*vec4(position,1.);vNormalizedPosition.xyz=gl_Position.xyz*0.5+0.5;}`;
3
+ const name = "iblVoxelGridVertexShader";
4
+ const shader = `attribute vec3 position;attribute vec3 normal;varying vec3 vNormalizedPosition;uniform mat4 world;uniform mat4 invWorldScale;uniform mat4 viewMatrix;void main(void) {gl_Position=viewMatrix*invWorldScale*world*vec4(position,1.);vNormalizedPosition.xyz=gl_Position.xyz*0.5+0.5;
5
+ #ifdef IS_NDC_HALF_ZRANGE
6
+ gl_Position.z=gl_Position.z*0.5+0.5;
7
+ #endif
8
+ }`;
5
9
  // Sideeffect
6
10
  ShaderStore.ShadersStore[name] = shader;
7
11
  /** @internal */
8
- export const voxelGridVertexShader = { name, shader };
9
- //# sourceMappingURL=voxelGrid.vertex.js.map
12
+ export const iblVoxelGridVertexShader = { name, shader };
13
+ //# sourceMappingURL=iblVoxelGrid.vertex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iblVoxelGrid.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblVoxelGrid.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,0BAA0B,CAAC;AACxC,MAAM,MAAM,GAAG;;;;EAIb,CAAC;AACH,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"iblVoxelGridVertexShader\";\nconst shader = `attribute vec3 position;attribute vec3 normal;varying vec3 vNormalizedPosition;uniform mat4 world;uniform mat4 invWorldScale;uniform mat4 viewMatrix;void main(void) {gl_Position=viewMatrix*invWorldScale*world*vec4(position,1.);vNormalizedPosition.xyz=gl_Position.xyz*0.5+0.5;\n#ifdef IS_NDC_HALF_ZRANGE\ngl_Position.z=gl_Position.z*0.5+0.5;\n#endif\n}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblVoxelGridVertexShader = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const iblVoxelGrid2dArrayDebugPixelShader: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -1,9 +1,9 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "../Engines/shaderStore.js";
3
- const name = "voxelGrid2dArrayDebugPixelShader";
3
+ const name = "iblVoxelGrid2dArrayDebugPixelShader";
4
4
  const shader = `precision highp sampler2DArray;varying vec2 vUV;uniform sampler2DArray voxelTexture;uniform sampler2D textureSampler;uniform int slice;void main(void) {ivec3 size=textureSize(voxelTexture,0);float dimension=sqrt(float(size.z));vec2 samplePos=fract(vUV.xy*vec2(dimension));int sampleIndex=int(floor(vUV.x*float(dimension))+floor(vUV.y*float(dimension))*dimension);glFragColor.rgb=texture(voxelTexture,vec3(samplePos.xy,sampleIndex)).rrr;glFragColor.a=1.0;glFragColor.rgb+=texture(textureSampler,vUV.xy).rgb;}`;
5
5
  // Sideeffect
6
6
  ShaderStore.ShadersStore[name] = shader;
7
7
  /** @internal */
8
- export const voxelGrid2dArrayDebugPixelShader = { name, shader };
9
- //# sourceMappingURL=voxelGrid2dArrayDebug.fragment.js.map
8
+ export const iblVoxelGrid2dArrayDebugPixelShader = { name, shader };
9
+ //# sourceMappingURL=iblVoxelGrid2dArrayDebug.fragment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iblVoxelGrid2dArrayDebug.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblVoxelGrid2dArrayDebug.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,qCAAqC,CAAC;AACnD,MAAM,MAAM,GAAG,6fAA6f,CAAC;AAC7gB,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,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 = \"iblVoxelGrid2dArrayDebugPixelShader\";\nconst shader = `precision highp sampler2DArray;varying vec2 vUV;uniform sampler2DArray voxelTexture;uniform sampler2D textureSampler;uniform int slice;void main(void) {ivec3 size=textureSize(voxelTexture,0);float dimension=sqrt(float(size.z));vec2 samplePos=fract(vUV.xy*vec2(dimension));int sampleIndex=int(floor(vUV.x*float(dimension))+floor(vUV.y*float(dimension))*dimension);glFragColor.rgb=texture(voxelTexture,vec3(samplePos.xy,sampleIndex)).rrr;glFragColor.a=1.0;glFragColor.rgb+=texture(textureSampler,vUV.xy).rgb;}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblVoxelGrid2dArrayDebugPixelShader = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const iblVoxelGrid3dDebugPixelShader: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -1,6 +1,6 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "../Engines/shaderStore.js";
3
- const name = "voxelGrid3dDebugPixelShader";
3
+ const name = "iblVoxelGrid3dDebugPixelShader";
4
4
  const shader = `precision highp sampler3D;varying vec2 vUV;uniform sampler3D voxelTexture;uniform sampler2D voxelSlabTexture;uniform sampler2D textureSampler;uniform vec4 sizeParams;
5
5
  #define offsetX sizeParams.x
6
6
  #define offsetY sizeParams.y
@@ -18,5 +18,5 @@ glFragColor.rgb=mix(background.rgb,voxelSlab.rgb,voxelSlab.a)+voxel;glFragColor.
18
18
  // Sideeffect
19
19
  ShaderStore.ShadersStore[name] = shader;
20
20
  /** @internal */
21
- export const voxelGrid3dDebugPixelShader = { name, shader };
22
- //# sourceMappingURL=voxelGrid3dDebug.fragment.js.map
21
+ export const iblVoxelGrid3dDebugPixelShader = { name, shader };
22
+ //# sourceMappingURL=iblVoxelGrid3dDebug.fragment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iblVoxelGrid3dDebug.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblVoxelGrid3dDebug.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,gCAAgC,CAAC;AAC9C,MAAM,MAAM,GAAG;;;;;;;;;;;;;yFAa0E,CAAC;AAC1F,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,8BAA8B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"iblVoxelGrid3dDebugPixelShader\";\nconst shader = `precision highp sampler3D;varying vec2 vUV;uniform sampler3D voxelTexture;uniform sampler2D voxelSlabTexture;uniform sampler2D textureSampler;uniform vec4 sizeParams;\n#define offsetX sizeParams.x\n#define offsetY sizeParams.y\n#define widthScale sizeParams.z\n#define heightScale sizeParams.w\nuniform float mipNumber;void main(void) {vec2 uv =\nvec2((offsetX+vUV.x)*widthScale,(offsetY+vUV.y)*heightScale);vec4 background=texture2D(textureSampler,vUV);vec4 voxelSlab=texture2D(voxelSlabTexture,vUV);ivec3 size=textureSize(voxelTexture,int(mipNumber));float dimension=ceil(sqrt(float(size.z)));vec2 samplePos=fract(uv.xy*vec2(dimension));int sampleIndex=int(floor(uv.x*float(dimension)) +\nfloor(uv.y*float(dimension))*dimension);float mip_separator=0.0;if (samplePos.x<0.01 || samplePos.y<0.01) {mip_separator=1.0;}\nbool outBounds=sampleIndex>size.z-1 ? true : false;sampleIndex=clamp(sampleIndex,0,size.z-1);ivec2 samplePosInt=ivec2(samplePos.xy*vec2(size.xy));vec3 voxel=texelFetch(voxelTexture,\nivec3(samplePosInt.x,samplePosInt.y,sampleIndex),\nint(mipNumber))\n.rgb;if (uv.x<0.0 || uv.x>1.0 || uv.y<0.0 || uv.y>1.0) {gl_FragColor.rgba=background;} else {if (outBounds) {voxel=vec3(0.15,0.0,0.0);} else {if (voxel.r>0.001) {voxel.g=1.0;}\nvoxel.r+=mip_separator;}\nglFragColor.rgb=mix(background.rgb,voxelSlab.rgb,voxelSlab.a)+voxel;glFragColor.a=1.0;}}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblVoxelGrid3dDebugPixelShader = { name, shader };\n"]}
@@ -1,5 +1,5 @@
1
1
  /** @internal */
2
- export declare const combineVoxelGridsPixelShader: {
2
+ export declare const iblVoxelSlabDebugPixelShader: {
3
3
  name: string;
4
4
  shader: string;
5
5
  };
@@ -1,11 +1,11 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "../Engines/shaderStore.js";
3
- const name = "voxelSlabDebugPixelShader";
3
+ const name = "iblVoxelSlabDebugPixelShader";
4
4
  const shader = `precision highp float;varying vec3 vNormalizedPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;float chunkSize=stepSize*float(MAX_DRAW_BUFFERS);float numChunks=1.0/chunkSize;float positionInChunk=fract(normPos.z/chunkSize);float slab=floor(positionInChunk*float(MAX_DRAW_BUFFERS)) /
5
5
  float(MAX_DRAW_BUFFERS);if (normPos.x<0.0 || normPos.y<0.0 || normPos.z<0.0 ||
6
6
  normPos.x>1.0 || normPos.y>1.0 || normPos.z>1.0) {gl_FragColor=vec4(0.0,0.0,0.0,0.0);} else {gl_FragColor=vec4(slab,0.0,0.0,0.75);}}`;
7
7
  // Sideeffect
8
8
  ShaderStore.ShadersStore[name] = shader;
9
9
  /** @internal */
10
- export const voxelSlabDebugPixelShader = { name, shader };
11
- //# sourceMappingURL=voxelSlabDebug.fragment.js.map
10
+ export const iblVoxelSlabDebugPixelShader = { name, shader };
11
+ //# sourceMappingURL=iblVoxelSlabDebug.fragment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iblVoxelSlabDebug.fragment.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblVoxelSlabDebug.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,8BAA8B,CAAC;AAC5C,MAAM,MAAM,GAAG;;qIAEsH,CAAC;AACtI,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,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 = \"iblVoxelSlabDebugPixelShader\";\nconst shader = `precision highp float;varying vec3 vNormalizedPosition;uniform float nearPlane;uniform float farPlane;uniform float stepSize;void main(void) {vec3 normPos=vNormalizedPosition.xyz;float chunkSize=stepSize*float(MAX_DRAW_BUFFERS);float numChunks=1.0/chunkSize;float positionInChunk=fract(normPos.z/chunkSize);float slab=floor(positionInChunk*float(MAX_DRAW_BUFFERS)) /\nfloat(MAX_DRAW_BUFFERS);if (normPos.x<0.0 || normPos.y<0.0 || normPos.z<0.0 ||\nnormPos.x>1.0 || normPos.y>1.0 || normPos.z>1.0) {gl_FragColor=vec4(0.0,0.0,0.0,0.0);} else {gl_FragColor=vec4(slab,0.0,0.0,0.75);}}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblVoxelSlabDebugPixelShader = { name, shader };\n"]}
@@ -0,0 +1,5 @@
1
+ /** @internal */
2
+ export declare const iblVoxelSlabDebugVertexShader: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -1,9 +1,9 @@
1
1
  // Do not edit.
2
2
  import { ShaderStore } from "../Engines/shaderStore.js";
3
- const name = "voxelSlabDebugVertexShader";
3
+ const name = "iblVoxelSlabDebugVertexShader";
4
4
  const shader = `attribute vec3 position;varying vec3 vNormalizedPosition;uniform mat4 world;uniform mat4 invWorldScale;uniform mat4 cameraViewMatrix;uniform mat4 projection;uniform mat4 viewMatrix;void main(void) {vec4 worldPosition=(world*vec4(position,1.));gl_Position=projection*cameraViewMatrix*worldPosition;vNormalizedPosition=(viewMatrix*invWorldScale*worldPosition).rgb;vNormalizedPosition.xyz=vNormalizedPosition.xyz*vec3(0.5)+vec3(0.5);}`;
5
5
  // Sideeffect
6
6
  ShaderStore.ShadersStore[name] = shader;
7
7
  /** @internal */
8
- export const voxelSlabDebugVertexShader = { name, shader };
9
- //# sourceMappingURL=voxelSlabDebug.vertex.js.map
8
+ export const iblVoxelSlabDebugVertexShader = { name, shader };
9
+ //# sourceMappingURL=iblVoxelSlabDebug.vertex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iblVoxelSlabDebug.vertex.js","sourceRoot":"","sources":["../../../../dev/core/src/Shaders/iblVoxelSlabDebug.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,IAAI,GAAG,+BAA+B,CAAC;AAC7C,MAAM,MAAM,GAAG,ibAAib,CAAC;AACjc,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"../Engines/shaderStore\";\n\nconst name = \"iblVoxelSlabDebugVertexShader\";\nconst shader = `attribute vec3 position;varying vec3 vNormalizedPosition;uniform mat4 world;uniform mat4 invWorldScale;uniform mat4 cameraViewMatrix;uniform mat4 projection;uniform mat4 viewMatrix;void main(void) {vec4 worldPosition=(world*vec4(position,1.));gl_Position=projection*cameraViewMatrix*worldPosition;vNormalizedPosition=(viewMatrix*invWorldScale*worldPosition).rgb;vNormalizedPosition.xyz=vNormalizedPosition.xyz*vec3(0.5)+vec3(0.5);}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @internal */\nexport const iblVoxelSlabDebugVertexShader = { name, shader };\n"]}
@@ -8,9 +8,9 @@ var diffuse{X}: vec4f=light{X}.vLightDiffuse;
8
8
  #define CUSTOM_LIGHT{X}_COLOR
9
9
  #ifdef PBR
10
10
  #ifdef SPOTLIGHT{X}
11
- preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,input.vPositionW);
11
+ preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,fragmentInputs.vPositionW);
12
12
  #elif defined(POINTLIGHT{X})
13
- preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,input.vPositionW);
13
+ preInfo=computePointAndSpotPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW,fragmentInputs.vPositionW);
14
14
  #elif defined(HEMILIGHT{X})
15
15
  preInfo=computeHemisphericPreLightingInfo(light{X}.vLightData,viewDirectionW,normalW);
16
16
  #elif defined(DIRLIGHT{X})
@@ -105,7 +105,7 @@ info=computeLighting(viewDirectionW,normalW,light{X}.vLightData,diffuse{X}.rgb,l
105
105
  #endif
106
106
  #endif
107
107
  #ifdef PROJECTEDLIGHTTEXTURE{X}
108
- info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},projectionLightTexture{X}Sampler,uniforms.textureProjectionMatrix{X},input.vPositionW);
108
+ info.diffuse*=computeProjectionTextureDiffuseLighting(projectionLightTexture{X},projectionLightTexture{X}Sampler,uniforms.textureProjectionMatrix{X},fragmentInputs.vPositionW);
109
109
  #endif
110
110
  #endif
111
111
  #ifdef SHADOW{X}
@@ -183,19 +183,19 @@ shadowDebug{X}=mix(vec3(nextShadow)*vCascadeColorsMultiplier{X}[index{X}],shadow
183
183
  }
184
184
  #elif defined(SHADOWCLOSEESM{X})
185
185
  #if defined(SHADOWCUBE{X})
186
- shadow=computeShadowWithCloseESMCube(input.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
186
+ shadow=computeShadowWithCloseESMCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
187
187
  #else
188
188
  shadow=computeShadowWithCloseESM(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
189
189
  #endif
190
190
  #elif defined(SHADOWESM{X})
191
191
  #if defined(SHADOWCUBE{X})
192
- shadow=computeShadowWithESMCube(input.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
192
+ shadow=computeShadowWithESMCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.depthValues);
193
193
  #else
194
194
  shadow=computeShadowWithESM(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.z,light{X}.shadowsInfo.w);
195
195
  #endif
196
196
  #elif defined(SHADOWPOISSON{X})
197
197
  #if defined(SHADOWCUBE{X})
198
- shadow=computeShadowWithPoissonSamplingCube(input.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);
198
+ shadow=computeShadowWithPoissonSamplingCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.depthValues);
199
199
  #else
200
200
  shadow=computeShadowWithPoissonSampling(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.y,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
201
201
  #endif
@@ -217,7 +217,7 @@ shadow=computeShadowWithPCSS64(fragmentInputs.vPositionFromLight{X},fragmentInpu
217
217
  #endif
218
218
  #else
219
219
  #if defined(SHADOWCUBE{X})
220
- shadow=computeShadowCube(input.vPositionW,light{X}.vLightData.xyz,shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.depthValues);
220
+ shadow=computeShadowCube(fragmentInputs.vPositionW,light{X}.vLightData.xyz,shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.depthValues);
221
221
  #else
222
222
  shadow=computeShadow(fragmentInputs.vPositionFromLight{X},fragmentInputs.vDepthMetric{X},shadowTexture{X},shadowTexture{X}Sampler,light{X}.shadowsInfo.x,light{X}.shadowsInfo.w);
223
223
  #endif