@babylonjs/core 5.45.2 → 5.46.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 (525) hide show
  1. package/Actions/condition.js +23 -23
  2. package/Actions/condition.js.map +1 -1
  3. package/Animations/animatable.js +48 -48
  4. package/Animations/animatable.js.map +1 -1
  5. package/Animations/animation.js +53 -53
  6. package/Animations/animation.js.map +1 -1
  7. package/Animations/animationGroup.js +53 -53
  8. package/Animations/animationGroup.js.map +1 -1
  9. package/Animations/runtimeAnimation.js +36 -36
  10. package/Animations/runtimeAnimation.js.map +1 -1
  11. package/Audio/audioEngine.js +14 -14
  12. package/Audio/audioEngine.js.map +1 -1
  13. package/Audio/audioSceneComponent.js +14 -14
  14. package/Audio/audioSceneComponent.js.map +1 -1
  15. package/Audio/sound.js +47 -47
  16. package/Audio/sound.js.map +1 -1
  17. package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +1 -1
  18. package/Behaviors/Meshes/fadeInOutBehavior.js +11 -11
  19. package/Behaviors/Meshes/fadeInOutBehavior.js.map +1 -1
  20. package/Behaviors/Meshes/pointerDragBehavior.js +34 -34
  21. package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
  22. package/Bones/bone.js +15 -15
  23. package/Bones/bone.js.map +1 -1
  24. package/Bones/boneIKController.js +9 -9
  25. package/Bones/boneIKController.js.map +1 -1
  26. package/Bones/boneLookController.js +50 -50
  27. package/Bones/boneLookController.js.map +1 -1
  28. package/Bones/skeleton.js +35 -35
  29. package/Bones/skeleton.js.map +1 -1
  30. package/Buffers/buffer.js +14 -14
  31. package/Buffers/buffer.js.map +1 -1
  32. package/Buffers/dataBuffer.js +6 -6
  33. package/Buffers/dataBuffer.js.map +1 -1
  34. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js +42 -42
  35. package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
  36. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +18 -18
  37. package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
  38. package/Cameras/VR/vrExperienceHelper.js +178 -178
  39. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  40. package/Cameras/arcRotateCamera.js +176 -176
  41. package/Cameras/arcRotateCamera.js.map +1 -1
  42. package/Cameras/camera.js +90 -90
  43. package/Cameras/camera.js.map +1 -1
  44. package/Cameras/flyCamera.js +82 -82
  45. package/Cameras/flyCamera.js.map +1 -1
  46. package/Cameras/freeCamera.js +54 -54
  47. package/Cameras/freeCamera.js.map +1 -1
  48. package/Compute/computeShader.js +12 -12
  49. package/Compute/computeShader.js.map +1 -1
  50. package/Culling/ray.d.ts +1 -1
  51. package/Debug/axesViewer.js +12 -12
  52. package/Debug/axesViewer.js.map +1 -1
  53. package/Debug/debugLayer.js +21 -21
  54. package/Debug/debugLayer.js.map +1 -1
  55. package/Debug/directionalLightFrustumViewer.js +20 -20
  56. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  57. package/Debug/rayHelper.js +10 -10
  58. package/Debug/rayHelper.js.map +1 -1
  59. package/Debug/skeletonViewer.js +81 -81
  60. package/Debug/skeletonViewer.js.map +1 -1
  61. package/DeviceInput/InputDevices/deviceSource.d.ts +1 -1
  62. package/DeviceInput/InputDevices/deviceSourceManager.js +31 -31
  63. package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
  64. package/DeviceInput/InputDevices/deviceTypes.d.ts +1 -1
  65. package/DeviceInput/internalDeviceSourceManager.d.ts +2 -2
  66. package/Engines/Extensions/engine.computeShader.d.ts +3 -3
  67. package/Engines/Extensions/engine.multiRender.js +1 -1
  68. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  69. package/Engines/Extensions/engine.query.d.ts +1 -1
  70. package/Engines/Extensions/engine.renderTarget.d.ts +1 -1
  71. package/Engines/Extensions/engine.renderTarget.js +1 -1
  72. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  73. package/Engines/Native/nativeDataStream.d.ts +1 -1
  74. package/Engines/Native/nativeHardwareTexture.js +3 -3
  75. package/Engines/Native/nativeHardwareTexture.js.map +1 -1
  76. package/Engines/Native/nativeInterfaces.d.ts +5 -5
  77. package/Engines/Native/nativePipelineContext.js +7 -7
  78. package/Engines/Native/nativePipelineContext.js.map +1 -1
  79. package/Engines/Native/nativeRenderTargetWrapper.js +6 -6
  80. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  81. package/Engines/Processors/shaderCodeInliner.js +4 -4
  82. package/Engines/Processors/shaderCodeInliner.js.map +1 -1
  83. package/Engines/Processors/shaderProcessingOptions.d.ts +1 -1
  84. package/Engines/WebGL/webGLHardwareTexture.js +3 -3
  85. package/Engines/WebGL/webGLHardwareTexture.js.map +1 -1
  86. package/Engines/WebGPU/webgpuBufferManager.js +3 -3
  87. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  88. package/Engines/WebGPU/webgpuCacheBindGroups.js +6 -6
  89. package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
  90. package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js +5 -5
  91. package/Engines/WebGPU/webgpuCacheRenderPipelineTree.js.map +1 -1
  92. package/Engines/WebGPU/webgpuClearQuad.js +11 -11
  93. package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
  94. package/Engines/WebGPU/webgpuComputeContext.js +7 -7
  95. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  96. package/Engines/WebGPU/webgpuComputePipelineContext.js +4 -4
  97. package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
  98. package/Engines/WebGPU/webgpuDrawContext.js +7 -7
  99. package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
  100. package/Engines/WebGPU/webgpuHardwareTexture.js +9 -9
  101. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  102. package/Engines/WebGPU/webgpuMaterialContext.js +5 -5
  103. package/Engines/WebGPU/webgpuMaterialContext.js.map +1 -1
  104. package/Engines/WebGPU/webgpuOcclusionQuery.js +10 -10
  105. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  106. package/Engines/WebGPU/webgpuPipelineContext.js +6 -6
  107. package/Engines/WebGPU/webgpuPipelineContext.js.map +1 -1
  108. package/Engines/WebGPU/webgpuQuerySet.js +3 -3
  109. package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
  110. package/Engines/WebGPU/webgpuShaderProcessingContext.js +3 -3
  111. package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
  112. package/Engines/WebGPU/webgpuTextureHelper.js +3 -3
  113. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  114. package/Engines/WebGPU/webgpuTimestampQuery.js +3 -3
  115. package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
  116. package/Engines/engine.js +134 -134
  117. package/Engines/engine.js.map +1 -1
  118. package/Engines/nativeEngine.js +6 -6
  119. package/Engines/nativeEngine.js.map +1 -1
  120. package/Engines/nullEngine.js +25 -25
  121. package/Engines/nullEngine.js.map +1 -1
  122. package/Engines/renderTargetWrapper.js +25 -25
  123. package/Engines/renderTargetWrapper.js.map +1 -1
  124. package/Engines/thinEngine.js +243 -243
  125. package/Engines/thinEngine.js.map +1 -1
  126. package/Engines/webgpuEngine.js +132 -132
  127. package/Engines/webgpuEngine.js.map +1 -1
  128. package/Events/keyboardEvents.js +10 -10
  129. package/Events/keyboardEvents.js.map +1 -1
  130. package/Events/pointerEvents.js +9 -9
  131. package/Events/pointerEvents.js.map +1 -1
  132. package/Gamepads/Controllers/poseEnabledController.js +9 -9
  133. package/Gamepads/Controllers/poseEnabledController.js.map +1 -1
  134. package/Gamepads/Controllers/webVRController.js +13 -13
  135. package/Gamepads/Controllers/webVRController.js.map +1 -1
  136. package/Gamepads/gamepad.js +20 -20
  137. package/Gamepads/gamepad.js.map +1 -1
  138. package/Gizmos/axisDragGizmo.js +45 -45
  139. package/Gizmos/axisDragGizmo.js.map +1 -1
  140. package/Gizmos/axisScaleGizmo.js +12 -12
  141. package/Gizmos/axisScaleGizmo.js.map +1 -1
  142. package/Gizmos/boundingBoxGizmo.js +74 -74
  143. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  144. package/Gizmos/gizmo.js +34 -34
  145. package/Gizmos/gizmo.js.map +1 -1
  146. package/Gizmos/gizmoManager.js +40 -40
  147. package/Gizmos/gizmoManager.js.map +1 -1
  148. package/Gizmos/planeDragGizmo.js +23 -23
  149. package/Gizmos/planeDragGizmo.js.map +1 -1
  150. package/Gizmos/planeRotationGizmo.js +12 -12
  151. package/Gizmos/planeRotationGizmo.js.map +1 -1
  152. package/Gizmos/positionGizmo.js +40 -40
  153. package/Gizmos/positionGizmo.js.map +1 -1
  154. package/Gizmos/rotationGizmo.js +47 -47
  155. package/Gizmos/rotationGizmo.js.map +1 -1
  156. package/Gizmos/scaleGizmo.js +41 -41
  157. package/Gizmos/scaleGizmo.js.map +1 -1
  158. package/Helpers/environmentHelper.js +18 -18
  159. package/Helpers/environmentHelper.js.map +1 -1
  160. package/Helpers/textureDome.js +96 -96
  161. package/Helpers/textureDome.js.map +1 -1
  162. package/IAccessibilityTag.d.ts +2 -2
  163. package/Instrumentation/engineInstrumentation.js +21 -21
  164. package/Instrumentation/engineInstrumentation.js.map +1 -1
  165. package/Instrumentation/sceneInstrumentation.js +90 -90
  166. package/Instrumentation/sceneInstrumentation.js.map +1 -1
  167. package/Layers/effectLayer.js +48 -48
  168. package/Layers/effectLayer.js.map +1 -1
  169. package/Layers/glowLayer.js +32 -32
  170. package/Layers/glowLayer.js.map +1 -1
  171. package/Layers/highlightLayer.js +26 -26
  172. package/Layers/highlightLayer.js.map +1 -1
  173. package/Layers/layer.js +40 -40
  174. package/Layers/layer.js.map +1 -1
  175. package/LensFlares/lensFlare.js +15 -15
  176. package/LensFlares/lensFlare.js.map +1 -1
  177. package/LensFlares/lensFlareSystem.js +4 -4
  178. package/LensFlares/lensFlareSystem.js.map +1 -1
  179. package/Lights/Shadows/cascadedShadowGenerator.js +18 -18
  180. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  181. package/Lights/Shadows/shadowGenerator.js +115 -115
  182. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  183. package/Lights/directionalLight.js +31 -31
  184. package/Lights/directionalLight.js.map +1 -1
  185. package/Lights/light.js +72 -72
  186. package/Lights/light.js.map +1 -1
  187. package/Lights/pointLight.js +18 -18
  188. package/Lights/pointLight.js.map +1 -1
  189. package/Lights/spotLight.js +30 -30
  190. package/Lights/spotLight.js.map +1 -1
  191. package/Loading/sceneLoader.d.ts +1 -1
  192. package/Materials/Background/backgroundMaterial.js +124 -124
  193. package/Materials/Background/backgroundMaterial.js.map +1 -1
  194. package/Materials/Node/Blocks/Dual/imageSourceBlock.js +8 -8
  195. package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
  196. package/Materials/Node/Blocks/Dual/lightBlock.js +14 -14
  197. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  198. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +9 -9
  199. package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
  200. package/Materials/Node/Blocks/Dual/textureBlock.js +26 -26
  201. package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
  202. package/Materials/Node/Blocks/Input/inputBlock.js +34 -34
  203. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  204. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +14 -14
  205. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  206. package/Materials/Node/Blocks/PBR/reflectionBlock.js +16 -16
  207. package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
  208. package/Materials/Node/Blocks/customBlock.js +7 -7
  209. package/Materials/Node/Blocks/customBlock.js.map +1 -1
  210. package/Materials/Node/Blocks/gradientBlock.js +13 -13
  211. package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
  212. package/Materials/Node/Blocks/triPlanarBlock.js +30 -30
  213. package/Materials/Node/Blocks/triPlanarBlock.js.map +1 -1
  214. package/Materials/Node/nodeMaterial.d.ts +1 -1
  215. package/Materials/Node/nodeMaterial.js +60 -60
  216. package/Materials/Node/nodeMaterial.js.map +1 -1
  217. package/Materials/Node/nodeMaterialBlock.js +35 -35
  218. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  219. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +50 -50
  220. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  221. package/Materials/PBR/pbrAnisotropicConfiguration.js +5 -5
  222. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  223. package/Materials/PBR/pbrBRDFConfiguration.js +4 -4
  224. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  225. package/Materials/PBR/pbrBaseMaterial.js +52 -52
  226. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  227. package/Materials/PBR/pbrBaseSimpleMaterial.js +17 -17
  228. package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
  229. package/Materials/PBR/pbrClearCoatConfiguration.js +5 -5
  230. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  231. package/Materials/PBR/pbrIridescenceConfiguration.js +5 -5
  232. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  233. package/Materials/PBR/pbrMaterial.js +209 -209
  234. package/Materials/PBR/pbrMaterial.js.map +1 -1
  235. package/Materials/PBR/pbrSheenConfiguration.js +5 -5
  236. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  237. package/Materials/PBR/pbrSpecularGlossinessMaterial.js +6 -6
  238. package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
  239. package/Materials/PBR/pbrSubSurfaceConfiguration.js +51 -51
  240. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  241. package/Materials/Textures/baseTexture.js +99 -99
  242. package/Materials/Textures/baseTexture.js.map +1 -1
  243. package/Materials/Textures/cubeTexture.js +61 -61
  244. package/Materials/Textures/cubeTexture.js.map +1 -1
  245. package/Materials/Textures/externalTexture.js +16 -16
  246. package/Materials/Textures/externalTexture.js.map +1 -1
  247. package/Materials/Textures/hdrCubeTexture.js +44 -44
  248. package/Materials/Textures/hdrCubeTexture.js.map +1 -1
  249. package/Materials/Textures/internalTexture.js +31 -31
  250. package/Materials/Textures/internalTexture.js.map +1 -1
  251. package/Materials/Textures/mirrorTexture.js +73 -73
  252. package/Materials/Textures/mirrorTexture.js.map +1 -1
  253. package/Materials/Textures/multiRenderTarget.js +47 -47
  254. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  255. package/Materials/Textures/rawTexture2DArray.js +6 -6
  256. package/Materials/Textures/rawTexture2DArray.js.map +1 -1
  257. package/Materials/Textures/renderTargetTexture.js +142 -142
  258. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  259. package/Materials/Textures/texture.d.ts +1 -1
  260. package/Materials/Textures/texture.js +26 -26
  261. package/Materials/Textures/texture.js.map +1 -1
  262. package/Materials/Textures/textureCreationOptions.d.ts +1 -1
  263. package/Materials/Textures/textureSampler.js +20 -20
  264. package/Materials/Textures/textureSampler.js.map +1 -1
  265. package/Materials/Textures/thinRenderTargetTexture.js +6 -6
  266. package/Materials/Textures/thinRenderTargetTexture.js.map +1 -1
  267. package/Materials/Textures/thinTexture.js +39 -39
  268. package/Materials/Textures/thinTexture.js.map +1 -1
  269. package/Materials/Textures/videoTexture.js +40 -40
  270. package/Materials/Textures/videoTexture.js.map +1 -1
  271. package/Materials/drawWrapper.js +6 -6
  272. package/Materials/drawWrapper.js.map +1 -1
  273. package/Materials/effect.js +18 -18
  274. package/Materials/effect.js.map +1 -1
  275. package/Materials/effectRenderer.js +9 -9
  276. package/Materials/effectRenderer.js.map +1 -1
  277. package/Materials/fresnelParameters.d.ts +2 -2
  278. package/Materials/fresnelParameters.js +13 -13
  279. package/Materials/fresnelParameters.js.map +1 -1
  280. package/Materials/material.detailMapConfiguration.js +5 -5
  281. package/Materials/material.detailMapConfiguration.js.map +1 -1
  282. package/Materials/material.js +223 -223
  283. package/Materials/material.js.map +1 -1
  284. package/Materials/materialPluginBase.js +5 -5
  285. package/Materials/materialPluginBase.js.map +1 -1
  286. package/Materials/materialPluginEvent.d.ts +14 -14
  287. package/Materials/materialPluginManager.d.ts +1 -1
  288. package/Materials/multiMaterial.js +16 -16
  289. package/Materials/multiMaterial.js.map +1 -1
  290. package/Materials/shadowDepthWrapper.js +14 -14
  291. package/Materials/shadowDepthWrapper.js.map +1 -1
  292. package/Materials/standardMaterial.js +100 -100
  293. package/Materials/standardMaterial.js.map +1 -1
  294. package/Materials/uniformBufferEffectCommonAccessor.js +3 -3
  295. package/Materials/uniformBufferEffectCommonAccessor.js.map +1 -1
  296. package/Maths/math.functions.js +2 -0
  297. package/Maths/math.functions.js.map +1 -1
  298. package/Maths/math.path.js +11 -11
  299. package/Maths/math.path.js.map +1 -1
  300. package/Maths/math.vector.d.ts +6 -7
  301. package/Maths/math.vector.js +48 -48
  302. package/Maths/math.vector.js.map +1 -1
  303. package/Meshes/Builders/goldbergBuilder.d.ts +2 -2
  304. package/Meshes/Compression/dracoCompression.js +23 -23
  305. package/Meshes/Compression/dracoCompression.js.map +1 -1
  306. package/Meshes/Compression/meshoptCompression.js +9 -9
  307. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  308. package/Meshes/abstractMesh.js +179 -179
  309. package/Meshes/abstractMesh.js.map +1 -1
  310. package/Meshes/geometry.js +32 -32
  311. package/Meshes/geometry.js.map +1 -1
  312. package/Meshes/goldbergMesh.d.ts +1 -1
  313. package/Meshes/linesMesh.js +3 -3
  314. package/Meshes/linesMesh.js.map +1 -1
  315. package/Meshes/mesh.js +165 -165
  316. package/Meshes/mesh.js.map +1 -1
  317. package/Meshes/mesh.vertexData.js.map +1 -1
  318. package/Meshes/polygonMesh.js +5 -5
  319. package/Meshes/polygonMesh.js.map +1 -1
  320. package/Meshes/subMesh.js +59 -59
  321. package/Meshes/subMesh.js.map +1 -1
  322. package/Meshes/transformNode.js +52 -52
  323. package/Meshes/transformNode.js.map +1 -1
  324. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.d.ts +1 -1
  325. package/Misc/PerformanceViewer/performanceViewerCollector.js +12 -12
  326. package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
  327. package/Misc/arrayTools.d.ts +1 -1
  328. package/Misc/copyTextureToTexture.js +3 -3
  329. package/Misc/copyTextureToTexture.js.map +1 -1
  330. package/Misc/coroutine.d.ts +5 -5
  331. package/Misc/deferred.js +9 -9
  332. package/Misc/deferred.js.map +1 -1
  333. package/Misc/depthReducer.js +7 -7
  334. package/Misc/depthReducer.js.map +1 -1
  335. package/Misc/environmentTextureTools.d.ts +1 -1
  336. package/Misc/error.d.ts +1 -1
  337. package/Misc/fileTools.d.ts +5 -5
  338. package/Misc/filesInput.js +6 -6
  339. package/Misc/filesInput.js.map +1 -1
  340. package/Misc/khronosTextureContainer2.js +9 -9
  341. package/Misc/khronosTextureContainer2.js.map +1 -1
  342. package/Misc/observable.js +12 -12
  343. package/Misc/observable.js.map +1 -1
  344. package/Misc/perfCounter.js +16 -16
  345. package/Misc/perfCounter.js.map +1 -1
  346. package/Misc/sceneOptimizer.js +76 -76
  347. package/Misc/sceneOptimizer.js.map +1 -1
  348. package/Misc/stringDictionary.d.ts +1 -1
  349. package/Misc/trajectoryClassifier.js +67 -67
  350. package/Misc/trajectoryClassifier.js.map +1 -1
  351. package/Misc/videoRecorder.js +15 -15
  352. package/Misc/videoRecorder.js.map +1 -1
  353. package/Misc/virtualJoystick.js +12 -12
  354. package/Misc/virtualJoystick.js.map +1 -1
  355. package/Morph/morphTarget.js +28 -28
  356. package/Morph/morphTarget.js.map +1 -1
  357. package/Morph/morphTargetManager.js +18 -18
  358. package/Morph/morphTargetManager.js.map +1 -1
  359. package/Offline/database.js +12 -12
  360. package/Offline/database.js.map +1 -1
  361. package/Particles/EmitterTypes/coneParticleEmitter.js +25 -25
  362. package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
  363. package/Particles/EmitterTypes/meshParticleEmitter.js +20 -20
  364. package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
  365. package/Particles/baseParticleSystem.js +232 -232
  366. package/Particles/baseParticleSystem.js.map +1 -1
  367. package/Particles/cloudPoint.js +9 -9
  368. package/Particles/cloudPoint.js.map +1 -1
  369. package/Particles/gpuParticleSystem.js +123 -123
  370. package/Particles/gpuParticleSystem.js.map +1 -1
  371. package/Particles/particleSystem.js +102 -102
  372. package/Particles/particleSystem.js.map +1 -1
  373. package/Particles/pointsCloudSystem.js +18 -18
  374. package/Particles/pointsCloudSystem.js.map +1 -1
  375. package/Particles/solidParticle.js +23 -23
  376. package/Particles/solidParticle.js.map +1 -1
  377. package/Physics/v1/physicsEngine.js +14 -14
  378. package/Physics/v1/physicsEngine.js.map +1 -1
  379. package/Physics/v1/physicsImpostor.js +149 -149
  380. package/Physics/v1/physicsImpostor.js.map +1 -1
  381. package/Physics/v2/physicsEngine.js +14 -14
  382. package/Physics/v2/physicsEngine.js.map +1 -1
  383. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +129 -129
  384. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  385. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +68 -68
  386. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  387. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +6 -6
  388. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  389. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +226 -225
  390. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  391. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +10 -10
  392. package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
  393. package/PostProcesses/anaglyphPostProcess.js +7 -7
  394. package/PostProcesses/anaglyphPostProcess.js.map +1 -1
  395. package/PostProcesses/blackAndWhitePostProcess.js +7 -7
  396. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  397. package/PostProcesses/bloomEffect.js +28 -28
  398. package/PostProcesses/bloomEffect.js.map +1 -1
  399. package/PostProcesses/bloomMergePostProcess.js +7 -7
  400. package/PostProcesses/bloomMergePostProcess.js.map +1 -1
  401. package/PostProcesses/blurPostProcess.js +32 -32
  402. package/PostProcesses/blurPostProcess.js.map +1 -1
  403. package/PostProcesses/chromaticAberrationPostProcess.js +7 -7
  404. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  405. package/PostProcesses/circleOfConfusionPostProcess.js +7 -7
  406. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  407. package/PostProcesses/colorCorrectionPostProcess.js +7 -7
  408. package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
  409. package/PostProcesses/convolutionPostProcess.js +7 -7
  410. package/PostProcesses/convolutionPostProcess.js.map +1 -1
  411. package/PostProcesses/depthOfFieldBlurPostProcess.js +7 -7
  412. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  413. package/PostProcesses/depthOfFieldEffect.js +36 -36
  414. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  415. package/PostProcesses/depthOfFieldMergePostProcess.js +7 -7
  416. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  417. package/PostProcesses/extractHighlightsPostProcess.js +7 -7
  418. package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
  419. package/PostProcesses/filterPostProcess.js +7 -7
  420. package/PostProcesses/filterPostProcess.js.map +1 -1
  421. package/PostProcesses/grainPostProcess.js +7 -7
  422. package/PostProcesses/grainPostProcess.js.map +1 -1
  423. package/PostProcesses/imageProcessingPostProcess.js +42 -42
  424. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  425. package/PostProcesses/motionBlurPostProcess.js +41 -41
  426. package/PostProcesses/motionBlurPostProcess.js.map +1 -1
  427. package/PostProcesses/passPostProcess.js +15 -15
  428. package/PostProcesses/passPostProcess.js.map +1 -1
  429. package/PostProcesses/postProcess.d.ts +2 -2
  430. package/PostProcesses/postProcess.js +123 -123
  431. package/PostProcesses/postProcess.js.map +1 -1
  432. package/PostProcesses/refractionPostProcess.js +21 -21
  433. package/PostProcesses/refractionPostProcess.js.map +1 -1
  434. package/PostProcesses/screenSpaceCurvaturePostProcess.js +7 -7
  435. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  436. package/PostProcesses/screenSpaceReflectionPostProcess.js +19 -19
  437. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  438. package/PostProcesses/sharpenPostProcess.js +7 -7
  439. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  440. package/PostProcesses/stereoscopicInterlacePostProcess.js +14 -14
  441. package/PostProcesses/stereoscopicInterlacePostProcess.js.map +1 -1
  442. package/PostProcesses/tonemapPostProcess.js +7 -7
  443. package/PostProcesses/tonemapPostProcess.js.map +1 -1
  444. package/PostProcesses/volumetricLightScatteringPostProcess.js +11 -11
  445. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  446. package/PostProcesses/vrDistortionCorrectionPostProcess.js +7 -7
  447. package/PostProcesses/vrDistortionCorrectionPostProcess.js.map +1 -1
  448. package/Rendering/depthPeelingRenderer.js +36 -36
  449. package/Rendering/depthPeelingRenderer.js.map +1 -1
  450. package/Rendering/depthRenderer.js +8 -8
  451. package/Rendering/depthRenderer.js.map +1 -1
  452. package/Rendering/edgesRenderer.js +34 -34
  453. package/Rendering/edgesRenderer.js.map +1 -1
  454. package/Rendering/fluidRenderer/fluidRenderer.js +8 -8
  455. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
  456. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js +3 -3
  457. package/Rendering/fluidRenderer/fluidRenderingDepthTextureCopy.js.map +1 -1
  458. package/Rendering/fluidRenderer/fluidRenderingObject.js +19 -19
  459. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  460. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +12 -12
  461. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
  462. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +18 -18
  463. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  464. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +68 -68
  465. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  466. package/Rendering/fluidRenderer/fluidRenderingTextures.js +29 -29
  467. package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
  468. package/Rendering/geometryBufferRenderer.js +44 -44
  469. package/Rendering/geometryBufferRenderer.js.map +1 -1
  470. package/Rendering/prePassRenderer.js +51 -51
  471. package/Rendering/prePassRenderer.js.map +1 -1
  472. package/Rendering/renderingGroup.js +25 -25
  473. package/Rendering/renderingGroup.js.map +1 -1
  474. package/Rendering/renderingManager.js +21 -21
  475. package/Rendering/renderingManager.js.map +1 -1
  476. package/Rendering/subSurfaceConfiguration.js +18 -18
  477. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  478. package/Rendering/utilityLayerRenderer.js +76 -76
  479. package/Rendering/utilityLayerRenderer.js.map +1 -1
  480. package/Sprites/sprite.js +16 -16
  481. package/Sprites/sprite.js.map +1 -1
  482. package/Sprites/spriteManager.js +81 -81
  483. package/Sprites/spriteManager.js.map +1 -1
  484. package/Sprites/spriteMap.js +32 -32
  485. package/Sprites/spriteMap.js.map +1 -1
  486. package/Sprites/spriteRenderer.js +6 -6
  487. package/Sprites/spriteRenderer.js.map +1 -1
  488. package/Sprites/thinSprite.js +22 -22
  489. package/Sprites/thinSprite.js.map +1 -1
  490. package/States/stencilStateComposer.js +10 -10
  491. package/States/stencilStateComposer.js.map +1 -1
  492. package/XR/features/WebXRAnchorSystem.js +7 -7
  493. package/XR/features/WebXRAnchorSystem.js.map +1 -1
  494. package/XR/features/WebXRControllerMovement.d.ts +3 -3
  495. package/XR/features/WebXRControllerMovement.js +97 -97
  496. package/XR/features/WebXRControllerMovement.js.map +1 -1
  497. package/XR/features/WebXRControllerPhysics.js +24 -24
  498. package/XR/features/WebXRControllerPhysics.js.map +1 -1
  499. package/XR/features/WebXRControllerTeleportation.js +26 -26
  500. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  501. package/XR/features/WebXRDOMOverlay.d.ts +1 -1
  502. package/XR/features/WebXRFeaturePointSystem.js +6 -6
  503. package/XR/features/WebXRFeaturePointSystem.js.map +1 -1
  504. package/XR/features/WebXRHandTracking.d.ts +1 -1
  505. package/XR/features/WebXRHandTracking.js +95 -95
  506. package/XR/features/WebXRHandTracking.js.map +1 -1
  507. package/XR/features/WebXRWalkingLocomotion.js +21 -21
  508. package/XR/features/WebXRWalkingLocomotion.js.map +1 -1
  509. package/XR/motionController/webXRAbstractMotionController.d.ts +3 -3
  510. package/XR/motionController/webXRMotionControllerManager.d.ts +1 -1
  511. package/XR/native/nativeXRFrame.js +3 -3
  512. package/XR/native/nativeXRFrame.js.map +1 -1
  513. package/XR/webXRFeaturesManager.d.ts +1 -1
  514. package/XR/webXRLayerWrapper.d.ts +2 -2
  515. package/XR/webXRLayerWrapper.js +17 -17
  516. package/XR/webXRLayerWrapper.js.map +1 -1
  517. package/abstractScene.d.ts +2 -2
  518. package/node.d.ts +1 -1
  519. package/node.js +71 -71
  520. package/node.js.map +1 -1
  521. package/package.json +1 -1
  522. package/scene.js +777 -777
  523. package/scene.js.map +1 -1
  524. package/sceneComponent.d.ts +12 -12
  525. package/types.d.ts +11 -11
@@ -20,6 +20,13 @@ import { SerializationHelper, serialize } from "../Misc/decorators.js";
20
20
  *
21
21
  */
22
22
  export class ColorCorrectionPostProcess extends PostProcess {
23
+ /**
24
+ * Gets a string identifying the name of the class
25
+ * @returns "ColorCorrectionPostProcess" string
26
+ */
27
+ getClassName() {
28
+ return "ColorCorrectionPostProcess";
29
+ }
23
30
  constructor(name, colorTableUrl, options, camera, samplingMode, engine, reusable) {
24
31
  super(name, "colorCorrection", null, ["colorTable"], options, camera, samplingMode, engine, reusable);
25
32
  const scene = (camera === null || camera === void 0 ? void 0 : camera.getScene()) || null;
@@ -32,13 +39,6 @@ export class ColorCorrectionPostProcess extends PostProcess {
32
39
  effect.setTexture("colorTable", this._colorTableTexture);
33
40
  };
34
41
  }
35
- /**
36
- * Gets a string identifying the name of the class
37
- * @returns "ColorCorrectionPostProcess" string
38
- */
39
- getClassName() {
40
- return "ColorCorrectionPostProcess";
41
- }
42
42
  /**
43
43
  * @internal
44
44
  */
@@ -1 +1 @@
1
- {"version":3,"file":"colorCorrectionPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/colorCorrectionPostProcess.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAIxD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKpE;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,0BAA2B,SAAQ,WAAW;IAiBvD,YAAY,IAAY,EAAE,aAAqB,EAAE,OAAoC,EAAE,MAAwB,EAAE,YAAqB,EAAE,MAAe,EAAE,QAAkB;QACvK,KAAK,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAEtG,MAAM,KAAK,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,C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{ Effect } from \"../Materials/effect\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\n\r\nimport \"../Shaders/colorCorrection.fragment\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { SerializationHelper, serialize } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\n\r\ndeclare type Scene = import(\"../scene\").Scene;\r\n\r\n/**\r\n *\r\n * This post-process allows the modification of rendered colors by using\r\n * a 'look-up table' (LUT). This effect is also called Color Grading.\r\n *\r\n * The object needs to be provided an url to a texture containing the color\r\n * look-up table: the texture must be 256 pixels wide and 16 pixels high.\r\n * Use an image editing software to tweak the LUT to match your needs.\r\n *\r\n * For an example of a color LUT, see here:\r\n * @see http://udn.epicgames.com/Three/rsrc/Three/ColorGrading/RGBTable16x1.png\r\n * For explanations on color grading, see here:\r\n * @see http://udn.epicgames.com/Three/ColorGrading.html\r\n *\r\n */\r\nexport class ColorCorrectionPostProcess extends PostProcess {\r\n private _colorTableTexture: Texture;\r\n\r\n /**\r\n * Gets the color table url used to create the LUT texture\r\n */\r\n @serialize()\r\n public colorTableUrl: string;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"ColorCorrectionPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"ColorCorrectionPostProcess\";\r\n }\r\n\r\n constructor(name: string, colorTableUrl: string, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean) {\r\n super(name, \"colorCorrection\", null, [\"colorTable\"], options, camera, samplingMode, engine, reusable);\r\n\r\n const scene = camera?.getScene() || null;\r\n this._colorTableTexture = new Texture(colorTableUrl, scene, true, false, Texture.TRILINEAR_SAMPLINGMODE);\r\n this._colorTableTexture.anisotropicFilteringLevel = 1;\r\n this._colorTableTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._colorTableTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n\r\n this.colorTableUrl = colorTableUrl;\r\n\r\n this.onApply = (effect: Effect) => {\r\n effect.setTexture(\"colorTable\", this._colorTableTexture);\r\n };\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<ColorCorrectionPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new ColorCorrectionPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.colorTableUrl,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ColorCorrectionPostProcess\", ColorCorrectionPostProcess);\r\n"]}
1
+ {"version":3,"file":"colorCorrectionPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/colorCorrectionPostProcess.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAIxD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKpE;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,0BAA2B,SAAQ,WAAW;IASvD;;;OAGG;IACI,YAAY;QACf,OAAO,4BAA4B,CAAC;IACxC,CAAC;IAED,YAAY,IAAY,EAAE,aAAqB,EAAE,OAAoC,EAAE,MAAwB,EAAE,YAAqB,EAAE,MAAe,EAAE,QAAkB;QACvK,KAAK,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,MAAM,EA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./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\n\r\nimport \"../Shaders/colorCorrection.fragment\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { SerializationHelper, serialize } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\n\r\ndeclare type Scene = import(\"../scene\").Scene;\r\n\r\n/**\r\n *\r\n * This post-process allows the modification of rendered colors by using\r\n * a 'look-up table' (LUT). This effect is also called Color Grading.\r\n *\r\n * The object needs to be provided an url to a texture containing the color\r\n * look-up table: the texture must be 256 pixels wide and 16 pixels high.\r\n * Use an image editing software to tweak the LUT to match your needs.\r\n *\r\n * For an example of a color LUT, see here:\r\n * @see http://udn.epicgames.com/Three/rsrc/Three/ColorGrading/RGBTable16x1.png\r\n * For explanations on color grading, see here:\r\n * @see http://udn.epicgames.com/Three/ColorGrading.html\r\n *\r\n */\r\nexport class ColorCorrectionPostProcess extends PostProcess {\r\n private _colorTableTexture: Texture;\r\n\r\n /**\r\n * Gets the color table url used to create the LUT texture\r\n */\r\n @serialize()\r\n public colorTableUrl: string;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"ColorCorrectionPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"ColorCorrectionPostProcess\";\r\n }\r\n\r\n constructor(name: string, colorTableUrl: string, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean) {\r\n super(name, \"colorCorrection\", null, [\"colorTable\"], options, camera, samplingMode, engine, reusable);\r\n\r\n const scene = camera?.getScene() || null;\r\n this._colorTableTexture = new Texture(colorTableUrl, scene, true, false, Texture.TRILINEAR_SAMPLINGMODE);\r\n this._colorTableTexture.anisotropicFilteringLevel = 1;\r\n this._colorTableTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._colorTableTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n\r\n this.colorTableUrl = colorTableUrl;\r\n\r\n this.onApply = (effect: Effect) => {\r\n effect.setTexture(\"colorTable\", this._colorTableTexture);\r\n };\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<ColorCorrectionPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new ColorCorrectionPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.colorTableUrl,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ColorCorrectionPostProcess\", ColorCorrectionPostProcess);\r\n"]}
@@ -10,6 +10,13 @@ import { serialize, SerializationHelper } from "../Misc/decorators.js";
10
10
  * See http://en.wikipedia.org/wiki/Kernel_(image_processing)
11
11
  */
12
12
  export class ConvolutionPostProcess extends PostProcess {
13
+ /**
14
+ * Gets a string identifying the name of the class
15
+ * @returns "ConvolutionPostProcess" string
16
+ */
17
+ getClassName() {
18
+ return "ConvolutionPostProcess";
19
+ }
13
20
  /**
14
21
  * Creates a new instance ConvolutionPostProcess
15
22
  * @param name The name of the effect.
@@ -29,13 +36,6 @@ export class ConvolutionPostProcess extends PostProcess {
29
36
  effect.setArray("kernel", this.kernel);
30
37
  };
31
38
  }
32
- /**
33
- * Gets a string identifying the name of the class
34
- * @returns "ConvolutionPostProcess" string
35
- */
36
- getClassName() {
37
- return "ConvolutionPostProcess";
38
- }
39
39
  /**
40
40
  * @internal
41
41
  */
@@ -1 +1 @@
1
- {"version":3,"file":"convolutionPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/convolutionPostProcess.ts"],"names":[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AAC,EAAE,CAAC,CAAC,CAAC;AAtF3D;IADC,SAAS,EAAE;sDACY;AAyF5B,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport \"../Shaders/convolution.fragment\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serialize, SerializationHelper } from \"../Misc/decorators\";\r\n\r\ndeclare type Scene = import(\"../scene\").Scene;\r\n\r\n/**\r\n * The ConvolutionPostProcess applies a 3x3 kernel to every pixel of the\r\n * input texture to perform effects such as edge detection or sharpening\r\n * See http://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\nexport class ConvolutionPostProcess extends PostProcess {\r\n /** Array of 9 values corresponding to the 3x3 kernel to be applied */\r\n @serialize()\r\n public kernel: number[];\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"ConvolutionPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"ConvolutionPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance ConvolutionPostProcess\r\n * @param name The name of the effect.\r\n * @param kernel Array of 9 values corresponding to the 3x3 kernel to be applied\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n */\r\n constructor(\r\n name: string,\r\n kernel: number[],\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n ) {\r\n super(name, \"convolution\", [\"kernel\", \"screenSize\"], null, options, camera, samplingMode, engine, reusable, null, textureType);\r\n this.kernel = kernel;\r\n this.onApply = (effect: Effect) => {\r\n effect.setFloat2(\"screenSize\", this.width, this.height);\r\n effect.setArray(\"kernel\", this.kernel);\r\n };\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<ConvolutionPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new ConvolutionPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.kernel,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.textureType\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n\r\n // Statics\r\n /**\r\n * Edge detection 0 see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1];\r\n /**\r\n * Edge detection 1 see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0];\r\n /**\r\n * Edge detection 2 see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1];\r\n /**\r\n * Kernel to sharpen an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0];\r\n /**\r\n * Kernel to emboss an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2];\r\n /**\r\n * Kernel to blur an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0];\r\n}\r\n\r\nRegisterClass(\"BABYLON.ConvolutionPostProcess\", ConvolutionPostProcess);\r\n"]}
1
+ {"version":3,"file":"convolutionPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/convolutionPostProcess.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAK5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIpE;;;;GAIG;AACH,MAAM,OAAO,sBAAuB,SAAQ,WAAW;IAKnD;;;OAGG;IACI,YAAY;QACf,OAAO,wBAAwB,CAAC;IACpC,CAAC;IAED;;;;;;;;;;OAUG;IACH,YACI,IAAY,EACZ,MAAgB,EAChB,OAAoC,EACpC,MAAwB,EACxB,YAAqB,EACrB,MAAe,EACf,QAAkB,EAClB,cAAsB,SAAS,CAAC,wBAAwB;QAExD,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC;QAC/H,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,CAAC,MAAc,EAAE,EAAE;YAC9B,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACxD,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC,CA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AAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5D;;GAEG;AACW,qCAAc,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAtF3D;IADC,SAAS,EAAE;sDACY;AAyF5B,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport \"../Shaders/convolution.fragment\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serialize, SerializationHelper } from \"../Misc/decorators\";\r\n\r\ndeclare type Scene = import(\"../scene\").Scene;\r\n\r\n/**\r\n * The ConvolutionPostProcess applies a 3x3 kernel to every pixel of the\r\n * input texture to perform effects such as edge detection or sharpening\r\n * See http://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\nexport class ConvolutionPostProcess extends PostProcess {\r\n /** Array of 9 values corresponding to the 3x3 kernel to be applied */\r\n @serialize()\r\n public kernel: number[];\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"ConvolutionPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"ConvolutionPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance ConvolutionPostProcess\r\n * @param name The name of the effect.\r\n * @param kernel Array of 9 values corresponding to the 3x3 kernel to be applied\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n */\r\n constructor(\r\n name: string,\r\n kernel: number[],\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT\r\n ) {\r\n super(name, \"convolution\", [\"kernel\", \"screenSize\"], null, options, camera, samplingMode, engine, reusable, null, textureType);\r\n this.kernel = kernel;\r\n this.onApply = (effect: Effect) => {\r\n effect.setFloat2(\"screenSize\", this.width, this.height);\r\n effect.setArray(\"kernel\", this.kernel);\r\n };\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<ConvolutionPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new ConvolutionPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.kernel,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.textureType\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n\r\n // Statics\r\n /**\r\n * Edge detection 0 see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static EdgeDetect0Kernel = [1, 0, -1, 0, 0, 0, -1, 0, 1];\r\n /**\r\n * Edge detection 1 see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static EdgeDetect1Kernel = [0, 1, 0, 1, -4, 1, 0, 1, 0];\r\n /**\r\n * Edge detection 2 see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static EdgeDetect2Kernel = [-1, -1, -1, -1, 8, -1, -1, -1, -1];\r\n /**\r\n * Kernel to sharpen an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static SharpenKernel = [0, -1, 0, -1, 5, -1, 0, -1, 0];\r\n /**\r\n * Kernel to emboss an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static EmbossKernel = [-2, -1, 0, -1, 1, 1, 0, 1, 2];\r\n /**\r\n * Kernel to blur an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\n public static GaussianKernel = [0, 1, 0, 1, 1, 1, 0, 1, 0];\r\n}\r\n\r\nRegisterClass(\"BABYLON.ConvolutionPostProcess\", ConvolutionPostProcess);\r\n"]}
@@ -11,6 +11,13 @@ import { serialize } from "../Misc/decorators.js";
11
11
  * See section 2.6.2 http://fileadmin.cs.lth.se/cs/education/edan35/lectures/12dof.pdf
12
12
  */
13
13
  export class DepthOfFieldBlurPostProcess extends BlurPostProcess {
14
+ /**
15
+ * Gets a string identifying the name of the class
16
+ * @returns "DepthOfFieldBlurPostProcess" string
17
+ */
18
+ getClassName() {
19
+ return "DepthOfFieldBlurPostProcess";
20
+ }
14
21
  /**
15
22
  * Creates a new instance DepthOfFieldBlurPostProcess
16
23
  * @param name The name of the effect.
@@ -41,13 +48,6 @@ export class DepthOfFieldBlurPostProcess extends BlurPostProcess {
41
48
  effect.setTextureFromPostProcessOutput("circleOfConfusionSampler", circleOfConfusion);
42
49
  });
43
50
  }
44
- /**
45
- * Gets a string identifying the name of the class
46
- * @returns "DepthOfFieldBlurPostProcess" string
47
- */
48
- getClassName() {
49
- return "DepthOfFieldBlurPostProcess";
50
- }
51
51
  }
52
52
  __decorate([
53
53
  serialize()
@@ -1 +1 @@
1
- {"version":3,"file":"depthOfFieldBlurPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/depthOfFieldBlurPostProcess.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,mB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ACc;AAuE9B,aAAa,CAAC,qCAAqC,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Vector2 } from \"../Maths/math.vector\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport type { PostProcess, PostProcessOptions } from \"./postProcess\";\r\nimport { BlurPostProcess } from \"./blurPostProcess\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serialize } from \"../Misc/decorators\";\r\n\r\n/**\r\n * The DepthOfFieldBlurPostProcess applied a blur in a give direction.\r\n * This blur differs from the standard BlurPostProcess as it attempts to avoid blurring pixels\r\n * based on samples that have a large difference in distance than the center pixel.\r\n * See section 2.6.2 http://fileadmin.cs.lth.se/cs/education/edan35/lectures/12dof.pdf\r\n */\r\nexport class DepthOfFieldBlurPostProcess extends BlurPostProcess {\r\n /**\r\n * The direction the blur should be applied\r\n */\r\n @serialize()\r\n public direction: Vector2;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"DepthOfFieldBlurPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"DepthOfFieldBlurPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance DepthOfFieldBlurPostProcess\r\n * @param name The name of the effect.\r\n * @param scene The scene the effect belongs to.\r\n * @param direction The direction the blur should be applied.\r\n * @param kernel The size of the kernel used to blur.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param circleOfConfusion The circle of confusion + depth map to be used to avoid blurring across edges\r\n * @param imageToBlur The image to apply the blur to (default: Current rendered frame)\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)\r\n */\r\n constructor(\r\n name: string,\r\n scene: Scene,\r\n direction: Vector2,\r\n kernel: number,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n circleOfConfusion: PostProcess,\r\n imageToBlur: Nullable<PostProcess> = null,\r\n samplingMode = Texture.BILINEAR_SAMPLINGMODE,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n blockCompilation = false,\r\n textureFormat = Constants.TEXTUREFORMAT_RGBA\r\n ) {\r\n super(\r\n name,\r\n direction,\r\n kernel,\r\n options,\r\n camera,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n (samplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE),\r\n engine,\r\n reusable,\r\n textureType,\r\n `#define DOF 1\\r\\n`,\r\n blockCompilation,\r\n textureFormat\r\n );\r\n\r\n this.direction = direction;\r\n this.externalTextureSamplerBinding = !!imageToBlur;\r\n\r\n this.onApplyObservable.add((effect: Effect) => {\r\n if (imageToBlur != null) {\r\n effect.setTextureFromPostProcess(\"textureSampler\", imageToBlur);\r\n }\r\n effect.setTextureFromPostProcessOutput(\"circleOfConfusionSampler\", circleOfConfusion);\r\n });\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.DepthOfFieldBlurPostProcess\", DepthOfFieldBlurPostProcess);\r\n"]}
1
+ {"version":3,"file":"depthOfFieldBlurPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/depthOfFieldBlurPostProcess.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC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Aa,CAAC,qCAAqC,EAAE,2BAA2B,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Vector2 } from \"../Maths/math.vector\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport type { PostProcess, PostProcessOptions } from \"./postProcess\";\r\nimport { BlurPostProcess } from \"./blurPostProcess\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serialize } from \"../Misc/decorators\";\r\n\r\n/**\r\n * The DepthOfFieldBlurPostProcess applied a blur in a give direction.\r\n * This blur differs from the standard BlurPostProcess as it attempts to avoid blurring pixels\r\n * based on samples that have a large difference in distance than the center pixel.\r\n * See section 2.6.2 http://fileadmin.cs.lth.se/cs/education/edan35/lectures/12dof.pdf\r\n */\r\nexport class DepthOfFieldBlurPostProcess extends BlurPostProcess {\r\n /**\r\n * The direction the blur should be applied\r\n */\r\n @serialize()\r\n public direction: Vector2;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"DepthOfFieldBlurPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"DepthOfFieldBlurPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance DepthOfFieldBlurPostProcess\r\n * @param name The name of the effect.\r\n * @param scene The scene the effect belongs to.\r\n * @param direction The direction the blur should be applied.\r\n * @param kernel The size of the kernel used to blur.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param circleOfConfusion The circle of confusion + depth map to be used to avoid blurring across edges\r\n * @param imageToBlur The image to apply the blur to (default: Current rendered frame)\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)\r\n */\r\n constructor(\r\n name: string,\r\n scene: Scene,\r\n direction: Vector2,\r\n kernel: number,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n circleOfConfusion: PostProcess,\r\n imageToBlur: Nullable<PostProcess> = null,\r\n samplingMode = Texture.BILINEAR_SAMPLINGMODE,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n blockCompilation = false,\r\n textureFormat = Constants.TEXTUREFORMAT_RGBA\r\n ) {\r\n super(\r\n name,\r\n direction,\r\n kernel,\r\n options,\r\n camera,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n (samplingMode = Constants.TEXTURE_BILINEAR_SAMPLINGMODE),\r\n engine,\r\n reusable,\r\n textureType,\r\n `#define DOF 1\\r\\n`,\r\n blockCompilation,\r\n textureFormat\r\n );\r\n\r\n this.direction = direction;\r\n this.externalTextureSamplerBinding = !!imageToBlur;\r\n\r\n this.onApplyObservable.add((effect: Effect) => {\r\n if (imageToBlur != null) {\r\n effect.setTextureFromPostProcess(\"textureSampler\", imageToBlur);\r\n }\r\n effect.setTextureFromPostProcessOutput(\"circleOfConfusionSampler\", circleOfConfusion);\r\n });\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.DepthOfFieldBlurPostProcess\", DepthOfFieldBlurPostProcess);\r\n"]}
@@ -27,6 +27,42 @@ export var DepthOfFieldEffectBlurLevel;
27
27
  * The depth of field effect applies a blur to objects that are closer or further from where the camera is focusing.
28
28
  */
29
29
  export class DepthOfFieldEffect extends PostProcessRenderEffect {
30
+ /**
31
+ * The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter)
32
+ */
33
+ set focalLength(value) {
34
+ this._circleOfConfusion.focalLength = value;
35
+ }
36
+ get focalLength() {
37
+ return this._circleOfConfusion.focalLength;
38
+ }
39
+ /**
40
+ * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)
41
+ */
42
+ set fStop(value) {
43
+ this._circleOfConfusion.fStop = value;
44
+ }
45
+ get fStop() {
46
+ return this._circleOfConfusion.fStop;
47
+ }
48
+ /**
49
+ * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)
50
+ */
51
+ set focusDistance(value) {
52
+ this._circleOfConfusion.focusDistance = value;
53
+ }
54
+ get focusDistance() {
55
+ return this._circleOfConfusion.focusDistance;
56
+ }
57
+ /**
58
+ * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.
59
+ */
60
+ set lensSize(value) {
61
+ this._circleOfConfusion.lensSize = value;
62
+ }
63
+ get lensSize() {
64
+ return this._circleOfConfusion.lensSize;
65
+ }
30
66
  /**
31
67
  * Creates a new instance DepthOfFieldEffect
32
68
  * @param scene The scene the effect belongs to.
@@ -95,42 +131,6 @@ export class DepthOfFieldEffect extends PostProcessRenderEffect {
95
131
  this._dofMerge.autoClear = false;
96
132
  this._effects.push(this._dofMerge);
97
133
  }
98
- /**
99
- * The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter)
100
- */
101
- set focalLength(value) {
102
- this._circleOfConfusion.focalLength = value;
103
- }
104
- get focalLength() {
105
- return this._circleOfConfusion.focalLength;
106
- }
107
- /**
108
- * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)
109
- */
110
- set fStop(value) {
111
- this._circleOfConfusion.fStop = value;
112
- }
113
- get fStop() {
114
- return this._circleOfConfusion.fStop;
115
- }
116
- /**
117
- * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)
118
- */
119
- set focusDistance(value) {
120
- this._circleOfConfusion.focusDistance = value;
121
- }
122
- get focusDistance() {
123
- return this._circleOfConfusion.focusDistance;
124
- }
125
- /**
126
- * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.
127
- */
128
- set lensSize(value) {
129
- this._circleOfConfusion.lensSize = value;
130
- }
131
- get lensSize() {
132
- return this._circleOfConfusion.lensSize;
133
- }
134
134
  /**
135
135
  * Get the current class name of the current effect
136
136
  * @returns "DepthOfFieldEffect"
@@ -1 +1 @@
1
- {"version":3,"file":"depthOfFieldEffect.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/depthOfFieldEffect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAGxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAN,IAAY,2BAaX;AAbD,WAAY,2BAA2B;IACnC;;OAEG;IACH,2EAAG,CAAA;IACH;;OAEG;IACH,iFAAM,CAAA;IACN;;OAEG;IACH,6EAAI,CAAA;AACR,CAAC,EAbW,2BAA2B,KAA3B,2BAA2B,QAatC;AACD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,uBAAuB;IAmD3D;;;;;;;OAOG;IACH,YACI,KAAY,EACZ,YAA2C,EAC3C,YAAyC,2BAA2B,CAAC,GAAG,EACxE,mBAAmB,GAAG,CAAC,EACvB,gBAAgB,GAAG,KAAK;QAExB,KAAK,CACD,KAAK,CAAC,SAAS,EAAE,EACjB,gBAAgB,EAChB,GAAG,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 } from \"../Maths/math.vector\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport type { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { PostProcess } from \"./postProcess\";\r\nimport { PostProcessRenderEffect } from \"../PostProcesses/RenderPipeline/postProcessRenderEffect\";\r\nimport { CircleOfConfusionPostProcess } from \"./circleOfConfusionPostProcess\";\r\nimport { DepthOfFieldBlurPostProcess } from \"./depthOfFieldBlurPostProcess\";\r\nimport { DepthOfFieldMergePostProcess } from \"./depthOfFieldMergePostProcess\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\n/**\r\n * Specifies the level of max blur that should be applied when using the depth of field effect\r\n */\r\nexport enum DepthOfFieldEffectBlurLevel {\r\n /**\r\n * Subtle blur\r\n */\r\n Low,\r\n /**\r\n * Medium blur\r\n */\r\n Medium,\r\n /**\r\n * Large blur\r\n */\r\n High,\r\n}\r\n/**\r\n * The depth of field effect applies a blur to objects that are closer or further from where the camera is focusing.\r\n */\r\nexport class DepthOfFieldEffect extends PostProcessRenderEffect {\r\n private _circleOfConfusion: CircleOfConfusionPostProcess;\r\n /**\r\n * @internal Internal, blurs from high to low\r\n */\r\n public _depthOfFieldBlurX: Array<DepthOfFieldBlurPostProcess>;\r\n private _depthOfFieldBlurY: Array<DepthOfFieldBlurPostProcess>;\r\n private _dofMerge: Nullable<DepthOfFieldMergePostProcess>;\r\n\r\n /**\r\n * @internal Internal post processes in depth of field effect\r\n */\r\n public _effects: Array<PostProcess> = [];\r\n\r\n /**\r\n * The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter)\r\n */\r\n public set focalLength(value: number) {\r\n this._circleOfConfusion.focalLength = value;\r\n }\r\n public get focalLength() {\r\n return this._circleOfConfusion.focalLength;\r\n }\r\n /**\r\n * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)\r\n */\r\n public set fStop(value: number) {\r\n this._circleOfConfusion.fStop = value;\r\n }\r\n public get fStop() {\r\n return this._circleOfConfusion.fStop;\r\n }\r\n /**\r\n * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)\r\n */\r\n public set focusDistance(value: number) {\r\n this._circleOfConfusion.focusDistance = value;\r\n }\r\n public get focusDistance() {\r\n return this._circleOfConfusion.focusDistance;\r\n }\r\n /**\r\n * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.\r\n */\r\n public set lensSize(value: number) {\r\n this._circleOfConfusion.lensSize = value;\r\n }\r\n public get lensSize() {\r\n return this._circleOfConfusion.lensSize;\r\n }\r\n\r\n /**\r\n * Creates a new instance DepthOfFieldEffect\r\n * @param scene The scene the effect belongs to.\r\n * @param depthTexture The depth texture of the scene to compute the circle of confusion.This must be set in order for this to function but may be set after initialization if needed.\r\n * @param blurLevel\r\n * @param pipelineTextureType The type of texture to be used when performing the post processing.\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n scene: Scene,\r\n depthTexture: Nullable<RenderTargetTexture>,\r\n blurLevel: DepthOfFieldEffectBlurLevel = DepthOfFieldEffectBlurLevel.Low,\r\n pipelineTextureType = 0,\r\n blockCompilation = false\r\n ) {\r\n super(\r\n scene.getEngine(),\r\n \"depth of field\",\r\n () => {\r\n return this._effects;\r\n },\r\n true\r\n );\r\n\r\n // Use R-only formats if supported to store the circle of confusion values.\r\n // This should be more space and bandwidth efficient than using RGBA.\r\n const engine = scene.getEngine();\r\n const circleOfConfusionTextureFormat = engine.isWebGPU || engine.webGLVersion > 1 ? Constants.TEXTUREFORMAT_RED : Constants.TEXTUREFORMAT_RGBA;\r\n\r\n // Circle of confusion value for each pixel is used to determine how much to blur that pixel\r\n this._circleOfConfusion = new CircleOfConfusionPostProcess(\r\n \"circleOfConfusion\",\r\n depthTexture,\r\n 1,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n engine,\r\n false,\r\n pipelineTextureType,\r\n blockCompilation\r\n );\r\n\r\n // Create a pyramid of blurred images (eg. fullSize 1/4 blur, half size 1/2 blur, quarter size 3/4 blur, eith size 4/4 blur)\r\n // Blur the image but do not blur on sharp far to near distance changes to avoid bleeding artifacts\r\n // See section 2.6.2 http://fileadmin.cs.lth.se/cs/education/edan35/lectures/12dof.pdf\r\n this._depthOfFieldBlurY = [];\r\n this._depthOfFieldBlurX = [];\r\n let blurCount = 1;\r\n let kernelSize = 15;\r\n switch (blurLevel) {\r\n case DepthOfFieldEffectBlurLevel.High: {\r\n blurCount = 3;\r\n kernelSize = 51;\r\n break;\r\n }\r\n case DepthOfFieldEffectBlurLevel.Medium: {\r\n blurCount = 2;\r\n kernelSize = 31;\r\n break;\r\n }\r\n default: {\r\n kernelSize = 15;\r\n blurCount = 1;\r\n break;\r\n }\r\n }\r\n const adjustedKernelSize = kernelSize / Math.pow(2, blurCount - 1);\r\n let ratio = 1.0;\r\n for (let i = 0; i < blurCount; i++) {\r\n const blurY = new DepthOfFieldBlurPostProcess(\r\n \"vertical blur\",\r\n scene,\r\n new Vector2(0, 1.0),\r\n adjustedKernelSize,\r\n ratio,\r\n null,\r\n this._circleOfConfusion,\r\n i == 0 ? this._circleOfConfusion : null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n engine,\r\n false,\r\n pipelineTextureType,\r\n blockCompilation,\r\n i == 0 ? circleOfConfusionTextureFormat : Constants.TEXTUREFORMAT_RGBA\r\n );\r\n blurY.autoClear = false;\r\n ratio = 0.75 / Math.pow(2, i);\r\n const blurX = new DepthOfFieldBlurPostProcess(\r\n \"horizontal blur\",\r\n scene,\r\n new Vector2(1.0, 0),\r\n adjustedKernelSize,\r\n ratio,\r\n null,\r\n this._circleOfConfusion,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n engine,\r\n false,\r\n pipelineTextureType,\r\n blockCompilation\r\n );\r\n blurX.autoClear = false;\r\n this._depthOfFieldBlurY.push(blurY);\r\n this._depthOfFieldBlurX.push(blurX);\r\n }\r\n\r\n // Set all post processes on the effect.\r\n this._effects = [this._circleOfConfusion];\r\n for (let i = 0; i < this._depthOfFieldBlurX.length; i++) {\r\n this._effects.push(this._depthOfFieldBlurY[i]);\r\n this._effects.push(this._depthOfFieldBlurX[i]);\r\n }\r\n\r\n // Merge blurred images with original image based on circleOfConfusion\r\n this._dofMerge = new DepthOfFieldMergePostProcess(\r\n \"dofMerge\",\r\n this._circleOfConfusion,\r\n this._circleOfConfusion,\r\n this._depthOfFieldBlurX,\r\n ratio,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n engine,\r\n false,\r\n pipelineTextureType,\r\n blockCompilation\r\n );\r\n this._dofMerge.autoClear = false;\r\n this._effects.push(this._dofMerge);\r\n }\r\n\r\n /**\r\n * Get the current class name of the current effect\r\n * @returns \"DepthOfFieldEffect\"\r\n */\r\n public getClassName(): string {\r\n return \"DepthOfFieldEffect\";\r\n }\r\n\r\n /**\r\n * Depth texture to be used to compute the circle of confusion. This must be set here or in the constructor in order for the post process to function.\r\n */\r\n public set depthTexture(value: RenderTargetTexture) {\r\n this._circleOfConfusion.depthTexture = value;\r\n }\r\n\r\n /**\r\n * Disposes each of the internal effects for a given camera.\r\n * @param camera The camera to dispose the effect on.\r\n */\r\n public disposeEffects(camera: Camera) {\r\n for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {\r\n this._effects[effectIndex].dispose(camera);\r\n }\r\n }\r\n\r\n /**\r\n * @internal Internal\r\n */\r\n public _updateEffects() {\r\n for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {\r\n this._effects[effectIndex].updateEffect();\r\n }\r\n }\r\n\r\n /**\r\n * Internal\r\n * @returns if all the contained post processes are ready.\r\n * @internal\r\n */\r\n public _isReady() {\r\n for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {\r\n if (!this._effects[effectIndex].isReady()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"depthOfFieldEffect.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/depthOfFieldEffect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAGxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD;;GAEG;AACH,MAAM,CAAN,IAAY,2BAaX;AAbD,WAAY,2BAA2B;IACnC;;OAEG;IACH,2EAAG,CAAA;IACH;;OAEG;IACH,iFAAM,CAAA;IACN;;OAEG;IACH,6EAAI,CAAA;AACR,CAAC,EAbW,2BAA2B,KAA3B,2BAA2B,QAatC;AACD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,uBAAuB;IAc3D;;OAEG;IACH,IAAW,WAAW,CAAC,KAAa;QAChC,IAAI,CAAC,kBAAkB,CAAC,WAAW,GAAG,KAAK,CAAC;IAChD,CAAC;IACD,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC;IAC/C,CAAC;IACD;;OAEG;IACH,IAAW,KAAK,CAAC,KAAa;QAC1B,IAAI,CAAC,kBAAkB,CAAC,KAAK,GAAG,KAAK,CAAC;IAC1C,CAAC;IACD,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;IACzC,CAAC;IACD;;OAEG;IACH,IAAW,aAAa,CAAC,KAAa;QAClC,IAAI,CAAC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CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,oBAAoB,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAW,YAAY,CAAC,KAA0B;QAC9C,IAAI,CAAC,kBAAkB,CAAC,YAAY,GAAG,KAAK,CAAC;IACjD,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,MAAc;QAChC,KAAK,IAAI,WAAW,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;YACzE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;SAC9C;IACL,CAAC;IAED;;OAEG;IACI,cAAc;QACjB,KAAK,IAAI,WAAW,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;YACzE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,YAAY,EAAE,CAAC;SAC7C;IACL,CAAC;IAED;;;;OAIG;IACI,QAAQ;QACX,KAAK,IAAI,WAAW,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,EAAE;YACzE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,EAAE;gBACvC,OAAO,KAAK,CAAC;aAChB;SACJ;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport type { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { PostProcess } from \"./postProcess\";\r\nimport { PostProcessRenderEffect } from \"../PostProcesses/RenderPipeline/postProcessRenderEffect\";\r\nimport { CircleOfConfusionPostProcess } from \"./circleOfConfusionPostProcess\";\r\nimport { DepthOfFieldBlurPostProcess } from \"./depthOfFieldBlurPostProcess\";\r\nimport { DepthOfFieldMergePostProcess } from \"./depthOfFieldMergePostProcess\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\n/**\r\n * Specifies the level of max blur that should be applied when using the depth of field effect\r\n */\r\nexport enum DepthOfFieldEffectBlurLevel {\r\n /**\r\n * Subtle blur\r\n */\r\n Low,\r\n /**\r\n * Medium blur\r\n */\r\n Medium,\r\n /**\r\n * Large blur\r\n */\r\n High,\r\n}\r\n/**\r\n * The depth of field effect applies a blur to objects that are closer or further from where the camera is focusing.\r\n */\r\nexport class DepthOfFieldEffect extends PostProcessRenderEffect {\r\n private _circleOfConfusion: CircleOfConfusionPostProcess;\r\n /**\r\n * @internal Internal, blurs from high to low\r\n */\r\n public _depthOfFieldBlurX: Array<DepthOfFieldBlurPostProcess>;\r\n private _depthOfFieldBlurY: Array<DepthOfFieldBlurPostProcess>;\r\n private _dofMerge: Nullable<DepthOfFieldMergePostProcess>;\r\n\r\n /**\r\n * @internal Internal post processes in depth of field effect\r\n */\r\n public _effects: Array<PostProcess> = [];\r\n\r\n /**\r\n * The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter)\r\n */\r\n public set focalLength(value: number) {\r\n this._circleOfConfusion.focalLength = value;\r\n }\r\n public get focalLength() {\r\n return this._circleOfConfusion.focalLength;\r\n }\r\n /**\r\n * F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)\r\n */\r\n public set fStop(value: number) {\r\n this._circleOfConfusion.fStop = value;\r\n }\r\n public get fStop() {\r\n return this._circleOfConfusion.fStop;\r\n }\r\n /**\r\n * Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)\r\n */\r\n public set focusDistance(value: number) {\r\n this._circleOfConfusion.focusDistance = value;\r\n }\r\n public get focusDistance() {\r\n return this._circleOfConfusion.focusDistance;\r\n }\r\n /**\r\n * Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.\r\n */\r\n public set lensSize(value: number) {\r\n this._circleOfConfusion.lensSize = value;\r\n }\r\n public get lensSize() {\r\n return this._circleOfConfusion.lensSize;\r\n }\r\n\r\n /**\r\n * Creates a new instance DepthOfFieldEffect\r\n * @param scene The scene the effect belongs to.\r\n * @param depthTexture The depth texture of the scene to compute the circle of confusion.This must be set in order for this to function but may be set after initialization if needed.\r\n * @param blurLevel\r\n * @param pipelineTextureType The type of texture to be used when performing the post processing.\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n scene: Scene,\r\n depthTexture: Nullable<RenderTargetTexture>,\r\n blurLevel: DepthOfFieldEffectBlurLevel = DepthOfFieldEffectBlurLevel.Low,\r\n pipelineTextureType = 0,\r\n blockCompilation = false\r\n ) {\r\n super(\r\n scene.getEngine(),\r\n \"depth of field\",\r\n () => {\r\n return this._effects;\r\n },\r\n true\r\n );\r\n\r\n // Use R-only formats if supported to store the circle of confusion values.\r\n // This should be more space and bandwidth efficient than using RGBA.\r\n const engine = scene.getEngine();\r\n const circleOfConfusionTextureFormat = engine.isWebGPU || engine.webGLVersion > 1 ? Constants.TEXTUREFORMAT_RED : Constants.TEXTUREFORMAT_RGBA;\r\n\r\n // Circle of confusion value for each pixel is used to determine how much to blur that pixel\r\n this._circleOfConfusion = new CircleOfConfusionPostProcess(\r\n \"circleOfConfusion\",\r\n depthTexture,\r\n 1,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n engine,\r\n false,\r\n pipelineTextureType,\r\n blockCompilation\r\n );\r\n\r\n // Create a pyramid of blurred images (eg. fullSize 1/4 blur, half size 1/2 blur, quarter size 3/4 blur, eith size 4/4 blur)\r\n // Blur the image but do not blur on sharp far to near distance changes to avoid bleeding artifacts\r\n // See section 2.6.2 http://fileadmin.cs.lth.se/cs/education/edan35/lectures/12dof.pdf\r\n this._depthOfFieldBlurY = [];\r\n this._depthOfFieldBlurX = [];\r\n let blurCount = 1;\r\n let kernelSize = 15;\r\n switch (blurLevel) {\r\n case DepthOfFieldEffectBlurLevel.High: {\r\n blurCount = 3;\r\n kernelSize = 51;\r\n break;\r\n }\r\n case DepthOfFieldEffectBlurLevel.Medium: {\r\n blurCount = 2;\r\n kernelSize = 31;\r\n break;\r\n }\r\n default: {\r\n kernelSize = 15;\r\n blurCount = 1;\r\n break;\r\n }\r\n }\r\n const adjustedKernelSize = kernelSize / Math.pow(2, blurCount - 1);\r\n let ratio = 1.0;\r\n for (let i = 0; i < blurCount; i++) {\r\n const blurY = new DepthOfFieldBlurPostProcess(\r\n \"vertical blur\",\r\n scene,\r\n new Vector2(0, 1.0),\r\n adjustedKernelSize,\r\n ratio,\r\n null,\r\n this._circleOfConfusion,\r\n i == 0 ? this._circleOfConfusion : null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n engine,\r\n false,\r\n pipelineTextureType,\r\n blockCompilation,\r\n i == 0 ? circleOfConfusionTextureFormat : Constants.TEXTUREFORMAT_RGBA\r\n );\r\n blurY.autoClear = false;\r\n ratio = 0.75 / Math.pow(2, i);\r\n const blurX = new DepthOfFieldBlurPostProcess(\r\n \"horizontal blur\",\r\n scene,\r\n new Vector2(1.0, 0),\r\n adjustedKernelSize,\r\n ratio,\r\n null,\r\n this._circleOfConfusion,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n engine,\r\n false,\r\n pipelineTextureType,\r\n blockCompilation\r\n );\r\n blurX.autoClear = false;\r\n this._depthOfFieldBlurY.push(blurY);\r\n this._depthOfFieldBlurX.push(blurX);\r\n }\r\n\r\n // Set all post processes on the effect.\r\n this._effects = [this._circleOfConfusion];\r\n for (let i = 0; i < this._depthOfFieldBlurX.length; i++) {\r\n this._effects.push(this._depthOfFieldBlurY[i]);\r\n this._effects.push(this._depthOfFieldBlurX[i]);\r\n }\r\n\r\n // Merge blurred images with original image based on circleOfConfusion\r\n this._dofMerge = new DepthOfFieldMergePostProcess(\r\n \"dofMerge\",\r\n this._circleOfConfusion,\r\n this._circleOfConfusion,\r\n this._depthOfFieldBlurX,\r\n ratio,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n engine,\r\n false,\r\n pipelineTextureType,\r\n blockCompilation\r\n );\r\n this._dofMerge.autoClear = false;\r\n this._effects.push(this._dofMerge);\r\n }\r\n\r\n /**\r\n * Get the current class name of the current effect\r\n * @returns \"DepthOfFieldEffect\"\r\n */\r\n public getClassName(): string {\r\n return \"DepthOfFieldEffect\";\r\n }\r\n\r\n /**\r\n * Depth texture to be used to compute the circle of confusion. This must be set here or in the constructor in order for the post process to function.\r\n */\r\n public set depthTexture(value: RenderTargetTexture) {\r\n this._circleOfConfusion.depthTexture = value;\r\n }\r\n\r\n /**\r\n * Disposes each of the internal effects for a given camera.\r\n * @param camera The camera to dispose the effect on.\r\n */\r\n public disposeEffects(camera: Camera) {\r\n for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {\r\n this._effects[effectIndex].dispose(camera);\r\n }\r\n }\r\n\r\n /**\r\n * @internal Internal\r\n */\r\n public _updateEffects() {\r\n for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {\r\n this._effects[effectIndex].updateEffect();\r\n }\r\n }\r\n\r\n /**\r\n * Internal\r\n * @returns if all the contained post processes are ready.\r\n * @internal\r\n */\r\n public _isReady() {\r\n for (let effectIndex = 0; effectIndex < this._effects.length; effectIndex++) {\r\n if (!this._effects[effectIndex].isReady()) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n}\r\n"]}
@@ -10,6 +10,13 @@ export class DepthOfFieldMergePostProcessOptions {
10
10
  * The DepthOfFieldMergePostProcess merges blurred images with the original based on the values of the circle of confusion.
11
11
  */
12
12
  export class DepthOfFieldMergePostProcess extends PostProcess {
13
+ /**
14
+ * Gets a string identifying the name of the class
15
+ * @returns "DepthOfFieldMergePostProcess" string
16
+ */
17
+ getClassName() {
18
+ return "DepthOfFieldMergePostProcess";
19
+ }
13
20
  /**
14
21
  * Creates a new instance of DepthOfFieldMergePostProcess
15
22
  * @param name The name of the effect.
@@ -39,13 +46,6 @@ export class DepthOfFieldMergePostProcess extends PostProcess {
39
46
  this.updateEffect();
40
47
  }
41
48
  }
42
- /**
43
- * Gets a string identifying the name of the class
44
- * @returns "DepthOfFieldMergePostProcess" string
45
- */
46
- getClassName() {
47
- return "DepthOfFieldMergePostProcess";
48
- }
49
49
  /**
50
50
  * Updates the effect with the current post process compile time values and recompiles the shader.
51
51
  * @param defines Define statements that should be added at the beginning of the shader. (default: null)
@@ -1 +1 @@
1
- {"version":3,"file":"depthOfFieldMergePostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/depthOfFieldMergePostProcess.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,uCAAuC,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAO,mCAAmC;CAmB/C;AAED;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,WAAW;IASzD;;;;;;;;;;;;;OAaG;IACH,YACI,IAAY,EACZ,iBAA8B,EAC9B,iBAA8B,EACtB,UAA8B,EACtC,OAAoC,EACpC,MAAwB,EACxB,YAAqB,EACrB,MAAe,EACf,QAAkB,EAClB,WAAW,GAAG,SAAS,CAAC,wBAAwB,EAChD,gBAAgB,GAAG,KAAK;QAExB,KAAK,CACD,IAAI,EACJ,mBAAmB,EACnB,EAAE,EACF,CAAC,0BAA0B,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,EACnE,OAAO,EACP,MAAM,EACN,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,SAAS,EACT,IAAI,EACJ,IAAI,CACP,CAAC;QAxBM,eAAU,GAAV,UAAU,CAAoB;QAyBtC,IAAI,CAAC,6BAA6B,GAAG,IAAI,CAAC;QAC1C,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE;YAC1C,MAAM,CAAC,yBAAyB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;YACtE,MAAM,CAAC,+BAA+B,CAAC,0BAA0B,EAAE,iBAAiB,CAAC,CAAC;YACtF,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBAC/B,MAAM,CAAC,+BAA+B,CAAC,UAAU,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YAC/F,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,EAAE;YACnB,IAAI,CAAC,YAAY,EAAE,CAAC;SACvB;IACL,CAAC;IA/DD;;;OAGG;IACI,YAAY;QACf,OAAO,8BAA8B,CAAC;IAC1C,CAAC;IA2DD;;;;;;;;OAQG;IACI,YAAY,CACf,UAA4B,IAAI,EAChC,WAA+B,IAAI,EACnC,WAA+B,IAAI,EACnC,eAAqB,EACrB,UAAqC,EACrC,OAAkD;QAElD,IAAI,CAAC,OAAO,EAAE;YACV,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,qBAAqB,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;SAC1E;QACD,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport \"../Shaders/depthOfFieldMerge.fragment\";\r\n\r\n/**\r\n * Options to be set when merging outputs from the default pipeline.\r\n */\r\nexport class DepthOfFieldMergePostProcessOptions {\r\n /**\r\n * The original image to merge on top of\r\n */\r\n public originalFromInput: PostProcess;\r\n /**\r\n * Parameters to perform the merge of the depth of field effect\r\n */\r\n public depthOfField?: {\r\n circleOfConfusion: PostProcess;\r\n blurSteps: Array<PostProcess>;\r\n };\r\n /**\r\n * Parameters to perform the merge of bloom effect\r\n */\r\n public bloom?: {\r\n blurred: PostProcess;\r\n weight: number;\r\n };\r\n}\r\n\r\n/**\r\n * The DepthOfFieldMergePostProcess merges blurred images with the original based on the values of the circle of confusion.\r\n */\r\nexport class DepthOfFieldMergePostProcess extends PostProcess {\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"DepthOfFieldMergePostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"DepthOfFieldMergePostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance of DepthOfFieldMergePostProcess\r\n * @param name The name of the effect.\r\n * @param originalFromInput Post process which's input will be used for the merge.\r\n * @param circleOfConfusion Circle of confusion post process which's output will be used to blur each pixel.\r\n * @param _blurSteps Blur post processes from low to high which will be mixed with the original image.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n originalFromInput: PostProcess,\r\n circleOfConfusion: PostProcess,\r\n private _blurSteps: Array<PostProcess>,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n blockCompilation = false\r\n ) {\r\n super(\r\n name,\r\n \"depthOfFieldMerge\",\r\n [],\r\n [\"circleOfConfusionSampler\", \"blurStep0\", \"blurStep1\", \"blurStep2\"],\r\n options,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n null,\r\n textureType,\r\n undefined,\r\n null,\r\n true\r\n );\r\n this.externalTextureSamplerBinding = true;\r\n this.onApplyObservable.add((effect: Effect) => {\r\n effect.setTextureFromPostProcess(\"textureSampler\", originalFromInput);\r\n effect.setTextureFromPostProcessOutput(\"circleOfConfusionSampler\", circleOfConfusion);\r\n _blurSteps.forEach((step, index) => {\r\n effect.setTextureFromPostProcessOutput(\"blurStep\" + (_blurSteps.length - index - 1), step);\r\n });\r\n });\r\n\r\n if (!blockCompilation) {\r\n this.updateEffect();\r\n }\r\n }\r\n\r\n /**\r\n * Updates the effect with the current post process compile time values and recompiles the shader.\r\n * @param defines Define statements that should be added at the beginning of the shader. (default: null)\r\n * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)\r\n * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)\r\n * @param indexParameters The index parameters to be used for babylons include syntax \"#include<kernelBlurVaryingDeclaration>[0..varyingCount]\". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx\r\n * @param onCompiled Called when the shader has been compiled.\r\n * @param onError Called if there is an error when compiling a shader.\r\n */\r\n public updateEffect(\r\n defines: Nullable<string> = null,\r\n uniforms: Nullable<string[]> = null,\r\n samplers: Nullable<string[]> = null,\r\n indexParameters?: any,\r\n onCompiled?: (effect: Effect) => void,\r\n onError?: (effect: Effect, errors: string) => void\r\n ) {\r\n if (!defines) {\r\n defines = \"\";\r\n defines += \"#define BLUR_LEVEL \" + (this._blurSteps.length - 1) + \"\\n\";\r\n }\r\n super.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"depthOfFieldMergePostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/depthOfFieldMergePostProcess.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,uCAAuC,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAO,mCAAmC;CAmB/C;AAED;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,WAAW;IACzD;;;OAGG;IACI,YAAY;QACf,OAAO,8BAA8B,CAAC;IAC1C,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,YACI,IAAY,EACZ,iBAA8B,EAC9B,iBAA8B,EACtB,UAA8B,EACtC,OAAoC,EACpC,MAAwB,EACxB,YAAqB,EACrB,MAAe,EACf,QAAkB,EAClB,WAAW,GAAG,SAAS,CAAC,wBAAwB,EAChD,gBAAgB,GAAG,KAAK;QAExB,KAAK,CACD,IAAI,EACJ,mBAAmB,EACnB,EAAE,EACF,CAAC,0BAA0B,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,EACnE,OAAO,EACP,MAAM,EACN,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,SAAS,EACT,IAAI,EACJ,IAAI,CACP,CAAC;QAxBM,eAAU,GAAV,UAAU,CAAoB;QAyBtC,IAAI,CAAC,6BAA6B,GAAG,IAAI,CAAC;QAC1C,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE;YAC1C,MAAM,CAAC,yBAAyB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;YACtE,MAAM,CAAC,+BAA+B,CAAC,0BAA0B,EAAE,iBAAiB,CAAC,CAAC;YACtF,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBAC/B,MAAM,CAAC,+BAA+B,CAAC,UAAU,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,KAAK,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YAC/F,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,gBAAgB,EAAE;YACnB,IAAI,CAAC,YAAY,EAAE,CAAC;SACvB;IACL,CAAC;IAED;;;;;;;;OAQG;IACI,YAAY,CACf,UAA4B,IAAI,EAChC,WAA+B,IAAI,EACnC,WAA+B,IAAI,EACnC,eAAqB,EACrB,UAAqC,EACrC,OAAkD;QAElD,IAAI,CAAC,OAAO,EAAE;YACV,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,qBAAqB,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;SAC1E;QACD,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport \"../Shaders/depthOfFieldMerge.fragment\";\r\n\r\n/**\r\n * Options to be set when merging outputs from the default pipeline.\r\n */\r\nexport class DepthOfFieldMergePostProcessOptions {\r\n /**\r\n * The original image to merge on top of\r\n */\r\n public originalFromInput: PostProcess;\r\n /**\r\n * Parameters to perform the merge of the depth of field effect\r\n */\r\n public depthOfField?: {\r\n circleOfConfusion: PostProcess;\r\n blurSteps: Array<PostProcess>;\r\n };\r\n /**\r\n * Parameters to perform the merge of bloom effect\r\n */\r\n public bloom?: {\r\n blurred: PostProcess;\r\n weight: number;\r\n };\r\n}\r\n\r\n/**\r\n * The DepthOfFieldMergePostProcess merges blurred images with the original based on the values of the circle of confusion.\r\n */\r\nexport class DepthOfFieldMergePostProcess extends PostProcess {\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"DepthOfFieldMergePostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"DepthOfFieldMergePostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance of DepthOfFieldMergePostProcess\r\n * @param name The name of the effect.\r\n * @param originalFromInput Post process which's input will be used for the merge.\r\n * @param circleOfConfusion Circle of confusion post process which's output will be used to blur each pixel.\r\n * @param _blurSteps Blur post processes from low to high which will be mixed with the original image.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n originalFromInput: PostProcess,\r\n circleOfConfusion: PostProcess,\r\n private _blurSteps: Array<PostProcess>,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n blockCompilation = false\r\n ) {\r\n super(\r\n name,\r\n \"depthOfFieldMerge\",\r\n [],\r\n [\"circleOfConfusionSampler\", \"blurStep0\", \"blurStep1\", \"blurStep2\"],\r\n options,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n null,\r\n textureType,\r\n undefined,\r\n null,\r\n true\r\n );\r\n this.externalTextureSamplerBinding = true;\r\n this.onApplyObservable.add((effect: Effect) => {\r\n effect.setTextureFromPostProcess(\"textureSampler\", originalFromInput);\r\n effect.setTextureFromPostProcessOutput(\"circleOfConfusionSampler\", circleOfConfusion);\r\n _blurSteps.forEach((step, index) => {\r\n effect.setTextureFromPostProcessOutput(\"blurStep\" + (_blurSteps.length - index - 1), step);\r\n });\r\n });\r\n\r\n if (!blockCompilation) {\r\n this.updateEffect();\r\n }\r\n }\r\n\r\n /**\r\n * Updates the effect with the current post process compile time values and recompiles the shader.\r\n * @param defines Define statements that should be added at the beginning of the shader. (default: null)\r\n * @param uniforms Set of uniform variables that will be passed to the shader. (default: null)\r\n * @param samplers Set of Texture2D variables that will be passed to the shader. (default: null)\r\n * @param indexParameters The index parameters to be used for babylons include syntax \"#include<kernelBlurVaryingDeclaration>[0..varyingCount]\". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx\r\n * @param onCompiled Called when the shader has been compiled.\r\n * @param onError Called if there is an error when compiling a shader.\r\n */\r\n public updateEffect(\r\n defines: Nullable<string> = null,\r\n uniforms: Nullable<string[]> = null,\r\n samplers: Nullable<string[]> = null,\r\n indexParameters?: any,\r\n onCompiled?: (effect: Effect) => void,\r\n onError?: (effect: Effect, errors: string) => void\r\n ) {\r\n if (!defines) {\r\n defines = \"\";\r\n defines += \"#define BLUR_LEVEL \" + (this._blurSteps.length - 1) + \"\\n\";\r\n }\r\n super.updateEffect(defines, uniforms, samplers, indexParameters, onCompiled, onError);\r\n }\r\n}\r\n"]}
@@ -9,6 +9,13 @@ import { RegisterClass } from "../Misc/typeStore.js";
9
9
  * The extract highlights post process sets all pixels to black except pixels above the specified luminance threshold. Used as the first step for a bloom effect.
10
10
  */
11
11
  export class ExtractHighlightsPostProcess extends PostProcess {
12
+ /**
13
+ * Gets a string identifying the name of the class
14
+ * @returns "ExtractHighlightsPostProcess" string
15
+ */
16
+ getClassName() {
17
+ return "ExtractHighlightsPostProcess";
18
+ }
12
19
  constructor(name, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {
13
20
  super(name, "extractHighlights", ["threshold", "exposure"], null, options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);
14
21
  /**
@@ -31,13 +38,6 @@ export class ExtractHighlightsPostProcess extends PostProcess {
31
38
  effect.setFloat("exposure", this._exposure);
32
39
  });
33
40
  }
34
- /**
35
- * Gets a string identifying the name of the class
36
- * @returns "ExtractHighlightsPostProcess" string
37
- */
38
- getClassName() {
39
- return "ExtractHighlightsPostProcess";
40
- }
41
41
  }
42
42
  __decorate([
43
43
  serialize()
@@ -1 +1 @@
1
- {"version":3,"file":"extractHighlightsPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/extractHighlightsPostProcess.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,WAAW;IAwBzD,YACI,IAAY,EACZ,OAAoC,EACpC,MAAwB,EACxB,YAAqB,EACrB,MAAe,EACf,QAAkB,EAClB,cAAsB,SAAS,CAAC,wBAAwB,EACxD,gBAAgB,GAAG,KAAK;QAExB,KAAK,CAAC,IAAI,EAAE,mBAAmB,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAjC7K;;WAEG;QAEI,cAAS,GAAG,GAAG,CAAC;QAEvB,gBAAgB;QACT,cAAS,GAAG,CAAC,CAAC;QAErB;;;WAGG;QACI,sBAAiB,GAA0B,IAAI,CAAC;QAqBnD,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE;YAC1C,IAAI,CAAC,6BAA6B,GAAG,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC;YAC9D,IAAI,IAAI,CAAC,iBAAiB,EAAE;gBACxB,MAAM,CAAC,yBAAyB,CAAC,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;aAC9E;YACD,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;YACrE,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACP,CAAC;IA3BD;;;OAGG;IACI,YAAY;QACf,OAAO,8BAA8B,CAAC;IAC1C,CAAC;CAsBJ;AAvCG;IADC,SAAS,EAAE;+DACW;AAyC3B,aAAa,CAAC,sCAAsC,EAAE,4BAA4B,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport { ToGammaSpace } from \"../Maths/math.constants\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport \"../Shaders/extractHighlights.fragment\";\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\n/**\r\n * The extract highlights post process sets all pixels to black except pixels above the specified luminance threshold. Used as the first step for a bloom effect.\r\n */\r\nexport class ExtractHighlightsPostProcess extends PostProcess {\r\n /**\r\n * The luminance threshold, pixels below this value will be set to black.\r\n */\r\n @serialize()\r\n public threshold = 0.9;\r\n\r\n /** @internal */\r\n public _exposure = 1;\r\n\r\n /**\r\n * Post process which has the input texture to be used when performing highlight extraction\r\n * @internal\r\n */\r\n public _inputPostProcess: Nullable<PostProcess> = null;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"ExtractHighlightsPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"ExtractHighlightsPostProcess\";\r\n }\r\n\r\n constructor(\r\n name: string,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n blockCompilation = false\r\n ) {\r\n super(name, \"extractHighlights\", [\"threshold\", \"exposure\"], null, options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);\r\n this.onApplyObservable.add((effect: Effect) => {\r\n this.externalTextureSamplerBinding = !!this._inputPostProcess;\r\n if (this._inputPostProcess) {\r\n effect.setTextureFromPostProcess(\"textureSampler\", this._inputPostProcess);\r\n }\r\n effect.setFloat(\"threshold\", Math.pow(this.threshold, ToGammaSpace));\r\n effect.setFloat(\"exposure\", this._exposure);\r\n });\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ExtractHighlightsPostProcess\", ExtractHighlightsPostProcess);\r\n"]}
1
+ {"version":3,"file":"extractHighlightsPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/extractHighlightsPostProcess.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,uCAAuC,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;GAE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} from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport { ToGammaSpace } from \"../Maths/math.constants\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport \"../Shaders/extractHighlights.fragment\";\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\n/**\r\n * The extract highlights post process sets all pixels to black except pixels above the specified luminance threshold. Used as the first step for a bloom effect.\r\n */\r\nexport class ExtractHighlightsPostProcess extends PostProcess {\r\n /**\r\n * The luminance threshold, pixels below this value will be set to black.\r\n */\r\n @serialize()\r\n public threshold = 0.9;\r\n\r\n /** @internal */\r\n public _exposure = 1;\r\n\r\n /**\r\n * Post process which has the input texture to be used when performing highlight extraction\r\n * @internal\r\n */\r\n public _inputPostProcess: Nullable<PostProcess> = null;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"ExtractHighlightsPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"ExtractHighlightsPostProcess\";\r\n }\r\n\r\n constructor(\r\n name: string,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n blockCompilation = false\r\n ) {\r\n super(name, \"extractHighlights\", [\"threshold\", \"exposure\"], null, options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);\r\n this.onApplyObservable.add((effect: Effect) => {\r\n this.externalTextureSamplerBinding = !!this._inputPostProcess;\r\n if (this._inputPostProcess) {\r\n effect.setTextureFromPostProcess(\"textureSampler\", this._inputPostProcess);\r\n }\r\n effect.setFloat(\"threshold\", Math.pow(this.threshold, ToGammaSpace));\r\n effect.setFloat(\"exposure\", this._exposure);\r\n });\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ExtractHighlightsPostProcess\", ExtractHighlightsPostProcess);\r\n"]}
@@ -7,6 +7,13 @@ import { serializeAsMatrix, SerializationHelper } from "../Misc/decorators.js";
7
7
  * Applies a kernel filter to the image
8
8
  */
9
9
  export class FilterPostProcess extends PostProcess {
10
+ /**
11
+ * Gets a string identifying the name of the class
12
+ * @returns "FilterPostProcess" string
13
+ */
14
+ getClassName() {
15
+ return "FilterPostProcess";
16
+ }
10
17
  /**
11
18
  *
12
19
  * @param name The name of the effect.
@@ -24,13 +31,6 @@ export class FilterPostProcess extends PostProcess {
24
31
  effect.setMatrix("kernelMatrix", this.kernelMatrix);
25
32
  };
26
33
  }
27
- /**
28
- * Gets a string identifying the name of the class
29
- * @returns "FilterPostProcess" string
30
- */
31
- getClassName() {
32
- return "FilterPostProcess";
33
- }
34
34
  /**
35
35
  * @internal
36
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"filterPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/filterPostProcess.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAI5E;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAa9C;;;;;;;;;OASG;IACH,YAAY,IAAY,EAAE,YAAoB,EAAE,OAAoC,EAAE,MAAwB,EAAE,YAAqB,EAAE,MAAe,EAAE,QAAkB;QACtK,KAAK,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC/F,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QAEjC,IAAI,CAAC,OAAO,GAAG,CAAC,MAAc,EAAE,EAAE;YAC9B,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACxD,CAAC,CAAC;IACN,CAAC;IAzBD;;;OAGG;IACI,YAAY;QACf,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAqBD;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,iBAAsB,EAAE,YAAoB,EAAE,KAAY,EAAE,OAAe;QAC5F,OAAO,mBAAmB,CAAC,KAAK,CAC5B,GAAG,EAAE;YACD,OAAO,IAAI,iBAAiB,CACxB,iBAAiB,CAAC,IAAI,EACtB,iBAAiB,CAAC,YAAY,EAC9B,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,KAAK,CAAC,SAAS,EAAE,EACjB,iBAAiB,CAAC,QAAQ,CAC7B,CAAC;QACN,CAAC,EACD,iBAAiB,EACjB,KAAK,EACL,OAAO,CACV,CAAC;IACN,CAAC;CACJ;AAlDG;IADC,iBAAiB,EAAE;uDACQ;AAoDhC,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Matrix } from \"../Maths/math.vector\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Engine } from \"../Engines/engine\";\r\n\r\nimport \"../Shaders/filter.fragment\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serializeAsMatrix, SerializationHelper } from \"../Misc/decorators\";\r\n\r\ndeclare type Scene = import(\"../scene\").Scene;\r\n\r\n/**\r\n * Applies a kernel filter to the image\r\n */\r\nexport class FilterPostProcess extends PostProcess {\r\n /** The matrix to be applied to the image */\r\n @serializeAsMatrix()\r\n public kernelMatrix: Matrix;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"FilterPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"FilterPostProcess\";\r\n }\r\n\r\n /**\r\n *\r\n * @param name The name of the effect.\r\n * @param kernelMatrix The matrix to be applied to the image\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n */\r\n constructor(name: string, kernelMatrix: Matrix, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean) {\r\n super(name, \"filter\", [\"kernelMatrix\"], null, options, camera, samplingMode, engine, reusable);\r\n this.kernelMatrix = kernelMatrix;\r\n\r\n this.onApply = (effect: Effect) => {\r\n effect.setMatrix(\"kernelMatrix\", this.kernelMatrix);\r\n };\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<FilterPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new FilterPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.kernelMatrix,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.FilterPostProcess\", FilterPostProcess);\r\n"]}
1
+ {"version":3,"file":"filterPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/filterPostProcess.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAA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era } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Engine } from \"../Engines/engine\";\r\n\r\nimport \"../Shaders/filter.fragment\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serializeAsMatrix, SerializationHelper } from \"../Misc/decorators\";\r\n\r\ndeclare type Scene = import(\"../scene\").Scene;\r\n\r\n/**\r\n * Applies a kernel filter to the image\r\n */\r\nexport class FilterPostProcess extends PostProcess {\r\n /** The matrix to be applied to the image */\r\n @serializeAsMatrix()\r\n public kernelMatrix: Matrix;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"FilterPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"FilterPostProcess\";\r\n }\r\n\r\n /**\r\n *\r\n * @param name The name of the effect.\r\n * @param kernelMatrix The matrix to be applied to the image\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n */\r\n constructor(name: string, kernelMatrix: Matrix, options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: Engine, reusable?: boolean) {\r\n super(name, \"filter\", [\"kernelMatrix\"], null, options, camera, samplingMode, engine, reusable);\r\n this.kernelMatrix = kernelMatrix;\r\n\r\n this.onApply = (effect: Effect) => {\r\n effect.setMatrix(\"kernelMatrix\", this.kernelMatrix);\r\n };\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<FilterPostProcess> {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new FilterPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.kernelMatrix,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.FilterPostProcess\", FilterPostProcess);\r\n"]}
@@ -8,6 +8,13 @@ import { serialize, SerializationHelper } from "../Misc/decorators.js";
8
8
  * The GrainPostProcess adds noise to the image at mid luminance levels
9
9
  */
10
10
  export class GrainPostProcess extends PostProcess {
11
+ /**
12
+ * Gets a string identifying the name of the class
13
+ * @returns "GrainPostProcess" string
14
+ */
15
+ getClassName() {
16
+ return "GrainPostProcess";
17
+ }
11
18
  /**
12
19
  * Creates a new instance of @see GrainPostProcess
13
20
  * @param name The name of the effect.
@@ -34,13 +41,6 @@ export class GrainPostProcess extends PostProcess {
34
41
  effect.setFloat("animatedSeed", this.animated ? Math.random() + 1 : 1);
35
42
  });
36
43
  }
37
- /**
38
- * Gets a string identifying the name of the class
39
- * @returns "GrainPostProcess" string
40
- */
41
- getClassName() {
42
- return "GrainPostProcess";
43
- }
44
44
  /**
45
45
  * @internal
46
46
  */
@@ -1 +1 @@
1
- {"version":3,"file":"grainPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/grainPostProcess.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIpE;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAoB7C;;;;;;;;;;OAUG;IACH,YACI,IAAY,EACZ,OAAoC,EACpC,MAAwB,EACxB,YAAqB,EACrB,MAAe,EACf,QAAkB,EACl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kDACqB;AA4DrC,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport \"../Shaders/grain.fragment\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serialize, SerializationHelper } from \"../Misc/decorators\";\r\n\r\ndeclare type Scene = import(\"../scene\").Scene;\r\n\r\n/**\r\n * The GrainPostProcess adds noise to the image at mid luminance levels\r\n */\r\nexport class GrainPostProcess extends PostProcess {\r\n /**\r\n * The intensity of the grain added (default: 30)\r\n */\r\n @serialize()\r\n public intensity: number = 30;\r\n /**\r\n * If the grain should be randomized on every frame\r\n */\r\n @serialize()\r\n public animated: boolean = false;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"GrainPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"GrainPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance of @see GrainPostProcess\r\n * @param name The name of the effect.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n blockCompilation = false\r\n ) {\r\n super(name, \"grain\", [\"intensity\", \"animatedSeed\"], [], options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);\r\n this.onApplyObservable.add((effect: Effect) => {\r\n effect.setFloat(\"intensity\", this.intensity);\r\n effect.setFloat(\"animatedSeed\", this.animated ? Math.random() + 1 : 1);\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string) {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new GrainPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GrainPostProcess\", GrainPostProcess);\r\n"]}
1
+ {"version":3,"file":"grainPostProcess.js","sourceRoot":"","sources":["../../../../lts/core/generated/PostProcesses/grainPostProcess.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIpE;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAY7C;;;OAGG;IACI,YAAY;QACf,OAAO,kBAAkB,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;OAUG;IACH,YACI,IAAY,EACZ,OAAoC,EACpC,MAAwB,EACxB,YAAqB,EACrB,MAAe,EACf,QAAkB,EAClB,cAAsB,SAAS,CAAC,wBAAwB,EACxD,gBAAgB,GAAG,KAAK;QAExB,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;QAxCnK;;WAEG;QAEI,cAAS,GAAW,EAAE,CAAC;QAC9B;;WAEG;QAEI,aAAQ,GAAY,KAAK,CAAC;QAgC7B,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,MAAc,EAAE,EAAE;YAC1C,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAC7C,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,iBAAsB,EAAE,YAAoB,EAAE,KAAY,EAAE,OAAe;QAC5F,OAAO,mBAAmB,CAAC,KAAK,CAC5B,GAAG,EAAE;YACD,OAAO,IAAI,gBAAgB,CACvB,iBAAiB,CAAC,IAAI,EACtB,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,KAAK,CAAC,SAAS,EAAE,EACjB,iBAAiB,CAAC,QAAQ,CAC7B,CAAC;QACN,CAAC,EACD,iBAAiB,EACjB,KAAK,EACL,OAAO,CACV,CAAC;IACN,CAAC;CACJ;AA/DG;IADC,SAAS,EAAE;mDACkB;AAK9B;IADC,SAAS,EAAE;kDACqB;AA4DrC,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { PostProcessOptions } from \"./postProcess\";\r\nimport { PostProcess } from \"./postProcess\";\r\nimport type { Engine } from \"../Engines/engine\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport \"../Shaders/grain.fragment\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { serialize, SerializationHelper } from \"../Misc/decorators\";\r\n\r\ndeclare type Scene = import(\"../scene\").Scene;\r\n\r\n/**\r\n * The GrainPostProcess adds noise to the image at mid luminance levels\r\n */\r\nexport class GrainPostProcess extends PostProcess {\r\n /**\r\n * The intensity of the grain added (default: 30)\r\n */\r\n @serialize()\r\n public intensity: number = 30;\r\n /**\r\n * If the grain should be randomized on every frame\r\n */\r\n @serialize()\r\n public animated: boolean = false;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"GrainPostProcess\" string\r\n */\r\n public getClassName(): string {\r\n return \"GrainPostProcess\";\r\n }\r\n\r\n /**\r\n * Creates a new instance of @see GrainPostProcess\r\n * @param name The name of the effect.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: Engine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_INT,\r\n blockCompilation = false\r\n ) {\r\n super(name, \"grain\", [\"intensity\", \"animatedSeed\"], [], options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);\r\n this.onApplyObservable.add((effect: Effect) => {\r\n effect.setFloat(\"intensity\", this.intensity);\r\n effect.setFloat(\"animatedSeed\", this.animated ? Math.random() + 1 : 1);\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string) {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new GrainPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GrainPostProcess\", GrainPostProcess);\r\n"]}