@babylonjs/core 7.36.0 → 7.37.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 (133) hide show
  1. package/Collisions/gpuPicker.js.map +1 -1
  2. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  3. package/Engines/Extensions/engine.rawTexture.d.ts +8 -8
  4. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  5. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  6. package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
  7. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  8. package/Engines/WebGPU/Extensions/engine.rawTexture.d.ts +9 -9
  9. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  10. package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
  11. package/Engines/WebGPU/webgpuConstants.d.ts +6 -0
  12. package/Engines/WebGPU/webgpuConstants.js +6 -0
  13. package/Engines/WebGPU/webgpuConstants.js.map +1 -1
  14. package/Engines/WebGPU/webgpuTextureHelper.js +18 -0
  15. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  16. package/Engines/WebGPU/webgpuTextureManager.js +6 -0
  17. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  18. package/Engines/abstractEngine.d.ts +1 -1
  19. package/Engines/abstractEngine.js +4 -4
  20. package/Engines/abstractEngine.js.map +1 -1
  21. package/Engines/constants.d.ts +17 -1
  22. package/Engines/constants.js +17 -1
  23. package/Engines/constants.js.map +1 -1
  24. package/Engines/engine.d.ts +31 -1
  25. package/Engines/engine.js +17 -1
  26. package/Engines/engine.js.map +1 -1
  27. package/Engines/engineCapabilities.d.ts +2 -0
  28. package/Engines/engineCapabilities.js.map +1 -1
  29. package/Engines/nativeEngine.js +1 -0
  30. package/Engines/nativeEngine.js.map +1 -1
  31. package/Engines/nullEngine.d.ts +2 -2
  32. package/Engines/nullEngine.js +3 -2
  33. package/Engines/nullEngine.js.map +1 -1
  34. package/Engines/thinEngine.functions.d.ts +4 -0
  35. package/Engines/thinEngine.functions.js +17 -0
  36. package/Engines/thinEngine.functions.js.map +1 -1
  37. package/Engines/thinEngine.js +39 -9
  38. package/Engines/thinEngine.js.map +1 -1
  39. package/Engines/webgpuEngine.js +1 -0
  40. package/Engines/webgpuEngine.js.map +1 -1
  41. package/Helpers/environmentHelper.js.map +1 -1
  42. package/Layers/effectLayer.d.ts +1 -1
  43. package/Layers/effectLayer.js.map +1 -1
  44. package/Layers/glowLayer.d.ts +1 -1
  45. package/Layers/glowLayer.js.map +1 -1
  46. package/Layers/highlightLayer.d.ts +1 -1
  47. package/Layers/highlightLayer.js.map +1 -1
  48. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  49. package/Materials/Node/nodeMaterial.js.map +1 -1
  50. package/Materials/Textures/MultiviewRenderTarget.js.map +1 -1
  51. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  52. package/Materials/Textures/baseTexture.js.map +1 -1
  53. package/Materials/Textures/colorGradingTexture.js.map +1 -1
  54. package/Materials/Textures/mirrorTexture.js.map +1 -1
  55. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  56. package/Materials/Textures/rawCubeTexture.d.ts +2 -2
  57. package/Materials/Textures/rawCubeTexture.js +2 -2
  58. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  59. package/Materials/Textures/rawTexture.js.map +1 -1
  60. package/Materials/Textures/rawTexture2DArray.d.ts +1 -1
  61. package/Materials/Textures/rawTexture2DArray.js +1 -1
  62. package/Materials/Textures/rawTexture2DArray.js.map +1 -1
  63. package/Materials/Textures/rawTexture3D.d.ts +1 -1
  64. package/Materials/Textures/rawTexture3D.js +1 -1
  65. package/Materials/Textures/rawTexture3D.js.map +1 -1
  66. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  67. package/Materials/drawWrapper.d.ts +6 -1
  68. package/Materials/drawWrapper.js +18 -2
  69. package/Materials/drawWrapper.js.map +1 -1
  70. package/Materials/effect.d.ts +6 -1
  71. package/Materials/effect.functions.d.ts +5 -0
  72. package/Materials/effect.functions.js +19 -0
  73. package/Materials/effect.functions.js.map +1 -1
  74. package/Materials/effect.js +22 -20
  75. package/Materials/effect.js.map +1 -1
  76. package/Materials/effect.webgl.functions.js +12 -4
  77. package/Materials/effect.webgl.functions.js.map +1 -1
  78. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +2 -1
  79. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -0
  80. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  81. package/Meshes/abstractMesh.d.ts +5 -3
  82. package/Meshes/abstractMesh.js +9 -7
  83. package/Meshes/abstractMesh.js.map +1 -1
  84. package/Meshes/subMesh.d.ts +5 -3
  85. package/Meshes/subMesh.js +9 -7
  86. package/Meshes/subMesh.js.map +1 -1
  87. package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
  88. package/Misc/dds.d.ts +1 -1
  89. package/Misc/dds.js.map +1 -1
  90. package/Misc/environmentTextureTools.js.map +1 -1
  91. package/Misc/observable.d.ts +1 -3
  92. package/Misc/observable.js +7 -7
  93. package/Misc/observable.js.map +1 -1
  94. package/Misc/screenshotTools.js.map +1 -1
  95. package/Misc/snapshotRenderingHelper.js +3 -0
  96. package/Misc/snapshotRenderingHelper.js.map +1 -1
  97. package/Misc/textureTools.js.map +1 -1
  98. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  99. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.d.ts +1 -1
  100. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  101. package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
  102. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  103. package/PostProcesses/bloomMergePostProcess.js.map +1 -1
  104. package/PostProcesses/blurPostProcess.js.map +1 -1
  105. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  106. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  107. package/PostProcesses/convolutionPostProcess.js.map +1 -1
  108. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  109. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  110. package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
  111. package/PostProcesses/fxaaPostProcess.js.map +1 -1
  112. package/PostProcesses/grainPostProcess.js.map +1 -1
  113. package/PostProcesses/highlightsPostProcess.d.ts +1 -1
  114. package/PostProcesses/highlightsPostProcess.js +1 -1
  115. package/PostProcesses/highlightsPostProcess.js.map +1 -1
  116. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  117. package/PostProcesses/motionBlurPostProcess.js.map +1 -1
  118. package/PostProcesses/passPostProcess.js.map +1 -1
  119. package/PostProcesses/postProcess.d.ts +1 -1
  120. package/PostProcesses/postProcess.js.map +1 -1
  121. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  122. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  123. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  124. package/PostProcesses/subSurfaceScatteringPostProcess.js.map +1 -1
  125. package/PostProcesses/tonemapPostProcess.d.ts +1 -1
  126. package/PostProcesses/tonemapPostProcess.js +1 -1
  127. package/PostProcesses/tonemapPostProcess.js.map +1 -1
  128. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  129. package/Rendering/IBLShadows/iblShadowsImportanceSamplingRenderer.js.map +1 -1
  130. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  131. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js.map +1 -1
  132. package/Rendering/prePassRenderer.js.map +1 -1
  133. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"environmentHelper.js","sourceRoot":"","sources":["../../../../dev/core/src/Helpers/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Y,WAAW,EAAE,CAAC;YACrD,IAAI,CAAC,eAAe,CAAC,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;YACrE,OAAO;QACX,CAAC;QAED,IAAI,CAAC,cAAc,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAChJ,IAAI,CAAC,cAAc,CAAC,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;QAC1D,IAAI,CAAC,cAAc,CAAC,UAAU,GAAG,KAAK,CAAC;QACvC,IAAI,CAAC,eAAe,CAAC,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC;IACjE,CAAC;IAMD;;OAEG;IACI,OAAO;QACV,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;;AAzgBD;;GAEG;AACY,sCAAoB,GAAG,gEAAgE,AAAnE,CAAoE;AAEvG;;GAEG;AACY,sCAAoB,GAAG,gEAAgE,AAAnE,CAAoE;AAEvG;;GAEG;AACY,2CAAyB,GAAG,mEAAmE,AAAtE,CAAuE","sourcesContent":["import { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport { ArcRotateCamera } from \"../Cameras/arcRotateCamera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../Meshes/mesh\";\r\nimport { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { MirrorTexture } from \"../Materials/Textures/mirrorTexture\";\r\nimport { CubeTexture } from \"../Materials/Textures/cubeTexture\";\r\nimport { BackgroundMaterial } from \"../Materials/Background/backgroundMaterial\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { CreatePlane } from \"../Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"../Meshes/Builders/boxBuilder\";\r\nimport { Plane } from \"../Maths/math.plane\";\r\n\r\n/**\r\n * Represents the different options available during the creation of\r\n * a Environment helper.\r\n *\r\n * This can control the default ground, skybox and image processing setup of your scene.\r\n */\r\nexport interface IEnvironmentHelperOptions {\r\n /**\r\n * Specifies whether or not to create a ground.\r\n * True by default.\r\n */\r\n createGround: boolean;\r\n /**\r\n * Specifies the ground size.\r\n * 15 by default.\r\n */\r\n groundSize: number;\r\n /**\r\n * The texture used on the ground for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n groundTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the ground texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n groundColor: Color3;\r\n /**\r\n * Specifies the ground opacity.\r\n * 1 by default.\r\n */\r\n groundOpacity: number;\r\n /**\r\n * Enables the ground to receive shadows.\r\n * True by default.\r\n */\r\n enableGroundShadow: boolean;\r\n /**\r\n * Helps preventing the shadow to be fully black on the ground.\r\n * 0.5 by default.\r\n */\r\n groundShadowLevel: number;\r\n /**\r\n * Creates a mirror texture attach to the ground.\r\n * false by default.\r\n */\r\n enableGroundMirror: boolean;\r\n /**\r\n * Specifies the ground mirror size ratio.\r\n * 0.3 by default as the default kernel is 64.\r\n */\r\n groundMirrorSizeRatio: number;\r\n /**\r\n * Specifies the ground mirror blur kernel size.\r\n * 64 by default.\r\n */\r\n groundMirrorBlurKernel: number;\r\n /**\r\n * Specifies the ground mirror visibility amount.\r\n * 1 by default\r\n */\r\n groundMirrorAmount: number;\r\n /**\r\n * Specifies the ground mirror reflectance weight.\r\n * This uses the standard weight of the background material to setup the fresnel effect\r\n * of the mirror.\r\n * 1 by default.\r\n */\r\n groundMirrorFresnelWeight: number;\r\n /**\r\n * Specifies the ground mirror Falloff distance.\r\n * This can helps reducing the size of the reflection.\r\n * 0 by Default.\r\n */\r\n groundMirrorFallOffDistance: number;\r\n /**\r\n * Specifies the ground mirror texture type.\r\n * Unsigned Int by Default.\r\n */\r\n groundMirrorTextureType: number;\r\n /**\r\n * Specifies a bias applied to the ground vertical position to prevent z-fighting with\r\n * the shown objects.\r\n */\r\n groundYBias: number;\r\n\r\n /**\r\n * Specifies whether or not to create a skybox.\r\n * True by default.\r\n */\r\n createSkybox: boolean;\r\n /**\r\n * Specifies the skybox size.\r\n * 20 by default.\r\n */\r\n skyboxSize: number;\r\n /**\r\n * The texture used on the skybox for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n skyboxTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the skybox texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n skyboxColor: Color3;\r\n\r\n /**\r\n * The background rotation around the Y axis of the scene.\r\n * This helps aligning the key lights of your scene with the background.\r\n * 0 by default.\r\n */\r\n backgroundYRotation: number;\r\n\r\n /**\r\n * Compute automatically the size of the elements to best fit with the scene.\r\n */\r\n sizeAuto: boolean;\r\n\r\n /**\r\n * Default position of the rootMesh if autoSize is not true.\r\n */\r\n rootPosition: Vector3;\r\n\r\n /**\r\n * Sets up the image processing in the scene.\r\n * true by default.\r\n */\r\n setupImageProcessing: boolean;\r\n\r\n /**\r\n * The texture used as your environment texture in the scene.\r\n * Comes from the BabylonJS CDN by default and in use if setupImageProcessing is true.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n environmentTexture: string | BaseTexture;\r\n\r\n /**\r\n * The value of the exposure to apply to the scene.\r\n * 0.6 by default if setupImageProcessing is true.\r\n */\r\n cameraExposure: number;\r\n\r\n /**\r\n * The value of the contrast to apply to the scene.\r\n * 1.6 by default if setupImageProcessing is true.\r\n */\r\n cameraContrast: number;\r\n\r\n /**\r\n * Specifies whether or not tonemapping should be enabled in the scene.\r\n * true by default if setupImageProcessing is true.\r\n */\r\n toneMappingEnabled: boolean;\r\n}\r\n\r\ninterface ISceneSize {\r\n groundSize: number;\r\n skyboxSize: number;\r\n rootPosition: Vector3;\r\n}\r\n\r\n/**\r\n * The EnvironmentHelper class can be used to add a fully featured non-expensive background to your scene.\r\n * It includes by default a skybox and a ground relying on the BackgroundMaterial.\r\n * It also helps with the default setup of your ImageProcessingConfiguration.\r\n */\r\nexport class EnvironmentHelper {\r\n /**\r\n * Default ground texture URL.\r\n */\r\n private static _GroundTextureCDNUrl = \"https://assets.babylonjs.com/environments/backgroundGround.png\";\r\n\r\n /**\r\n * Default skybox texture URL.\r\n */\r\n private static _SkyboxTextureCDNUrl = \"https://assets.babylonjs.com/environments/backgroundSkybox.dds\";\r\n\r\n /**\r\n * Default environment texture URL.\r\n */\r\n private static _EnvironmentTextureCDNUrl = \"https://assets.babylonjs.com/environments/environmentSpecular.env\";\r\n\r\n /**\r\n * Creates the default options for the helper.\r\n * @param scene The scene the environment helper belongs to.\r\n * @returns default options for the helper.\r\n */\r\n private static _GetDefaultOptions(scene: Scene): IEnvironmentHelperOptions {\r\n return {\r\n createGround: true,\r\n groundSize: 15,\r\n groundTexture: this._GroundTextureCDNUrl,\r\n groundColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n groundOpacity: 0.9,\r\n enableGroundShadow: true,\r\n groundShadowLevel: 0.5,\r\n\r\n enableGroundMirror: false,\r\n groundMirrorSizeRatio: 0.3,\r\n groundMirrorBlurKernel: 64,\r\n groundMirrorAmount: 1,\r\n groundMirrorFresnelWeight: 1,\r\n groundMirrorFallOffDistance: 0,\r\n groundMirrorTextureType: Constants.TEXTURETYPE_UNSIGNED_INT,\r\n\r\n groundYBias: 0.00001,\r\n\r\n createSkybox: true,\r\n skyboxSize: 20,\r\n skyboxTexture: this._SkyboxTextureCDNUrl,\r\n skyboxColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n\r\n backgroundYRotation: 0,\r\n sizeAuto: true,\r\n rootPosition: Vector3.Zero(),\r\n\r\n setupImageProcessing: true,\r\n environmentTexture: this._EnvironmentTextureCDNUrl,\r\n cameraExposure: 0.8,\r\n cameraContrast: 1.2,\r\n toneMappingEnabled: true,\r\n };\r\n }\r\n\r\n private _rootMesh: Mesh;\r\n /**\r\n * Gets the root mesh created by the helper.\r\n */\r\n public get rootMesh(): Mesh {\r\n return this._rootMesh;\r\n }\r\n\r\n private _skybox: Nullable<Mesh>;\r\n /**\r\n * Gets the skybox created by the helper.\r\n */\r\n public get skybox(): Nullable<Mesh> {\r\n return this._skybox;\r\n }\r\n\r\n private _skyboxTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the skybox texture created by the helper.\r\n */\r\n public get skyboxTexture(): Nullable<BaseTexture> {\r\n return this._skyboxTexture;\r\n }\r\n\r\n private _skyboxMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the skybox material created by the helper.\r\n */\r\n public get skyboxMaterial(): Nullable<BackgroundMaterial> {\r\n return this._skyboxMaterial;\r\n }\r\n\r\n private _ground: Nullable<Mesh>;\r\n /**\r\n * Gets the ground mesh created by the helper.\r\n */\r\n public get ground(): Nullable<Mesh> {\r\n return this._ground;\r\n }\r\n\r\n private _groundTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the ground texture created by the helper.\r\n */\r\n public get groundTexture(): Nullable<BaseTexture> {\r\n return this._groundTexture;\r\n }\r\n\r\n private _groundMirror: Nullable<MirrorTexture>;\r\n /**\r\n * Gets the ground mirror created by the helper.\r\n */\r\n public get groundMirror(): Nullable<MirrorTexture> {\r\n return this._groundMirror;\r\n }\r\n\r\n /**\r\n * Gets the ground mirror render list to helps pushing the meshes\r\n * you wish in the ground reflection.\r\n */\r\n public get groundMirrorRenderList(): Nullable<AbstractMesh[]> {\r\n if (this._groundMirror) {\r\n return this._groundMirror.renderList;\r\n }\r\n return null;\r\n }\r\n\r\n private _groundMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the ground material created by the helper.\r\n */\r\n public get groundMaterial(): Nullable<BackgroundMaterial> {\r\n return this._groundMaterial;\r\n }\r\n\r\n /**\r\n * Stores the creation options.\r\n */\r\n private readonly _scene: Scene;\r\n private _options: IEnvironmentHelperOptions;\r\n\r\n /**\r\n * This observable will be notified with any error during the creation of the environment,\r\n * mainly texture creation errors.\r\n */\r\n public onErrorObservable: Observable<{ message?: string; exception?: any }>;\r\n\r\n /**\r\n * constructor\r\n * @param options Defines the options we want to customize the helper\r\n * @param scene The scene to add the material to\r\n */\r\n constructor(options: Partial<IEnvironmentHelperOptions>, scene: Scene) {\r\n this._options = {\r\n ...EnvironmentHelper._GetDefaultOptions(scene),\r\n ...options,\r\n };\r\n this._scene = scene;\r\n this.onErrorObservable = new Observable();\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Updates the environment according to the new options\r\n * @param options options to configure the helper (IEnvironmentHelperOptions)\r\n */\r\n public updateOptions(options: Partial<IEnvironmentHelperOptions>) {\r\n const newOptions = {\r\n ...this._options,\r\n ...options,\r\n };\r\n\r\n if (this._ground && !newOptions.createGround) {\r\n this._ground.dispose();\r\n this._ground = null;\r\n }\r\n\r\n if (this._groundMaterial && !newOptions.createGround) {\r\n this._groundMaterial.dispose();\r\n this._groundMaterial = null;\r\n }\r\n\r\n if (this._groundTexture) {\r\n if (this._options.groundTexture != newOptions.groundTexture) {\r\n this._groundTexture.dispose();\r\n this._groundTexture = null;\r\n }\r\n }\r\n\r\n if (this._skybox && !newOptions.createSkybox) {\r\n this._skybox.dispose();\r\n this._skybox = null;\r\n }\r\n\r\n if (this._skyboxMaterial && !newOptions.createSkybox) {\r\n this._skyboxMaterial.dispose();\r\n this._skyboxMaterial = null;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n if (this._options.skyboxTexture != newOptions.skyboxTexture) {\r\n this._skyboxTexture.dispose();\r\n this._skyboxTexture = null;\r\n }\r\n }\r\n\r\n if (this._groundMirror && !newOptions.enableGroundMirror) {\r\n this._groundMirror.dispose();\r\n this._groundMirror = null;\r\n }\r\n\r\n if (this._scene.environmentTexture) {\r\n if (this._options.environmentTexture != newOptions.environmentTexture) {\r\n this._scene.environmentTexture.dispose();\r\n }\r\n }\r\n\r\n this._options = newOptions;\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Sets the primary color of all the available elements.\r\n * @param color the main color to affect to the ground and the background\r\n */\r\n public setMainColor(color: Color3): void {\r\n if (this.groundMaterial) {\r\n this.groundMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.skyboxMaterial) {\r\n this.skyboxMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.groundMirror) {\r\n this.groundMirror.clearColor = new Color4(color.r, color.g, color.b, 1.0);\r\n }\r\n }\r\n\r\n /**\r\n * Setup the image processing according to the specified options.\r\n */\r\n private _setupImageProcessing(): void {\r\n if (this._options.setupImageProcessing) {\r\n this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast;\r\n this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure;\r\n this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled;\r\n this._setupEnvironmentTexture();\r\n }\r\n }\r\n\r\n /**\r\n * Setup the environment texture according to the specified options.\r\n */\r\n private _setupEnvironmentTexture(): void {\r\n if (this._scene.environmentTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.environmentTexture instanceof BaseTexture) {\r\n this._scene.environmentTexture = this._options.environmentTexture;\r\n return;\r\n }\r\n\r\n const environmentTexture = CubeTexture.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);\r\n this._scene.environmentTexture = environmentTexture;\r\n }\r\n\r\n /**\r\n * Setup the background according to the specified options.\r\n */\r\n private _setupBackground(): void {\r\n if (!this._rootMesh) {\r\n this._rootMesh = new Mesh(\"BackgroundHelper\", this._scene);\r\n }\r\n this._rootMesh.rotation.y = this._options.backgroundYRotation;\r\n\r\n const sceneSize = this._getSceneSize();\r\n if (this._options.createGround) {\r\n this._setupGround(sceneSize);\r\n this._setupGroundMaterial();\r\n this._setupGroundDiffuseTexture();\r\n\r\n if (this._options.enableGroundMirror) {\r\n this._setupGroundMirrorTexture(sceneSize);\r\n }\r\n this._setupMirrorInGroundMaterial();\r\n }\r\n\r\n if (this._options.createSkybox) {\r\n this._setupSkybox(sceneSize);\r\n this._setupSkyboxMaterial();\r\n this._setupSkyboxReflectionTexture();\r\n }\r\n\r\n this._rootMesh.position.x = sceneSize.rootPosition.x;\r\n this._rootMesh.position.z = sceneSize.rootPosition.z;\r\n this._rootMesh.position.y = sceneSize.rootPosition.y;\r\n }\r\n\r\n /**\r\n * Get the scene sizes according to the setup.\r\n * @returns the different ground and skybox sizes.\r\n */\r\n private _getSceneSize(): ISceneSize {\r\n let groundSize = this._options.groundSize;\r\n let skyboxSize = this._options.skyboxSize;\r\n let rootPosition = this._options.rootPosition;\r\n if (!this._scene.meshes || this._scene.meshes.length === 1) {\r\n // 1 only means the root of the helper.\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n const sceneExtends = this._scene.getWorldExtends((mesh) => {\r\n return mesh !== this._ground && mesh !== this._rootMesh && mesh !== this._skybox;\r\n });\r\n const sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);\r\n\r\n if (this._options.sizeAuto) {\r\n if (this._scene.activeCamera instanceof ArcRotateCamera && this._scene.activeCamera.upperRadiusLimit) {\r\n groundSize = this._scene.activeCamera.upperRadiusLimit * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n const sceneDiagonalLenght = sceneDiagonal.length();\r\n if (sceneDiagonalLenght > groundSize) {\r\n groundSize = sceneDiagonalLenght * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n // 10 % bigger.\r\n groundSize *= 1.1;\r\n skyboxSize *= 1.5;\r\n rootPosition = sceneExtends.min.add(sceneDiagonal.scale(0.5));\r\n rootPosition.y = sceneExtends.min.y - this._options.groundYBias;\r\n }\r\n\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n /**\r\n * Setup the ground according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGround(sceneSize: ISceneSize): void {\r\n if (!this._ground || this._ground.isDisposed()) {\r\n this._ground = CreatePlane(\"BackgroundPlane\", { size: sceneSize.groundSize }, this._scene);\r\n this._ground.rotation.x = Math.PI / 2; // Face up by default.\r\n this._ground.isPickable = false;\r\n this._ground.parent = this._rootMesh;\r\n this._ground.onDisposeObservable.add(() => {\r\n this._ground = null;\r\n });\r\n }\r\n\r\n this._ground.receiveShadows = this._options.enableGroundShadow;\r\n }\r\n\r\n /**\r\n * Setup the ground material according to the specified options.\r\n */\r\n private _setupGroundMaterial(): void {\r\n if (!this._groundMaterial) {\r\n this._groundMaterial = new BackgroundMaterial(\"BackgroundPlaneMaterial\", this._scene);\r\n }\r\n this._groundMaterial.alpha = this._options.groundOpacity;\r\n this._groundMaterial.alphaMode = Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;\r\n this._groundMaterial.shadowLevel = this._options.groundShadowLevel;\r\n this._groundMaterial.primaryColor = this._options.groundColor;\r\n this._groundMaterial.useRGBColor = false;\r\n this._groundMaterial.enableNoise = true;\r\n\r\n if (this._ground) {\r\n this._ground.material = this._groundMaterial;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the ground diffuse texture according to the specified options.\r\n */\r\n private _setupGroundDiffuseTexture(): void {\r\n if (!this._groundMaterial) {\r\n return;\r\n }\r\n\r\n if (this._groundTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.groundTexture instanceof BaseTexture) {\r\n this._groundMaterial.diffuseTexture = this._options.groundTexture;\r\n return;\r\n }\r\n\r\n this._groundTexture = new Texture(this._options.groundTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._groundTexture.gammaSpace = false;\r\n this._groundTexture.hasAlpha = true;\r\n this._groundMaterial.diffuseTexture = this._groundTexture;\r\n }\r\n\r\n /**\r\n * Setup the ground mirror texture according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGroundMirrorTexture(sceneSize: ISceneSize): void {\r\n const wrapping = Texture.CLAMP_ADDRESSMODE;\r\n if (!this._groundMirror) {\r\n this._groundMirror = new MirrorTexture(\r\n \"BackgroundPlaneMirrorTexture\",\r\n { ratio: this._options.groundMirrorSizeRatio },\r\n this._scene,\r\n false,\r\n this._options.groundMirrorTextureType,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n true\r\n );\r\n this._groundMirror.mirrorPlane = new Plane(0, -1, 0, sceneSize.rootPosition.y);\r\n this._groundMirror.anisotropicFilteringLevel = 1;\r\n this._groundMirror.wrapU = wrapping;\r\n this._groundMirror.wrapV = wrapping;\r\n\r\n if (this._groundMirror.renderList) {\r\n for (let i = 0; i < this._scene.meshes.length; i++) {\r\n const mesh = this._scene.meshes[i];\r\n if (mesh !== this._ground && mesh !== this._skybox && mesh !== this._rootMesh) {\r\n this._groundMirror.renderList.push(mesh);\r\n }\r\n }\r\n }\r\n }\r\n\r\n const gammaGround = this._options.groundColor.toGammaSpace(this._scene.getEngine().useExactSrgbConversions);\r\n this._groundMirror.clearColor = new Color4(gammaGround.r, gammaGround.g, gammaGround.b, 1);\r\n this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;\r\n }\r\n\r\n /**\r\n * Setup the ground to receive the mirror texture.\r\n */\r\n private _setupMirrorInGroundMaterial(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.reflectionTexture = this._groundMirror;\r\n this._groundMaterial.reflectionFresnel = true;\r\n this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount;\r\n this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight;\r\n this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the skybox according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupSkybox(sceneSize: ISceneSize): void {\r\n if (!this._skybox || this._skybox.isDisposed()) {\r\n this._skybox = CreateBox(\"BackgroundSkybox\", { size: sceneSize.skyboxSize, sideOrientation: Mesh.BACKSIDE }, this._scene);\r\n this._skybox.isPickable = false;\r\n this._skybox.onDisposeObservable.add(() => {\r\n this._skybox = null;\r\n });\r\n }\r\n this._skybox.parent = this._rootMesh;\r\n }\r\n\r\n /**\r\n * Setup the skybox material according to the specified options.\r\n */\r\n private _setupSkyboxMaterial(): void {\r\n if (!this._skybox) {\r\n return;\r\n }\r\n\r\n if (!this._skyboxMaterial) {\r\n this._skyboxMaterial = new BackgroundMaterial(\"BackgroundSkyboxMaterial\", this._scene);\r\n }\r\n this._skyboxMaterial.useRGBColor = false;\r\n this._skyboxMaterial.primaryColor = this._options.skyboxColor;\r\n this._skyboxMaterial.enableNoise = true;\r\n\r\n this._skybox.material = this._skyboxMaterial;\r\n }\r\n\r\n /**\r\n * Setup the skybox reflection texture according to the specified options.\r\n */\r\n private _setupSkyboxReflectionTexture(): void {\r\n if (!this._skyboxMaterial) {\r\n return;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.skyboxTexture instanceof BaseTexture) {\r\n this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture;\r\n return;\r\n }\r\n\r\n this._skyboxTexture = new CubeTexture(this._options.skyboxTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._skyboxTexture.coordinatesMode = Texture.SKYBOX_MODE;\r\n this._skyboxTexture.gammaSpace = false;\r\n this._skyboxMaterial.reflectionTexture = this._skyboxTexture;\r\n }\r\n\r\n private _errorHandler = (message?: string, exception?: any) => {\r\n this.onErrorObservable.notifyObservers({ message: message, exception: exception });\r\n };\r\n\r\n /**\r\n * Dispose all the elements created by the Helper.\r\n */\r\n public dispose(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.dispose(true, true);\r\n }\r\n if (this._skyboxMaterial) {\r\n this._skyboxMaterial.dispose(true, true);\r\n }\r\n this._rootMesh.dispose(false);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"environmentHelper.js","sourceRoot":"","sources":["../../../../dev/core/src/Helpers/environmentHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAyK5C;;;;GAIG;AACH,MAAM,OAAO,iBAAiB;IAgB1B;;;;OAIG;IACK,MAAM,CAAC,kBA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,CAAC,CAAC;IAClC,CAAC;;AAzgBD;;GAEG;AACY,sCAAoB,GAAG,gEAAgE,AAAnE,CAAoE;AAEvG;;GAEG;AACY,sCAAoB,GAAG,gEAAgE,AAAnE,CAAoE;AAEvG;;GAEG;AACY,2CAAyB,GAAG,mEAAmE,AAAtE,CAAuE","sourcesContent":["import { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport { ArcRotateCamera } from \"../Cameras/arcRotateCamera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../Meshes/mesh\";\r\nimport { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { MirrorTexture } from \"../Materials/Textures/mirrorTexture\";\r\nimport { CubeTexture } from \"../Materials/Textures/cubeTexture\";\r\nimport { BackgroundMaterial } from \"../Materials/Background/backgroundMaterial\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { CreatePlane } from \"../Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"../Meshes/Builders/boxBuilder\";\r\nimport { Plane } from \"../Maths/math.plane\";\r\n\r\n/**\r\n * Represents the different options available during the creation of\r\n * a Environment helper.\r\n *\r\n * This can control the default ground, skybox and image processing setup of your scene.\r\n */\r\nexport interface IEnvironmentHelperOptions {\r\n /**\r\n * Specifies whether or not to create a ground.\r\n * True by default.\r\n */\r\n createGround: boolean;\r\n /**\r\n * Specifies the ground size.\r\n * 15 by default.\r\n */\r\n groundSize: number;\r\n /**\r\n * The texture used on the ground for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n groundTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the ground texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n groundColor: Color3;\r\n /**\r\n * Specifies the ground opacity.\r\n * 1 by default.\r\n */\r\n groundOpacity: number;\r\n /**\r\n * Enables the ground to receive shadows.\r\n * True by default.\r\n */\r\n enableGroundShadow: boolean;\r\n /**\r\n * Helps preventing the shadow to be fully black on the ground.\r\n * 0.5 by default.\r\n */\r\n groundShadowLevel: number;\r\n /**\r\n * Creates a mirror texture attach to the ground.\r\n * false by default.\r\n */\r\n enableGroundMirror: boolean;\r\n /**\r\n * Specifies the ground mirror size ratio.\r\n * 0.3 by default as the default kernel is 64.\r\n */\r\n groundMirrorSizeRatio: number;\r\n /**\r\n * Specifies the ground mirror blur kernel size.\r\n * 64 by default.\r\n */\r\n groundMirrorBlurKernel: number;\r\n /**\r\n * Specifies the ground mirror visibility amount.\r\n * 1 by default\r\n */\r\n groundMirrorAmount: number;\r\n /**\r\n * Specifies the ground mirror reflectance weight.\r\n * This uses the standard weight of the background material to setup the fresnel effect\r\n * of the mirror.\r\n * 1 by default.\r\n */\r\n groundMirrorFresnelWeight: number;\r\n /**\r\n * Specifies the ground mirror Falloff distance.\r\n * This can helps reducing the size of the reflection.\r\n * 0 by Default.\r\n */\r\n groundMirrorFallOffDistance: number;\r\n /**\r\n * Specifies the ground mirror texture type.\r\n * Unsigned Int by Default.\r\n */\r\n groundMirrorTextureType: number;\r\n /**\r\n * Specifies a bias applied to the ground vertical position to prevent z-fighting with\r\n * the shown objects.\r\n */\r\n groundYBias: number;\r\n\r\n /**\r\n * Specifies whether or not to create a skybox.\r\n * True by default.\r\n */\r\n createSkybox: boolean;\r\n /**\r\n * Specifies the skybox size.\r\n * 20 by default.\r\n */\r\n skyboxSize: number;\r\n /**\r\n * The texture used on the skybox for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n skyboxTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the skybox texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n skyboxColor: Color3;\r\n\r\n /**\r\n * The background rotation around the Y axis of the scene.\r\n * This helps aligning the key lights of your scene with the background.\r\n * 0 by default.\r\n */\r\n backgroundYRotation: number;\r\n\r\n /**\r\n * Compute automatically the size of the elements to best fit with the scene.\r\n */\r\n sizeAuto: boolean;\r\n\r\n /**\r\n * Default position of the rootMesh if autoSize is not true.\r\n */\r\n rootPosition: Vector3;\r\n\r\n /**\r\n * Sets up the image processing in the scene.\r\n * true by default.\r\n */\r\n setupImageProcessing: boolean;\r\n\r\n /**\r\n * The texture used as your environment texture in the scene.\r\n * Comes from the BabylonJS CDN by default and in use if setupImageProcessing is true.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n environmentTexture: string | BaseTexture;\r\n\r\n /**\r\n * The value of the exposure to apply to the scene.\r\n * 0.6 by default if setupImageProcessing is true.\r\n */\r\n cameraExposure: number;\r\n\r\n /**\r\n * The value of the contrast to apply to the scene.\r\n * 1.6 by default if setupImageProcessing is true.\r\n */\r\n cameraContrast: number;\r\n\r\n /**\r\n * Specifies whether or not tonemapping should be enabled in the scene.\r\n * true by default if setupImageProcessing is true.\r\n */\r\n toneMappingEnabled: boolean;\r\n}\r\n\r\ninterface ISceneSize {\r\n groundSize: number;\r\n skyboxSize: number;\r\n rootPosition: Vector3;\r\n}\r\n\r\n/**\r\n * The EnvironmentHelper class can be used to add a fully featured non-expensive background to your scene.\r\n * It includes by default a skybox and a ground relying on the BackgroundMaterial.\r\n * It also helps with the default setup of your ImageProcessingConfiguration.\r\n */\r\nexport class EnvironmentHelper {\r\n /**\r\n * Default ground texture URL.\r\n */\r\n private static _GroundTextureCDNUrl = \"https://assets.babylonjs.com/environments/backgroundGround.png\";\r\n\r\n /**\r\n * Default skybox texture URL.\r\n */\r\n private static _SkyboxTextureCDNUrl = \"https://assets.babylonjs.com/environments/backgroundSkybox.dds\";\r\n\r\n /**\r\n * Default environment texture URL.\r\n */\r\n private static _EnvironmentTextureCDNUrl = \"https://assets.babylonjs.com/environments/environmentSpecular.env\";\r\n\r\n /**\r\n * Creates the default options for the helper.\r\n * @param scene The scene the environment helper belongs to.\r\n * @returns default options for the helper.\r\n */\r\n private static _GetDefaultOptions(scene: Scene): IEnvironmentHelperOptions {\r\n return {\r\n createGround: true,\r\n groundSize: 15,\r\n groundTexture: this._GroundTextureCDNUrl,\r\n groundColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n groundOpacity: 0.9,\r\n enableGroundShadow: true,\r\n groundShadowLevel: 0.5,\r\n\r\n enableGroundMirror: false,\r\n groundMirrorSizeRatio: 0.3,\r\n groundMirrorBlurKernel: 64,\r\n groundMirrorAmount: 1,\r\n groundMirrorFresnelWeight: 1,\r\n groundMirrorFallOffDistance: 0,\r\n groundMirrorTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n\r\n groundYBias: 0.00001,\r\n\r\n createSkybox: true,\r\n skyboxSize: 20,\r\n skyboxTexture: this._SkyboxTextureCDNUrl,\r\n skyboxColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n\r\n backgroundYRotation: 0,\r\n sizeAuto: true,\r\n rootPosition: Vector3.Zero(),\r\n\r\n setupImageProcessing: true,\r\n environmentTexture: this._EnvironmentTextureCDNUrl,\r\n cameraExposure: 0.8,\r\n cameraContrast: 1.2,\r\n toneMappingEnabled: true,\r\n };\r\n }\r\n\r\n private _rootMesh: Mesh;\r\n /**\r\n * Gets the root mesh created by the helper.\r\n */\r\n public get rootMesh(): Mesh {\r\n return this._rootMesh;\r\n }\r\n\r\n private _skybox: Nullable<Mesh>;\r\n /**\r\n * Gets the skybox created by the helper.\r\n */\r\n public get skybox(): Nullable<Mesh> {\r\n return this._skybox;\r\n }\r\n\r\n private _skyboxTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the skybox texture created by the helper.\r\n */\r\n public get skyboxTexture(): Nullable<BaseTexture> {\r\n return this._skyboxTexture;\r\n }\r\n\r\n private _skyboxMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the skybox material created by the helper.\r\n */\r\n public get skyboxMaterial(): Nullable<BackgroundMaterial> {\r\n return this._skyboxMaterial;\r\n }\r\n\r\n private _ground: Nullable<Mesh>;\r\n /**\r\n * Gets the ground mesh created by the helper.\r\n */\r\n public get ground(): Nullable<Mesh> {\r\n return this._ground;\r\n }\r\n\r\n private _groundTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the ground texture created by the helper.\r\n */\r\n public get groundTexture(): Nullable<BaseTexture> {\r\n return this._groundTexture;\r\n }\r\n\r\n private _groundMirror: Nullable<MirrorTexture>;\r\n /**\r\n * Gets the ground mirror created by the helper.\r\n */\r\n public get groundMirror(): Nullable<MirrorTexture> {\r\n return this._groundMirror;\r\n }\r\n\r\n /**\r\n * Gets the ground mirror render list to helps pushing the meshes\r\n * you wish in the ground reflection.\r\n */\r\n public get groundMirrorRenderList(): Nullable<AbstractMesh[]> {\r\n if (this._groundMirror) {\r\n return this._groundMirror.renderList;\r\n }\r\n return null;\r\n }\r\n\r\n private _groundMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the ground material created by the helper.\r\n */\r\n public get groundMaterial(): Nullable<BackgroundMaterial> {\r\n return this._groundMaterial;\r\n }\r\n\r\n /**\r\n * Stores the creation options.\r\n */\r\n private readonly _scene: Scene;\r\n private _options: IEnvironmentHelperOptions;\r\n\r\n /**\r\n * This observable will be notified with any error during the creation of the environment,\r\n * mainly texture creation errors.\r\n */\r\n public onErrorObservable: Observable<{ message?: string; exception?: any }>;\r\n\r\n /**\r\n * constructor\r\n * @param options Defines the options we want to customize the helper\r\n * @param scene The scene to add the material to\r\n */\r\n constructor(options: Partial<IEnvironmentHelperOptions>, scene: Scene) {\r\n this._options = {\r\n ...EnvironmentHelper._GetDefaultOptions(scene),\r\n ...options,\r\n };\r\n this._scene = scene;\r\n this.onErrorObservable = new Observable();\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Updates the environment according to the new options\r\n * @param options options to configure the helper (IEnvironmentHelperOptions)\r\n */\r\n public updateOptions(options: Partial<IEnvironmentHelperOptions>) {\r\n const newOptions = {\r\n ...this._options,\r\n ...options,\r\n };\r\n\r\n if (this._ground && !newOptions.createGround) {\r\n this._ground.dispose();\r\n this._ground = null;\r\n }\r\n\r\n if (this._groundMaterial && !newOptions.createGround) {\r\n this._groundMaterial.dispose();\r\n this._groundMaterial = null;\r\n }\r\n\r\n if (this._groundTexture) {\r\n if (this._options.groundTexture != newOptions.groundTexture) {\r\n this._groundTexture.dispose();\r\n this._groundTexture = null;\r\n }\r\n }\r\n\r\n if (this._skybox && !newOptions.createSkybox) {\r\n this._skybox.dispose();\r\n this._skybox = null;\r\n }\r\n\r\n if (this._skyboxMaterial && !newOptions.createSkybox) {\r\n this._skyboxMaterial.dispose();\r\n this._skyboxMaterial = null;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n if (this._options.skyboxTexture != newOptions.skyboxTexture) {\r\n this._skyboxTexture.dispose();\r\n this._skyboxTexture = null;\r\n }\r\n }\r\n\r\n if (this._groundMirror && !newOptions.enableGroundMirror) {\r\n this._groundMirror.dispose();\r\n this._groundMirror = null;\r\n }\r\n\r\n if (this._scene.environmentTexture) {\r\n if (this._options.environmentTexture != newOptions.environmentTexture) {\r\n this._scene.environmentTexture.dispose();\r\n }\r\n }\r\n\r\n this._options = newOptions;\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Sets the primary color of all the available elements.\r\n * @param color the main color to affect to the ground and the background\r\n */\r\n public setMainColor(color: Color3): void {\r\n if (this.groundMaterial) {\r\n this.groundMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.skyboxMaterial) {\r\n this.skyboxMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.groundMirror) {\r\n this.groundMirror.clearColor = new Color4(color.r, color.g, color.b, 1.0);\r\n }\r\n }\r\n\r\n /**\r\n * Setup the image processing according to the specified options.\r\n */\r\n private _setupImageProcessing(): void {\r\n if (this._options.setupImageProcessing) {\r\n this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast;\r\n this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure;\r\n this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled;\r\n this._setupEnvironmentTexture();\r\n }\r\n }\r\n\r\n /**\r\n * Setup the environment texture according to the specified options.\r\n */\r\n private _setupEnvironmentTexture(): void {\r\n if (this._scene.environmentTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.environmentTexture instanceof BaseTexture) {\r\n this._scene.environmentTexture = this._options.environmentTexture;\r\n return;\r\n }\r\n\r\n const environmentTexture = CubeTexture.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);\r\n this._scene.environmentTexture = environmentTexture;\r\n }\r\n\r\n /**\r\n * Setup the background according to the specified options.\r\n */\r\n private _setupBackground(): void {\r\n if (!this._rootMesh) {\r\n this._rootMesh = new Mesh(\"BackgroundHelper\", this._scene);\r\n }\r\n this._rootMesh.rotation.y = this._options.backgroundYRotation;\r\n\r\n const sceneSize = this._getSceneSize();\r\n if (this._options.createGround) {\r\n this._setupGround(sceneSize);\r\n this._setupGroundMaterial();\r\n this._setupGroundDiffuseTexture();\r\n\r\n if (this._options.enableGroundMirror) {\r\n this._setupGroundMirrorTexture(sceneSize);\r\n }\r\n this._setupMirrorInGroundMaterial();\r\n }\r\n\r\n if (this._options.createSkybox) {\r\n this._setupSkybox(sceneSize);\r\n this._setupSkyboxMaterial();\r\n this._setupSkyboxReflectionTexture();\r\n }\r\n\r\n this._rootMesh.position.x = sceneSize.rootPosition.x;\r\n this._rootMesh.position.z = sceneSize.rootPosition.z;\r\n this._rootMesh.position.y = sceneSize.rootPosition.y;\r\n }\r\n\r\n /**\r\n * Get the scene sizes according to the setup.\r\n * @returns the different ground and skybox sizes.\r\n */\r\n private _getSceneSize(): ISceneSize {\r\n let groundSize = this._options.groundSize;\r\n let skyboxSize = this._options.skyboxSize;\r\n let rootPosition = this._options.rootPosition;\r\n if (!this._scene.meshes || this._scene.meshes.length === 1) {\r\n // 1 only means the root of the helper.\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n const sceneExtends = this._scene.getWorldExtends((mesh) => {\r\n return mesh !== this._ground && mesh !== this._rootMesh && mesh !== this._skybox;\r\n });\r\n const sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);\r\n\r\n if (this._options.sizeAuto) {\r\n if (this._scene.activeCamera instanceof ArcRotateCamera && this._scene.activeCamera.upperRadiusLimit) {\r\n groundSize = this._scene.activeCamera.upperRadiusLimit * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n const sceneDiagonalLenght = sceneDiagonal.length();\r\n if (sceneDiagonalLenght > groundSize) {\r\n groundSize = sceneDiagonalLenght * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n // 10 % bigger.\r\n groundSize *= 1.1;\r\n skyboxSize *= 1.5;\r\n rootPosition = sceneExtends.min.add(sceneDiagonal.scale(0.5));\r\n rootPosition.y = sceneExtends.min.y - this._options.groundYBias;\r\n }\r\n\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n /**\r\n * Setup the ground according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGround(sceneSize: ISceneSize): void {\r\n if (!this._ground || this._ground.isDisposed()) {\r\n this._ground = CreatePlane(\"BackgroundPlane\", { size: sceneSize.groundSize }, this._scene);\r\n this._ground.rotation.x = Math.PI / 2; // Face up by default.\r\n this._ground.isPickable = false;\r\n this._ground.parent = this._rootMesh;\r\n this._ground.onDisposeObservable.add(() => {\r\n this._ground = null;\r\n });\r\n }\r\n\r\n this._ground.receiveShadows = this._options.enableGroundShadow;\r\n }\r\n\r\n /**\r\n * Setup the ground material according to the specified options.\r\n */\r\n private _setupGroundMaterial(): void {\r\n if (!this._groundMaterial) {\r\n this._groundMaterial = new BackgroundMaterial(\"BackgroundPlaneMaterial\", this._scene);\r\n }\r\n this._groundMaterial.alpha = this._options.groundOpacity;\r\n this._groundMaterial.alphaMode = Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;\r\n this._groundMaterial.shadowLevel = this._options.groundShadowLevel;\r\n this._groundMaterial.primaryColor = this._options.groundColor;\r\n this._groundMaterial.useRGBColor = false;\r\n this._groundMaterial.enableNoise = true;\r\n\r\n if (this._ground) {\r\n this._ground.material = this._groundMaterial;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the ground diffuse texture according to the specified options.\r\n */\r\n private _setupGroundDiffuseTexture(): void {\r\n if (!this._groundMaterial) {\r\n return;\r\n }\r\n\r\n if (this._groundTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.groundTexture instanceof BaseTexture) {\r\n this._groundMaterial.diffuseTexture = this._options.groundTexture;\r\n return;\r\n }\r\n\r\n this._groundTexture = new Texture(this._options.groundTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._groundTexture.gammaSpace = false;\r\n this._groundTexture.hasAlpha = true;\r\n this._groundMaterial.diffuseTexture = this._groundTexture;\r\n }\r\n\r\n /**\r\n * Setup the ground mirror texture according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGroundMirrorTexture(sceneSize: ISceneSize): void {\r\n const wrapping = Texture.CLAMP_ADDRESSMODE;\r\n if (!this._groundMirror) {\r\n this._groundMirror = new MirrorTexture(\r\n \"BackgroundPlaneMirrorTexture\",\r\n { ratio: this._options.groundMirrorSizeRatio },\r\n this._scene,\r\n false,\r\n this._options.groundMirrorTextureType,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n true\r\n );\r\n this._groundMirror.mirrorPlane = new Plane(0, -1, 0, sceneSize.rootPosition.y);\r\n this._groundMirror.anisotropicFilteringLevel = 1;\r\n this._groundMirror.wrapU = wrapping;\r\n this._groundMirror.wrapV = wrapping;\r\n\r\n if (this._groundMirror.renderList) {\r\n for (let i = 0; i < this._scene.meshes.length; i++) {\r\n const mesh = this._scene.meshes[i];\r\n if (mesh !== this._ground && mesh !== this._skybox && mesh !== this._rootMesh) {\r\n this._groundMirror.renderList.push(mesh);\r\n }\r\n }\r\n }\r\n }\r\n\r\n const gammaGround = this._options.groundColor.toGammaSpace(this._scene.getEngine().useExactSrgbConversions);\r\n this._groundMirror.clearColor = new Color4(gammaGround.r, gammaGround.g, gammaGround.b, 1);\r\n this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;\r\n }\r\n\r\n /**\r\n * Setup the ground to receive the mirror texture.\r\n */\r\n private _setupMirrorInGroundMaterial(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.reflectionTexture = this._groundMirror;\r\n this._groundMaterial.reflectionFresnel = true;\r\n this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount;\r\n this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight;\r\n this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the skybox according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupSkybox(sceneSize: ISceneSize): void {\r\n if (!this._skybox || this._skybox.isDisposed()) {\r\n this._skybox = CreateBox(\"BackgroundSkybox\", { size: sceneSize.skyboxSize, sideOrientation: Mesh.BACKSIDE }, this._scene);\r\n this._skybox.isPickable = false;\r\n this._skybox.onDisposeObservable.add(() => {\r\n this._skybox = null;\r\n });\r\n }\r\n this._skybox.parent = this._rootMesh;\r\n }\r\n\r\n /**\r\n * Setup the skybox material according to the specified options.\r\n */\r\n private _setupSkyboxMaterial(): void {\r\n if (!this._skybox) {\r\n return;\r\n }\r\n\r\n if (!this._skyboxMaterial) {\r\n this._skyboxMaterial = new BackgroundMaterial(\"BackgroundSkyboxMaterial\", this._scene);\r\n }\r\n this._skyboxMaterial.useRGBColor = false;\r\n this._skyboxMaterial.primaryColor = this._options.skyboxColor;\r\n this._skyboxMaterial.enableNoise = true;\r\n\r\n this._skybox.material = this._skyboxMaterial;\r\n }\r\n\r\n /**\r\n * Setup the skybox reflection texture according to the specified options.\r\n */\r\n private _setupSkyboxReflectionTexture(): void {\r\n if (!this._skyboxMaterial) {\r\n return;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.skyboxTexture instanceof BaseTexture) {\r\n this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture;\r\n return;\r\n }\r\n\r\n this._skyboxTexture = new CubeTexture(this._options.skyboxTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._skyboxTexture.coordinatesMode = Texture.SKYBOX_MODE;\r\n this._skyboxTexture.gammaSpace = false;\r\n this._skyboxMaterial.reflectionTexture = this._skyboxTexture;\r\n }\r\n\r\n private _errorHandler = (message?: string, exception?: any) => {\r\n this.onErrorObservable.notifyObservers({ message: message, exception: exception });\r\n };\r\n\r\n /**\r\n * Dispose all the elements created by the Helper.\r\n */\r\n public dispose(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.dispose(true, true);\r\n }\r\n if (this._skyboxMaterial) {\r\n this._skyboxMaterial.dispose(true, true);\r\n }\r\n this._rootMesh.dispose(false);\r\n }\r\n}\r\n"]}
@@ -41,7 +41,7 @@ export interface IEffectLayerOptions {
41
41
  */
42
42
  renderingGroupId: number;
43
43
  /**
44
- * The type of the main texture. Default: TEXTURETYPE_UNSIGNED_INT
44
+ * The type of the main texture. Default: TEXTURETYPE_UNSIGNED_BYTE
45
45
  */
46
46
  mainTextureType: number;
47
47
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"effectLayer.js","sourceRoot":"","sources":["../../../../dev/core/src/Layers/effectLayer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKhD,OAAO,EAAE,MAA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AAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;IACzC,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,aAAa,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,iBAAsB,EAAE,KAAY,EAAE,OAAe;QACrE,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAExE,OAAO,eAAe,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;;AAtjCD;;;GAGG;AACW,qBAAS,GAAG,KAAK,AAAR,CAAS;AAiGhC;;GAEG;AACW,yCAA6B,GAA2B,CAAC,CAAC,EAAE,EAAE;IACxE,MAAM,WAAW,CAAC,2BAA2B,CAAC,CAAC;AACnD,CAAC,AAF0C,CAEzC;AAhGK;IADN,SAAS,EAAE;yCACQ;AAMb;IADN,iBAAiB,EAAE;iDACuB;AAMpC;IADN,SAAS,EAAE;8CACqB;AAMjC;IADC,0BAA0B,EAAE;yCAG5B;AAMD;IADC,SAAS,EAAE;mDAGX;AASM;IADN,SAAS,EAAE;wEACuC","sourcesContent":["import { serialize, serializeAsColor4, serializeAsCameraReference } from \"../Misc/decorators\";\r\nimport { Tools } from \"../Misc/tools\";\r\nimport type { SmartArray } from \"../Misc/smartArray\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ISize } from \"../Maths/math.size\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Material } from \"../Materials/material\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { _WarnImport } from \"../Misc/devTools\";\r\nimport type { DataBuffer } from \"../Buffers/dataBuffer\";\r\nimport { EffectFallbacks } from \"../Materials/effectFallbacks\";\r\nimport { DrawWrapper } from \"../Materials/drawWrapper\";\r\nimport { addClipPlaneUniforms, bindClipPlane, prepareStringDefinesForClipPlanes } from \"../Materials/clipPlaneMaterialHelper\";\r\nimport { BindMorphTargetParameters, PrepareAttributesForMorphTargetsInfluencers, PushAttributesForInstances } from \"../Materials/materialHelper.functions\";\r\nimport { GetExponentOfTwo } from \"../Misc/tools.functions\";\r\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\r\n\r\n/**\r\n * Effect layer options. This helps customizing the behaviour\r\n * of the effect layer.\r\n */\r\nexport interface IEffectLayerOptions {\r\n /**\r\n * Multiplication factor apply to the canvas size to compute the render target size\r\n * used to generated the objects (the smaller the faster). Default: 0.5\r\n */\r\n mainTextureRatio: number;\r\n\r\n /**\r\n * Enforces a fixed size texture to ensure effect stability across devices. Default: undefined\r\n */\r\n mainTextureFixedSize?: number;\r\n\r\n /**\r\n * Alpha blending mode used to apply the blur. Default depends of the implementation. Default: ALPHA_COMBINE\r\n */\r\n alphaBlendingMode: number;\r\n\r\n /**\r\n * The camera attached to the layer. Default: null\r\n */\r\n camera: Nullable<Camera>;\r\n\r\n /**\r\n * The rendering group to draw the layer in. Default: -1\r\n */\r\n renderingGroupId: number;\r\n\r\n /**\r\n * The type of the main texture. Default: TEXTURETYPE_UNSIGNED_INT\r\n */\r\n mainTextureType: number;\r\n\r\n /**\r\n * Whether or not to generate a stencil buffer. Default: false\r\n */\r\n generateStencilBuffer: boolean;\r\n}\r\n\r\n/**\r\n * The effect layer Helps adding post process effect blended with the main pass.\r\n *\r\n * This can be for instance use to generate glow or highlight effects on the scene.\r\n *\r\n * The effect layer class can not be used directly and is intented to inherited from to be\r\n * customized per effects.\r\n */\r\nexport abstract class EffectLayer {\r\n private _vertexBuffers: { [key: string]: Nullable<VertexBuffer> } = {};\r\n private _indexBuffer: Nullable<DataBuffer>;\r\n private _effectLayerOptions: IEffectLayerOptions;\r\n private _mergeDrawWrapper: DrawWrapper[];\r\n\r\n protected _scene: Scene;\r\n protected _engine: AbstractEngine;\r\n protected _maxSize: number = 0;\r\n protected _mainTextureDesiredSize: ISize = { width: 0, height: 0 };\r\n protected _mainTexture: RenderTargetTexture;\r\n protected _shouldRender = true;\r\n protected _postProcesses: PostProcess[] = [];\r\n protected _textures: BaseTexture[] = [];\r\n protected _emissiveTextureAndColor: { texture: Nullable<BaseTexture>; color: Color4 } = { texture: null, color: new Color4() };\r\n protected _effectIntensity: { [meshUniqueId: number]: number } = {};\r\n\r\n /**\r\n * Force all the effect layers to compile to glsl even on WebGPU engines.\r\n * False by default. This is mostly meant for backward compatibility.\r\n */\r\n public static ForceGLSL = false;\r\n\r\n /**\r\n * The name of the layer\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * The clear color of the texture used to generate the glow map.\r\n */\r\n @serializeAsColor4()\r\n public neutralColor: Color4 = new Color4();\r\n\r\n /**\r\n * Specifies whether the highlight layer is enabled or not.\r\n */\r\n @serialize()\r\n public isEnabled: boolean = true;\r\n\r\n /**\r\n * Gets the camera attached to the layer.\r\n */\r\n @serializeAsCameraReference()\r\n public get camera(): Nullable<Camera> {\r\n return this._effectLayerOptions.camera;\r\n }\r\n\r\n /**\r\n * Gets the rendering group id the layer should render in.\r\n */\r\n @serialize()\r\n public get renderingGroupId(): number {\r\n return this._effectLayerOptions.renderingGroupId;\r\n }\r\n public set renderingGroupId(renderingGroupId: number) {\r\n this._effectLayerOptions.renderingGroupId = renderingGroupId;\r\n }\r\n\r\n /**\r\n * Specifies if the bounding boxes should be rendered normally or if they should undergo the effect of the layer\r\n */\r\n @serialize()\r\n public disableBoundingBoxesFromEffectLayer = false;\r\n\r\n /**\r\n * An event triggered when the effect layer has been disposed.\r\n */\r\n public onDisposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the effect layer is about rendering the main texture with the glowy parts.\r\n */\r\n public onBeforeRenderMainTextureObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the generated texture is being merged in the scene.\r\n */\r\n public onBeforeComposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the mesh is rendered into the effect render target.\r\n */\r\n public onBeforeRenderMeshToEffect = new Observable<AbstractMesh>();\r\n\r\n /**\r\n * An event triggered after the mesh has been rendered into the effect render target.\r\n */\r\n public onAfterRenderMeshToEffect = new Observable<AbstractMesh>();\r\n\r\n /**\r\n * An event triggered when the generated texture has been merged in the scene.\r\n */\r\n public onAfterComposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the effect layer changes its size.\r\n */\r\n public onSizeChangedObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * Gets the main texture where the effect is rendered\r\n */\r\n public get mainTexture() {\r\n return this._mainTexture;\r\n }\r\n\r\n /** Shader language used by the material */\r\n protected _shaderLanguage = ShaderLanguage.GLSL;\r\n\r\n /**\r\n * Gets the shader language used in this material.\r\n */\r\n public get shaderLanguage(): ShaderLanguage {\r\n return this._shaderLanguage;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _SceneComponentInitialization: (scene: Scene) => void = (_) => {\r\n throw _WarnImport(\"EffectLayerSceneComponent\");\r\n };\r\n\r\n private _materialForRendering: { [id: string]: [AbstractMesh, Material] } = {};\r\n\r\n /**\r\n * Sets a specific material to be used to render a mesh/a list of meshes in the layer\r\n * @param mesh mesh or array of meshes\r\n * @param material material to use by the layer when rendering the mesh(es). If undefined is passed, the specific material created by the layer will be used.\r\n */\r\n public setMaterialForRendering(mesh: AbstractMesh | AbstractMesh[], material?: Material): void {\r\n this._mainTexture.setMaterialForRendering(mesh, material);\r\n if (Array.isArray(mesh)) {\r\n for (let i = 0; i < mesh.length; ++i) {\r\n const currentMesh = mesh[i];\r\n if (!material) {\r\n delete this._materialForRendering[currentMesh.uniqueId];\r\n } else {\r\n this._materialForRendering[currentMesh.uniqueId] = [currentMesh, material];\r\n }\r\n }\r\n } else {\r\n if (!material) {\r\n delete this._materialForRendering[mesh.uniqueId];\r\n } else {\r\n this._materialForRendering[mesh.uniqueId] = [mesh, material];\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets the intensity of the effect for a specific mesh.\r\n * @param mesh The mesh to get the effect intensity for\r\n * @returns The intensity of the effect for the mesh\r\n */\r\n public getEffectIntensity(mesh: AbstractMesh) {\r\n return this._effectIntensity[mesh.uniqueId] ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the intensity of the effect for a specific mesh.\r\n * @param mesh The mesh to set the effect intensity for\r\n * @param intensity The intensity of the effect for the mesh\r\n */\r\n public setEffectIntensity(mesh: AbstractMesh, intensity: number): void {\r\n this._effectIntensity[mesh.uniqueId] = intensity;\r\n }\r\n\r\n /**\r\n * Instantiates a new effect Layer and references it in the scene.\r\n * @param name The name of the layer\r\n * @param scene The scene to use the layer in\r\n * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false\r\n */\r\n constructor(\r\n /** The Friendly of the effect in the scene */\r\n name: string,\r\n scene?: Scene,\r\n forceGLSL = false\r\n ) {\r\n this.name = name;\r\n\r\n this._scene = scene || <Scene>EngineStore.LastCreatedScene;\r\n EffectLayer._SceneComponentInitialization(this._scene);\r\n\r\n const engine = this._scene.getEngine();\r\n\r\n if (engine.isWebGPU && !forceGLSL && !EffectLayer.ForceGLSL) {\r\n this._shaderLanguage = ShaderLanguage.WGSL;\r\n }\r\n\r\n this._engine = this._scene.getEngine();\r\n this._maxSize = this._engine.getCaps().maxTextureSize;\r\n this._scene.effectLayers.push(this);\r\n\r\n this._mergeDrawWrapper = [];\r\n\r\n // Generate Buffers\r\n this._generateIndexBuffer();\r\n this._generateVertexBuffer();\r\n }\r\n\r\n protected _shadersLoaded = false;\r\n\r\n /**\r\n * Get the effect name of the layer.\r\n * @returns The effect name\r\n */\r\n public abstract getEffectName(): string;\r\n\r\n /**\r\n * Checks for the readiness of the element composing the layer.\r\n * @param subMesh the mesh to check for\r\n * @param useInstances specify whether or not to use instances to render the mesh\r\n * @returns true if ready otherwise, false\r\n */\r\n public abstract isReady(subMesh: SubMesh, useInstances: boolean): boolean;\r\n\r\n /**\r\n * Returns whether or not the layer needs stencil enabled during the mesh rendering.\r\n * @returns true if the effect requires stencil during the main canvas render pass.\r\n */\r\n public abstract needStencil(): boolean;\r\n\r\n /**\r\n * Create the merge effect. This is the shader use to blit the information back\r\n * to the main canvas at the end of the scene rendering.\r\n * @returns The effect containing the shader used to merge the effect on the main canvas\r\n */\r\n protected abstract _createMergeEffect(): Effect;\r\n\r\n /**\r\n * Creates the render target textures and post processes used in the effect layer.\r\n */\r\n protected abstract _createTextureAndPostProcesses(): void;\r\n\r\n /**\r\n * Implementation specific of rendering the generating effect on the main canvas.\r\n * @param effect The effect used to render through\r\n * @param renderNum Index of the _internalRender call (0 for the first time _internalRender is called, 1 for the second time, etc. _internalRender is called the number of times returned by _numInternalDraws())\r\n */\r\n protected abstract _internalRender(effect: Effect, renderIndex: number): void;\r\n\r\n /**\r\n * Sets the required values for both the emissive texture and and the main color.\r\n */\r\n protected abstract _setEmissiveTextureAndColor(mesh: Mesh, subMesh: SubMesh, material: Material): void;\r\n\r\n /**\r\n * Free any resources and references associated to a mesh.\r\n * Internal use\r\n * @param mesh The mesh to free.\r\n */\r\n public abstract _disposeMesh(mesh: Mesh): void;\r\n\r\n /**\r\n * Serializes this layer (Glow or Highlight for example)\r\n * @returns a serialized layer object\r\n */\r\n public abstract serialize?(): any;\r\n\r\n /**\r\n * Number of times _internalRender will be called. Some effect layers need to render the mesh several times, so they should override this method with the number of times the mesh should be rendered\r\n * @returns Number of times a mesh must be rendered in the layer\r\n */\r\n protected _numInternalDraws(): number {\r\n return 1;\r\n }\r\n\r\n /**\r\n * Initializes the effect layer with the required options.\r\n * @param options Sets of none mandatory options to use with the layer (see IEffectLayerOptions for more information)\r\n */\r\n protected _init(options: Partial<IEffectLayerOptions>): void {\r\n // Adapt options\r\n this._effectLayerOptions = {\r\n mainTextureRatio: 0.5,\r\n alphaBlendingMode: Constants.ALPHA_COMBINE,\r\n camera: null,\r\n renderingGroupId: -1,\r\n mainTextureType: Constants.TEXTURETYPE_UNSIGNED_INT,\r\n generateStencilBuffer: false,\r\n ...options,\r\n };\r\n\r\n this._setMainTextureSize();\r\n this._createMainTexture();\r\n this._createTextureAndPostProcesses();\r\n }\r\n\r\n /**\r\n * Generates the index buffer of the full screen quad blending to the main canvas.\r\n */\r\n private _generateIndexBuffer(): void {\r\n // Indices\r\n const indices = [];\r\n indices.push(0);\r\n indices.push(1);\r\n indices.push(2);\r\n\r\n indices.push(0);\r\n indices.push(2);\r\n indices.push(3);\r\n\r\n this._indexBuffer = this._engine.createIndexBuffer(indices);\r\n }\r\n\r\n /**\r\n * Generates the vertex buffer of the full screen quad blending to the main canvas.\r\n */\r\n private _generateVertexBuffer(): void {\r\n // VBO\r\n const vertices = [];\r\n vertices.push(1, 1);\r\n vertices.push(-1, 1);\r\n vertices.push(-1, -1);\r\n vertices.push(1, -1);\r\n\r\n const vertexBuffer = new VertexBuffer(this._engine, vertices, VertexBuffer.PositionKind, false, false, 2);\r\n this._vertexBuffers[VertexBuffer.PositionKind] = vertexBuffer;\r\n }\r\n\r\n /**\r\n * Sets the main texture desired size which is the closest power of two\r\n * of the engine canvas size.\r\n */\r\n private _setMainTextureSize(): void {\r\n if (this._effectLayerOptions.mainTextureFixedSize) {\r\n this._mainTextureDesiredSize.width = this._effectLayerOptions.mainTextureFixedSize;\r\n this._mainTextureDesiredSize.height = this._effectLayerOptions.mainTextureFixedSize;\r\n } else {\r\n this._mainTextureDesiredSize.width = this._engine.getRenderWidth() * this._effectLayerOptions.mainTextureRatio;\r\n this._mainTextureDesiredSize.height = this._engine.getRenderHeight() * this._effectLayerOptions.mainTextureRatio;\r\n\r\n this._mainTextureDesiredSize.width = this._engine.needPOTTextures\r\n ? GetExponentOfTwo(this._mainTextureDesiredSize.width, this._maxSize)\r\n : this._mainTextureDesiredSize.width;\r\n this._mainTextureDesiredSize.height = this._engine.needPOTTextures\r\n ? GetExponentOfTwo(this._mainTextureDesiredSize.height, this._maxSize)\r\n : this._mainTextureDesiredSize.height;\r\n }\r\n\r\n this._mainTextureDesiredSize.width = Math.floor(this._mainTextureDesiredSize.width);\r\n this._mainTextureDesiredSize.height = Math.floor(this._mainTextureDesiredSize.height);\r\n }\r\n\r\n /**\r\n * Creates the main texture for the effect layer.\r\n */\r\n protected _createMainTexture(): void {\r\n this._mainTexture = new RenderTargetTexture(\r\n \"EffectLayerMainRTT\",\r\n {\r\n width: this._mainTextureDesiredSize.width,\r\n height: this._mainTextureDesiredSize.height,\r\n },\r\n this._scene,\r\n false,\r\n true,\r\n this._effectLayerOptions.mainTextureType,\r\n false,\r\n Texture.TRILINEAR_SAMPLINGMODE,\r\n true,\r\n this._effectLayerOptions.generateStencilBuffer\r\n );\r\n this._mainTexture.activeCamera = this._effectLayerOptions.camera;\r\n this._mainTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._mainTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._mainTexture.anisotropicFilteringLevel = 1;\r\n this._mainTexture.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\r\n this._mainTexture.renderParticles = false;\r\n this._mainTexture.renderList = null;\r\n this._mainTexture.ignoreCameraViewport = true;\r\n\r\n for (const id in this._materialForRendering) {\r\n const [mesh, material] = this._materialForRendering[id];\r\n this._mainTexture.setMaterialForRendering(mesh, material);\r\n }\r\n\r\n this._mainTexture.customIsReadyFunction = (mesh: AbstractMesh, refreshRate: number, preWarm?: boolean) => {\r\n if ((preWarm || refreshRate === 0) && mesh.subMeshes) {\r\n for (let i = 0; i < mesh.subMeshes.length; ++i) {\r\n const subMesh = mesh.subMeshes[i];\r\n const material = subMesh.getMaterial();\r\n const renderingMesh = subMesh.getRenderingMesh();\r\n\r\n if (!material) {\r\n continue;\r\n }\r\n\r\n const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());\r\n const hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] || renderingMesh.hasThinInstances;\r\n\r\n this._setEmissiveTextureAndColor(renderingMesh, subMesh, material);\r\n\r\n if (!this._isReady(subMesh, hardwareInstancedRendering, this._emissiveTextureAndColor.texture)) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n };\r\n\r\n // Custom render function\r\n this._mainTexture.customRenderFunction = (\r\n opaqueSubMeshes: SmartArray<SubMesh>,\r\n alphaTestSubMeshes: SmartArray<SubMesh>,\r\n transparentSubMeshes: SmartArray<SubMesh>,\r\n depthOnlySubMeshes: SmartArray<SubMesh>\r\n ): void => {\r\n this.onBeforeRenderMainTextureObservable.notifyObservers(this);\r\n\r\n let index: number;\r\n\r\n const engine = this._scene.getEngine();\r\n\r\n if (depthOnlySubMeshes.length) {\r\n engine.setColorWrite(false);\r\n for (index = 0; index < depthOnlySubMeshes.length; index++) {\r\n this._renderSubMesh(depthOnlySubMeshes.data[index]);\r\n }\r\n engine.setColorWrite(true);\r\n }\r\n\r\n for (index = 0; index < opaqueSubMeshes.length; index++) {\r\n this._renderSubMesh(opaqueSubMeshes.data[index]);\r\n }\r\n\r\n for (index = 0; index < alphaTestSubMeshes.length; index++) {\r\n this._renderSubMesh(alphaTestSubMeshes.data[index]);\r\n }\r\n\r\n const previousAlphaMode = engine.getAlphaMode();\r\n\r\n for (index = 0; index < transparentSubMeshes.length; index++) {\r\n const subMesh = transparentSubMeshes.data[index];\r\n const material = subMesh.getMaterial();\r\n if (material && material.needDepthPrePass) {\r\n const engine = material.getScene().getEngine();\r\n engine.setColorWrite(false);\r\n this._renderSubMesh(subMesh);\r\n engine.setColorWrite(true);\r\n }\r\n this._renderSubMesh(subMesh, true);\r\n }\r\n\r\n engine.setAlphaMode(previousAlphaMode);\r\n };\r\n\r\n this._mainTexture.onClearObservable.add((engine: AbstractEngine) => {\r\n engine.clear(this.neutralColor, true, true, true);\r\n });\r\n\r\n // Prevent package size in es6 (getBoundingBoxRenderer might not be present)\r\n if (this._scene.getBoundingBoxRenderer) {\r\n const boundingBoxRendererEnabled = this._scene.getBoundingBoxRenderer().enabled;\r\n\r\n this._mainTexture.onBeforeBindObservable.add(() => {\r\n this._scene.getBoundingBoxRenderer().enabled = !this.disableBoundingBoxesFromEffectLayer && boundingBoxRendererEnabled;\r\n });\r\n\r\n this._mainTexture.onAfterUnbindObservable.add(() => {\r\n this._scene.getBoundingBoxRenderer().enabled = boundingBoxRendererEnabled;\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds specific effects defines.\r\n * @param defines The defines to add specifics to.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _addCustomEffectDefines(defines: string[]): void {\r\n // Nothing to add by default.\r\n }\r\n\r\n /**\r\n * Checks for the readiness of the element composing the layer.\r\n * @param subMesh the mesh to check for\r\n * @param useInstances specify whether or not to use instances to render the mesh\r\n * @param emissiveTexture the associated emissive texture used to generate the glow\r\n * @returns true if ready otherwise, false\r\n */\r\n protected _isReady(subMesh: SubMesh, useInstances: boolean, emissiveTexture: Nullable<BaseTexture>): boolean {\r\n const engine = this._scene.getEngine();\r\n const mesh = subMesh.getMesh();\r\n\r\n const renderingMaterial = mesh._internalAbstractMeshDataInfo._materialForRenderPass?.[engine.currentRenderPassId];\r\n\r\n if (renderingMaterial) {\r\n return renderingMaterial.isReadyForSubMesh(mesh, subMesh, useInstances);\r\n }\r\n\r\n const material = subMesh.getMaterial();\r\n\r\n if (!material) {\r\n return false;\r\n }\r\n\r\n if (this._useMeshMaterial(subMesh.getRenderingMesh())) {\r\n return material.isReadyForSubMesh(subMesh.getMesh(), subMesh, useInstances);\r\n }\r\n\r\n const defines: string[] = [];\r\n\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n let uv1 = false;\r\n let uv2 = false;\r\n\r\n // Diffuse\r\n if (material) {\r\n const needAlphaTest = material.needAlphaTesting();\r\n\r\n const diffuseTexture = material.getAlphaTestTexture();\r\n const needAlphaBlendFromDiffuse =\r\n diffuseTexture && diffuseTexture.hasAlpha && ((material as any).useAlphaFromDiffuseTexture || (material as any)._useAlphaFromAlbedoTexture);\r\n\r\n if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) {\r\n defines.push(\"#define DIFFUSE\");\r\n if (mesh.isVerticesDataPresent(VertexBuffer.UV2Kind) && diffuseTexture.coordinatesIndex === 1) {\r\n defines.push(\"#define DIFFUSEUV2\");\r\n uv2 = true;\r\n } else if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {\r\n defines.push(\"#define DIFFUSEUV1\");\r\n uv1 = true;\r\n }\r\n\r\n if (needAlphaTest) {\r\n defines.push(\"#define ALPHATEST\");\r\n defines.push(\"#define ALPHATESTVALUE 0.4\");\r\n }\r\n if (!diffuseTexture.gammaSpace) {\r\n defines.push(\"#define DIFFUSE_ISLINEAR\");\r\n }\r\n }\r\n\r\n const opacityTexture = (material as any).opacityTexture;\r\n if (opacityTexture) {\r\n defines.push(\"#define OPACITY\");\r\n if (mesh.isVerticesDataPresent(VertexBuffer.UV2Kind) && opacityTexture.coordinatesIndex === 1) {\r\n defines.push(\"#define OPACITYUV2\");\r\n uv2 = true;\r\n } else if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {\r\n defines.push(\"#define OPACITYUV1\");\r\n uv1 = true;\r\n }\r\n }\r\n }\r\n\r\n // Emissive\r\n if (emissiveTexture) {\r\n defines.push(\"#define EMISSIVE\");\r\n if (mesh.isVerticesDataPresent(VertexBuffer.UV2Kind) && emissiveTexture.coordinatesIndex === 1) {\r\n defines.push(\"#define EMISSIVEUV2\");\r\n uv2 = true;\r\n } else if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {\r\n defines.push(\"#define EMISSIVEUV1\");\r\n uv1 = true;\r\n }\r\n if (!emissiveTexture.gammaSpace) {\r\n defines.push(\"#define EMISSIVE_ISLINEAR\");\r\n }\r\n }\r\n\r\n // Vertex\r\n if (mesh.useVertexColors && mesh.isVerticesDataPresent(VertexBuffer.ColorKind) && mesh.hasVertexAlpha && material.transparencyMode !== Material.MATERIAL_OPAQUE) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n defines.push(\"#define VERTEXALPHA\");\r\n }\r\n\r\n if (uv1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n defines.push(\"#define UV1\");\r\n }\r\n if (uv2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n defines.push(\"#define UV2\");\r\n }\r\n\r\n // Bones\r\n const fallbacks = new EffectFallbacks();\r\n if (mesh.useBones && mesh.computeBonesUsingShaders) {\r\n attribs.push(VertexBuffer.MatricesIndicesKind);\r\n attribs.push(VertexBuffer.MatricesWeightsKind);\r\n if (mesh.numBoneInfluencers > 4) {\r\n attribs.push(VertexBuffer.MatricesIndicesExtraKind);\r\n attribs.push(VertexBuffer.MatricesWeightsExtraKind);\r\n }\r\n\r\n defines.push(\"#define NUM_BONE_INFLUENCERS \" + mesh.numBoneInfluencers);\r\n\r\n const skeleton = mesh.skeleton;\r\n if (skeleton && skeleton.isUsingTextureForMatrices) {\r\n defines.push(\"#define BONETEXTURE\");\r\n } else {\r\n defines.push(\"#define BonesPerMesh \" + (skeleton ? skeleton.bones.length + 1 : 0));\r\n }\r\n\r\n if (mesh.numBoneInfluencers > 0) {\r\n fallbacks.addCPUSkinningFallback(0, mesh);\r\n }\r\n } else {\r\n defines.push(\"#define NUM_BONE_INFLUENCERS 0\");\r\n }\r\n\r\n // Morph targets\r\n const manager = (<Mesh>mesh).morphTargetManager;\r\n let morphInfluencers = 0;\r\n if (manager) {\r\n morphInfluencers = manager.numMaxInfluencers || manager.numInfluencers;\r\n if (morphInfluencers > 0) {\r\n defines.push(\"#define MORPHTARGETS\");\r\n defines.push(\"#define NUM_MORPH_INFLUENCERS \" + morphInfluencers);\r\n if (manager.isUsingTextureForTargets) {\r\n defines.push(\"#define MORPHTARGETS_TEXTURE\");\r\n }\r\n PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, morphInfluencers);\r\n }\r\n }\r\n\r\n // Instances\r\n if (useInstances) {\r\n defines.push(\"#define INSTANCES\");\r\n PushAttributesForInstances(attribs);\r\n if (subMesh.getRenderingMesh().hasThinInstances) {\r\n defines.push(\"#define THIN_INSTANCES\");\r\n }\r\n }\r\n\r\n // ClipPlanes\r\n prepareStringDefinesForClipPlanes(material, this._scene, defines);\r\n\r\n this._addCustomEffectDefines(defines);\r\n\r\n // Get correct effect\r\n const drawWrapper = subMesh._getDrawWrapper(undefined, true)!;\r\n const cachedDefines = drawWrapper.defines as string;\r\n const join = defines.join(\"\\n\");\r\n if (cachedDefines !== join) {\r\n const uniforms = [\r\n \"world\",\r\n \"mBones\",\r\n \"viewProjection\",\r\n \"glowColor\",\r\n \"morphTargetInfluences\",\r\n \"morphTargetCount\",\r\n \"boneTextureWidth\",\r\n \"diffuseMatrix\",\r\n \"emissiveMatrix\",\r\n \"opacityMatrix\",\r\n \"opacityIntensity\",\r\n \"morphTargetTextureInfo\",\r\n \"morphTargetTextureIndices\",\r\n \"glowIntensity\",\r\n ];\r\n\r\n addClipPlaneUniforms(uniforms);\r\n\r\n drawWrapper.setEffect(\r\n this._engine.createEffect(\r\n \"glowMapGeneration\",\r\n attribs,\r\n uniforms,\r\n [\"diffuseSampler\", \"emissiveSampler\", \"opacitySampler\", \"boneSampler\", \"morphTargets\"],\r\n join,\r\n fallbacks,\r\n undefined,\r\n undefined,\r\n { maxSimultaneousMorphTargets: morphInfluencers },\r\n this._shaderLanguage,\r\n this._shadersLoaded\r\n ? undefined\r\n : async () => {\r\n await this._importShadersAsync();\r\n this._shadersLoaded = true;\r\n }\r\n ),\r\n join\r\n );\r\n }\r\n\r\n const effectIsReady = drawWrapper.effect!.isReady();\r\n\r\n return this._arePostProcessAndMergeReady() && effectIsReady;\r\n }\r\n\r\n protected async _importShadersAsync(): Promise<void> {\r\n if (this._shaderLanguage === ShaderLanguage.WGSL) {\r\n await Promise.all([import(\"../ShadersWGSL/glowMapGeneration.vertex\"), import(\"../ShadersWGSL/glowMapGeneration.fragment\")]);\r\n } else {\r\n await Promise.all([import(\"../Shaders/glowMapGeneration.vertex\"), import(\"../Shaders/glowMapGeneration.fragment\")]);\r\n }\r\n }\r\n\r\n protected _arePostProcessAndMergeReady(): boolean {\r\n let isReady = true;\r\n\r\n for (let i = 0; i < this._postProcesses.length; i++) {\r\n isReady = this._postProcesses[i].isReady() && isReady;\r\n }\r\n\r\n const numDraws = this._numInternalDraws();\r\n\r\n for (let i = 0; i < numDraws; ++i) {\r\n let currentEffect = this._mergeDrawWrapper[i];\r\n if (!currentEffect) {\r\n currentEffect = this._mergeDrawWrapper[i] = new DrawWrapper(this._engine);\r\n currentEffect.setEffect(this._createMergeEffect());\r\n }\r\n isReady = currentEffect.effect!.isReady() && isReady;\r\n }\r\n\r\n return isReady;\r\n }\r\n\r\n /**\r\n * Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene.\r\n */\r\n public render(): void {\r\n if (!this._arePostProcessAndMergeReady()) {\r\n return;\r\n }\r\n\r\n const engine = this._scene.getEngine();\r\n const numDraws = this._numInternalDraws();\r\n\r\n this.onBeforeComposeObservable.notifyObservers(this);\r\n\r\n const previousAlphaMode = engine.getAlphaMode();\r\n\r\n for (let i = 0; i < numDraws; ++i) {\r\n const currentEffect = this._mergeDrawWrapper[i];\r\n\r\n // Render\r\n engine.enableEffect(currentEffect);\r\n engine.setState(false);\r\n\r\n // VBOs\r\n engine.bindBuffers(this._vertexBuffers, this._indexBuffer, currentEffect.effect!);\r\n\r\n // Go Blend.\r\n engine.setAlphaMode(this._effectLayerOptions.alphaBlendingMode);\r\n\r\n // Blends the map on the main canvas.\r\n this._internalRender(currentEffect.effect!, i);\r\n }\r\n\r\n // Restore Alpha\r\n engine.setAlphaMode(previousAlphaMode);\r\n\r\n this.onAfterComposeObservable.notifyObservers(this);\r\n\r\n // Handle size changes.\r\n const size = this._mainTexture.getSize();\r\n this._setMainTextureSize();\r\n if (\r\n (size.width !== this._mainTextureDesiredSize.width || size.height !== this._mainTextureDesiredSize.height) &&\r\n this._mainTextureDesiredSize.width !== 0 &&\r\n this._mainTextureDesiredSize.height !== 0\r\n ) {\r\n // Recreate RTT and post processes on size change.\r\n this.onSizeChangedObservable.notifyObservers(this);\r\n this._disposeTextureAndPostProcesses();\r\n this._createMainTexture();\r\n this._createTextureAndPostProcesses();\r\n }\r\n }\r\n\r\n /**\r\n * Determine if a given mesh will be used in the current effect.\r\n * @param mesh mesh to test\r\n * @returns true if the mesh will be used\r\n */\r\n public hasMesh(mesh: AbstractMesh): boolean {\r\n if (this.renderingGroupId === -1 || mesh.renderingGroupId === this.renderingGroupId) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Returns true if the layer contains information to display, otherwise false.\r\n * @returns true if the glow layer should be rendered\r\n */\r\n public shouldRender(): boolean {\r\n return this.isEnabled && this._shouldRender;\r\n }\r\n\r\n /**\r\n * Returns true if the mesh should render, otherwise false.\r\n * @param mesh The mesh to render\r\n * @returns true if it should render otherwise false\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _shouldRenderMesh(mesh: AbstractMesh): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Returns true if the mesh can be rendered, otherwise false.\r\n * @param mesh The mesh to render\r\n * @param material The material used on the mesh\r\n * @returns true if it can be rendered otherwise false\r\n */\r\n protected _canRenderMesh(mesh: AbstractMesh, material: Material): boolean {\r\n return !material.needAlphaBlendingForMesh(mesh);\r\n }\r\n\r\n /**\r\n * Returns true if the mesh should render, otherwise false.\r\n * @returns true if it should render otherwise false\r\n */\r\n protected _shouldRenderEmissiveTextureForMesh(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Renders the submesh passed in parameter to the generation map.\r\n * @param subMesh\r\n * @param enableAlphaMode\r\n */\r\n protected _renderSubMesh(subMesh: SubMesh, enableAlphaMode: boolean = false): void {\r\n if (!this.shouldRender()) {\r\n return;\r\n }\r\n\r\n const material = subMesh.getMaterial();\r\n const ownerMesh = subMesh.getMesh();\r\n const replacementMesh = subMesh.getReplacementMesh();\r\n const renderingMesh = subMesh.getRenderingMesh();\r\n const effectiveMesh = subMesh.getEffectiveMesh();\r\n const scene = this._scene;\r\n const engine = scene.getEngine();\r\n\r\n effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = false;\r\n\r\n if (!material) {\r\n return;\r\n }\r\n\r\n // Do not block in blend mode.\r\n if (!this._canRenderMesh(renderingMesh, material)) {\r\n return;\r\n }\r\n\r\n // Culling\r\n let sideOrientation = material._getEffectiveOrientation(renderingMesh);\r\n const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();\r\n if (mainDeterminant < 0) {\r\n sideOrientation = sideOrientation === Material.ClockWiseSideOrientation ? Material.CounterClockWiseSideOrientation : Material.ClockWiseSideOrientation;\r\n }\r\n\r\n const reverse = sideOrientation === Material.ClockWiseSideOrientation;\r\n engine.setState(material.backFaceCulling, material.zOffset, undefined, reverse, material.cullBackFaces, undefined, material.zOffsetUnits);\r\n\r\n // Managing instances\r\n const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!replacementMesh);\r\n if (batch.mustReturn) {\r\n return;\r\n }\r\n\r\n // Early Exit per mesh\r\n if (!this._shouldRenderMesh(renderingMesh)) {\r\n return;\r\n }\r\n\r\n const hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] || renderingMesh.hasThinInstances;\r\n\r\n this._setEmissiveTextureAndColor(renderingMesh, subMesh, material);\r\n\r\n this.onBeforeRenderMeshToEffect.notifyObservers(ownerMesh);\r\n\r\n if (this._useMeshMaterial(renderingMesh)) {\r\n renderingMesh.render(subMesh, enableAlphaMode, replacementMesh || undefined);\r\n } else if (this._isReady(subMesh, hardwareInstancedRendering, this._emissiveTextureAndColor.texture)) {\r\n const renderingMaterial = effectiveMesh._internalAbstractMeshDataInfo._materialForRenderPass?.[engine.currentRenderPassId];\r\n\r\n let drawWrapper = subMesh._getDrawWrapper();\r\n if (!drawWrapper && renderingMaterial) {\r\n drawWrapper = renderingMaterial._getDrawWrapper();\r\n }\r\n\r\n if (!drawWrapper) {\r\n return;\r\n }\r\n\r\n const effect = drawWrapper.effect!;\r\n\r\n engine.enableEffect(drawWrapper);\r\n if (!hardwareInstancedRendering) {\r\n renderingMesh._bind(subMesh, effect, material.fillMode);\r\n }\r\n\r\n if (!renderingMaterial) {\r\n effect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n effect.setMatrix(\"world\", effectiveMesh.getWorldMatrix());\r\n effect.setFloat4(\r\n \"glowColor\",\r\n this._emissiveTextureAndColor.color.r,\r\n this._emissiveTextureAndColor.color.g,\r\n this._emissiveTextureAndColor.color.b,\r\n this._emissiveTextureAndColor.color.a\r\n );\r\n } else {\r\n renderingMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), effectiveMesh as Mesh, subMesh);\r\n }\r\n\r\n if (!renderingMaterial) {\r\n const needAlphaTest = material.needAlphaTesting();\r\n\r\n const diffuseTexture = material.getAlphaTestTexture();\r\n const needAlphaBlendFromDiffuse =\r\n diffuseTexture && diffuseTexture.hasAlpha && ((material as any).useAlphaFromDiffuseTexture || (material as any)._useAlphaFromAlbedoTexture);\r\n\r\n if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) {\r\n effect.setTexture(\"diffuseSampler\", diffuseTexture);\r\n const textureMatrix = diffuseTexture.getTextureMatrix();\r\n\r\n if (textureMatrix) {\r\n effect.setMatrix(\"diffuseMatrix\", textureMatrix);\r\n }\r\n }\r\n\r\n const opacityTexture = (material as any).opacityTexture;\r\n if (opacityTexture) {\r\n effect.setTexture(\"opacitySampler\", opacityTexture);\r\n effect.setFloat(\"opacityIntensity\", opacityTexture.level);\r\n const textureMatrix = opacityTexture.getTextureMatrix();\r\n if (textureMatrix) {\r\n effect.setMatrix(\"opacityMatrix\", textureMatrix);\r\n }\r\n }\r\n\r\n // Glow emissive only\r\n if (this._emissiveTextureAndColor.texture) {\r\n effect.setTexture(\"emissiveSampler\", this._emissiveTextureAndColor.texture);\r\n effect.setMatrix(\"emissiveMatrix\", this._emissiveTextureAndColor.texture.getTextureMatrix());\r\n }\r\n\r\n // Bones\r\n if (renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {\r\n const skeleton = renderingMesh.skeleton;\r\n\r\n if (skeleton.isUsingTextureForMatrices) {\r\n const boneTexture = skeleton.getTransformMatrixTexture(renderingMesh);\r\n if (!boneTexture) {\r\n return;\r\n }\r\n\r\n effect.setTexture(\"boneSampler\", boneTexture);\r\n effect.setFloat(\"boneTextureWidth\", 4.0 * (skeleton.bones.length + 1));\r\n } else {\r\n effect.setMatrices(\"mBones\", skeleton.getTransformMatrices(renderingMesh));\r\n }\r\n }\r\n\r\n // Morph targets\r\n BindMorphTargetParameters(renderingMesh, effect);\r\n if (renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets) {\r\n renderingMesh.morphTargetManager._bind(effect);\r\n }\r\n\r\n // Alpha mode\r\n if (enableAlphaMode) {\r\n engine.setAlphaMode(material.alphaMode);\r\n }\r\n\r\n // Intensity of effect\r\n effect.setFloat(\"glowIntensity\", this.getEffectIntensity(renderingMesh));\r\n\r\n // Clip planes\r\n bindClipPlane(effect, material, scene);\r\n }\r\n\r\n // Draw\r\n renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, world) =>\r\n effect.setMatrix(\"world\", world)\r\n );\r\n } else {\r\n // Need to reset refresh rate of the main map\r\n this._mainTexture.resetRefreshCounter();\r\n }\r\n\r\n this.onAfterRenderMeshToEffect.notifyObservers(ownerMesh);\r\n }\r\n\r\n /**\r\n * Defines whether the current material of the mesh should be use to render the effect.\r\n * @param mesh defines the current mesh to render\r\n * @returns true if the mesh material should be use\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _useMeshMaterial(mesh: AbstractMesh): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Rebuild the required buffers.\r\n * @internal Internal use only.\r\n */\r\n public _rebuild(): void {\r\n const vb = this._vertexBuffers[VertexBuffer.PositionKind];\r\n\r\n if (vb) {\r\n vb._rebuild();\r\n }\r\n\r\n this._generateIndexBuffer();\r\n }\r\n\r\n /**\r\n * Dispose only the render target textures and post process.\r\n */\r\n private _disposeTextureAndPostProcesses(): void {\r\n this._mainTexture.dispose();\r\n\r\n for (let i = 0; i < this._postProcesses.length; i++) {\r\n if (this._postProcesses[i]) {\r\n this._postProcesses[i].dispose();\r\n }\r\n }\r\n this._postProcesses = [];\r\n\r\n for (let i = 0; i < this._textures.length; i++) {\r\n if (this._textures[i]) {\r\n this._textures[i].dispose();\r\n }\r\n }\r\n this._textures = [];\r\n }\r\n\r\n /**\r\n * Dispose the highlight layer and free resources.\r\n */\r\n public dispose(): void {\r\n const vertexBuffer = this._vertexBuffers[VertexBuffer.PositionKind];\r\n if (vertexBuffer) {\r\n vertexBuffer.dispose();\r\n this._vertexBuffers[VertexBuffer.PositionKind] = null;\r\n }\r\n\r\n if (this._indexBuffer) {\r\n this._scene.getEngine()._releaseBuffer(this._indexBuffer);\r\n this._indexBuffer = null;\r\n }\r\n\r\n for (const drawWrapper of this._mergeDrawWrapper) {\r\n drawWrapper.dispose();\r\n }\r\n this._mergeDrawWrapper = [];\r\n\r\n // Clean textures and post processes\r\n this._disposeTextureAndPostProcesses();\r\n\r\n // Remove from scene\r\n const index = this._scene.effectLayers.indexOf(this, 0);\r\n if (index > -1) {\r\n this._scene.effectLayers.splice(index, 1);\r\n }\r\n\r\n // Callback\r\n this.onDisposeObservable.notifyObservers(this);\r\n\r\n this.onDisposeObservable.clear();\r\n this.onBeforeRenderMainTextureObservable.clear();\r\n this.onBeforeComposeObservable.clear();\r\n this.onBeforeRenderMeshToEffect.clear();\r\n this.onAfterRenderMeshToEffect.clear();\r\n this.onAfterComposeObservable.clear();\r\n this.onSizeChangedObservable.clear();\r\n }\r\n\r\n /**\r\n * Gets the class name of the effect layer\r\n * @returns the string with the class name of the effect layer\r\n */\r\n public getClassName(): string {\r\n return \"EffectLayer\";\r\n }\r\n\r\n /**\r\n * Creates an effect layer from parsed effect layer data\r\n * @param parsedEffectLayer defines effect layer data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing the effect layer information\r\n * @returns a parsed effect Layer\r\n */\r\n public static Parse(parsedEffectLayer: any, scene: Scene, rootUrl: string): EffectLayer {\r\n const effectLayerType = Tools.Instantiate(parsedEffectLayer.customType);\r\n\r\n return effectLayerType.Parse(parsedEffectLayer, scene, rootUrl);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"effectLayer.js","sourceRoot":"","sources":["../../../../dev/core/src/Layers/effectLayer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKhD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAMjD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mB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,iBAAsB,EAAE,KAAY,EAAE,OAAe;QACrE,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAExE,OAAO,eAAe,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;;AAtjCD;;;GAGG;AACW,qBAAS,GAAG,KAAK,AAAR,CAAS;AAiGhC;;GAEG;AACW,yCAA6B,GAA2B,CAAC,CAAC,EAAE,EAAE;IACxE,MAAM,WAAW,CAAC,2BAA2B,CAAC,CAAC;AACnD,CAAC,AAF0C,CAEzC;AAhGK;IADN,SAAS,EAAE;yCACQ;AAMb;IADN,iBAAiB,EAAE;iDACuB;AAMpC;IADN,SAAS,EAAE;8CACqB;AAMjC;IADC,0BAA0B,EAAE;yCAG5B;AAMD;IADC,SAAS,EAAE;mDAGX;AASM;IADN,SAAS,EAAE;wEACuC","sourcesContent":["import { serialize, serializeAsColor4, serializeAsCameraReference } from \"../Misc/decorators\";\r\nimport { Tools } from \"../Misc/tools\";\r\nimport type { SmartArray } from \"../Misc/smartArray\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ISize } from \"../Maths/math.size\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Material } from \"../Materials/material\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { _WarnImport } from \"../Misc/devTools\";\r\nimport type { DataBuffer } from \"../Buffers/dataBuffer\";\r\nimport { EffectFallbacks } from \"../Materials/effectFallbacks\";\r\nimport { DrawWrapper } from \"../Materials/drawWrapper\";\r\nimport { addClipPlaneUniforms, bindClipPlane, prepareStringDefinesForClipPlanes } from \"../Materials/clipPlaneMaterialHelper\";\r\nimport { BindMorphTargetParameters, PrepareAttributesForMorphTargetsInfluencers, PushAttributesForInstances } from \"../Materials/materialHelper.functions\";\r\nimport { GetExponentOfTwo } from \"../Misc/tools.functions\";\r\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\r\n\r\n/**\r\n * Effect layer options. This helps customizing the behaviour\r\n * of the effect layer.\r\n */\r\nexport interface IEffectLayerOptions {\r\n /**\r\n * Multiplication factor apply to the canvas size to compute the render target size\r\n * used to generated the objects (the smaller the faster). Default: 0.5\r\n */\r\n mainTextureRatio: number;\r\n\r\n /**\r\n * Enforces a fixed size texture to ensure effect stability across devices. Default: undefined\r\n */\r\n mainTextureFixedSize?: number;\r\n\r\n /**\r\n * Alpha blending mode used to apply the blur. Default depends of the implementation. Default: ALPHA_COMBINE\r\n */\r\n alphaBlendingMode: number;\r\n\r\n /**\r\n * The camera attached to the layer. Default: null\r\n */\r\n camera: Nullable<Camera>;\r\n\r\n /**\r\n * The rendering group to draw the layer in. Default: -1\r\n */\r\n renderingGroupId: number;\r\n\r\n /**\r\n * The type of the main texture. Default: TEXTURETYPE_UNSIGNED_BYTE\r\n */\r\n mainTextureType: number;\r\n\r\n /**\r\n * Whether or not to generate a stencil buffer. Default: false\r\n */\r\n generateStencilBuffer: boolean;\r\n}\r\n\r\n/**\r\n * The effect layer Helps adding post process effect blended with the main pass.\r\n *\r\n * This can be for instance use to generate glow or highlight effects on the scene.\r\n *\r\n * The effect layer class can not be used directly and is intented to inherited from to be\r\n * customized per effects.\r\n */\r\nexport abstract class EffectLayer {\r\n private _vertexBuffers: { [key: string]: Nullable<VertexBuffer> } = {};\r\n private _indexBuffer: Nullable<DataBuffer>;\r\n private _effectLayerOptions: IEffectLayerOptions;\r\n private _mergeDrawWrapper: DrawWrapper[];\r\n\r\n protected _scene: Scene;\r\n protected _engine: AbstractEngine;\r\n protected _maxSize: number = 0;\r\n protected _mainTextureDesiredSize: ISize = { width: 0, height: 0 };\r\n protected _mainTexture: RenderTargetTexture;\r\n protected _shouldRender = true;\r\n protected _postProcesses: PostProcess[] = [];\r\n protected _textures: BaseTexture[] = [];\r\n protected _emissiveTextureAndColor: { texture: Nullable<BaseTexture>; color: Color4 } = { texture: null, color: new Color4() };\r\n protected _effectIntensity: { [meshUniqueId: number]: number } = {};\r\n\r\n /**\r\n * Force all the effect layers to compile to glsl even on WebGPU engines.\r\n * False by default. This is mostly meant for backward compatibility.\r\n */\r\n public static ForceGLSL = false;\r\n\r\n /**\r\n * The name of the layer\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * The clear color of the texture used to generate the glow map.\r\n */\r\n @serializeAsColor4()\r\n public neutralColor: Color4 = new Color4();\r\n\r\n /**\r\n * Specifies whether the highlight layer is enabled or not.\r\n */\r\n @serialize()\r\n public isEnabled: boolean = true;\r\n\r\n /**\r\n * Gets the camera attached to the layer.\r\n */\r\n @serializeAsCameraReference()\r\n public get camera(): Nullable<Camera> {\r\n return this._effectLayerOptions.camera;\r\n }\r\n\r\n /**\r\n * Gets the rendering group id the layer should render in.\r\n */\r\n @serialize()\r\n public get renderingGroupId(): number {\r\n return this._effectLayerOptions.renderingGroupId;\r\n }\r\n public set renderingGroupId(renderingGroupId: number) {\r\n this._effectLayerOptions.renderingGroupId = renderingGroupId;\r\n }\r\n\r\n /**\r\n * Specifies if the bounding boxes should be rendered normally or if they should undergo the effect of the layer\r\n */\r\n @serialize()\r\n public disableBoundingBoxesFromEffectLayer = false;\r\n\r\n /**\r\n * An event triggered when the effect layer has been disposed.\r\n */\r\n public onDisposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the effect layer is about rendering the main texture with the glowy parts.\r\n */\r\n public onBeforeRenderMainTextureObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the generated texture is being merged in the scene.\r\n */\r\n public onBeforeComposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the mesh is rendered into the effect render target.\r\n */\r\n public onBeforeRenderMeshToEffect = new Observable<AbstractMesh>();\r\n\r\n /**\r\n * An event triggered after the mesh has been rendered into the effect render target.\r\n */\r\n public onAfterRenderMeshToEffect = new Observable<AbstractMesh>();\r\n\r\n /**\r\n * An event triggered when the generated texture has been merged in the scene.\r\n */\r\n public onAfterComposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the effect layer changes its size.\r\n */\r\n public onSizeChangedObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * Gets the main texture where the effect is rendered\r\n */\r\n public get mainTexture() {\r\n return this._mainTexture;\r\n }\r\n\r\n /** Shader language used by the material */\r\n protected _shaderLanguage = ShaderLanguage.GLSL;\r\n\r\n /**\r\n * Gets the shader language used in this material.\r\n */\r\n public get shaderLanguage(): ShaderLanguage {\r\n return this._shaderLanguage;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _SceneComponentInitialization: (scene: Scene) => void = (_) => {\r\n throw _WarnImport(\"EffectLayerSceneComponent\");\r\n };\r\n\r\n private _materialForRendering: { [id: string]: [AbstractMesh, Material] } = {};\r\n\r\n /**\r\n * Sets a specific material to be used to render a mesh/a list of meshes in the layer\r\n * @param mesh mesh or array of meshes\r\n * @param material material to use by the layer when rendering the mesh(es). If undefined is passed, the specific material created by the layer will be used.\r\n */\r\n public setMaterialForRendering(mesh: AbstractMesh | AbstractMesh[], material?: Material): void {\r\n this._mainTexture.setMaterialForRendering(mesh, material);\r\n if (Array.isArray(mesh)) {\r\n for (let i = 0; i < mesh.length; ++i) {\r\n const currentMesh = mesh[i];\r\n if (!material) {\r\n delete this._materialForRendering[currentMesh.uniqueId];\r\n } else {\r\n this._materialForRendering[currentMesh.uniqueId] = [currentMesh, material];\r\n }\r\n }\r\n } else {\r\n if (!material) {\r\n delete this._materialForRendering[mesh.uniqueId];\r\n } else {\r\n this._materialForRendering[mesh.uniqueId] = [mesh, material];\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets the intensity of the effect for a specific mesh.\r\n * @param mesh The mesh to get the effect intensity for\r\n * @returns The intensity of the effect for the mesh\r\n */\r\n public getEffectIntensity(mesh: AbstractMesh) {\r\n return this._effectIntensity[mesh.uniqueId] ?? 1;\r\n }\r\n\r\n /**\r\n * Sets the intensity of the effect for a specific mesh.\r\n * @param mesh The mesh to set the effect intensity for\r\n * @param intensity The intensity of the effect for the mesh\r\n */\r\n public setEffectIntensity(mesh: AbstractMesh, intensity: number): void {\r\n this._effectIntensity[mesh.uniqueId] = intensity;\r\n }\r\n\r\n /**\r\n * Instantiates a new effect Layer and references it in the scene.\r\n * @param name The name of the layer\r\n * @param scene The scene to use the layer in\r\n * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false\r\n */\r\n constructor(\r\n /** The Friendly of the effect in the scene */\r\n name: string,\r\n scene?: Scene,\r\n forceGLSL = false\r\n ) {\r\n this.name = name;\r\n\r\n this._scene = scene || <Scene>EngineStore.LastCreatedScene;\r\n EffectLayer._SceneComponentInitialization(this._scene);\r\n\r\n const engine = this._scene.getEngine();\r\n\r\n if (engine.isWebGPU && !forceGLSL && !EffectLayer.ForceGLSL) {\r\n this._shaderLanguage = ShaderLanguage.WGSL;\r\n }\r\n\r\n this._engine = this._scene.getEngine();\r\n this._maxSize = this._engine.getCaps().maxTextureSize;\r\n this._scene.effectLayers.push(this);\r\n\r\n this._mergeDrawWrapper = [];\r\n\r\n // Generate Buffers\r\n this._generateIndexBuffer();\r\n this._generateVertexBuffer();\r\n }\r\n\r\n protected _shadersLoaded = false;\r\n\r\n /**\r\n * Get the effect name of the layer.\r\n * @returns The effect name\r\n */\r\n public abstract getEffectName(): string;\r\n\r\n /**\r\n * Checks for the readiness of the element composing the layer.\r\n * @param subMesh the mesh to check for\r\n * @param useInstances specify whether or not to use instances to render the mesh\r\n * @returns true if ready otherwise, false\r\n */\r\n public abstract isReady(subMesh: SubMesh, useInstances: boolean): boolean;\r\n\r\n /**\r\n * Returns whether or not the layer needs stencil enabled during the mesh rendering.\r\n * @returns true if the effect requires stencil during the main canvas render pass.\r\n */\r\n public abstract needStencil(): boolean;\r\n\r\n /**\r\n * Create the merge effect. This is the shader use to blit the information back\r\n * to the main canvas at the end of the scene rendering.\r\n * @returns The effect containing the shader used to merge the effect on the main canvas\r\n */\r\n protected abstract _createMergeEffect(): Effect;\r\n\r\n /**\r\n * Creates the render target textures and post processes used in the effect layer.\r\n */\r\n protected abstract _createTextureAndPostProcesses(): void;\r\n\r\n /**\r\n * Implementation specific of rendering the generating effect on the main canvas.\r\n * @param effect The effect used to render through\r\n * @param renderNum Index of the _internalRender call (0 for the first time _internalRender is called, 1 for the second time, etc. _internalRender is called the number of times returned by _numInternalDraws())\r\n */\r\n protected abstract _internalRender(effect: Effect, renderIndex: number): void;\r\n\r\n /**\r\n * Sets the required values for both the emissive texture and and the main color.\r\n */\r\n protected abstract _setEmissiveTextureAndColor(mesh: Mesh, subMesh: SubMesh, material: Material): void;\r\n\r\n /**\r\n * Free any resources and references associated to a mesh.\r\n * Internal use\r\n * @param mesh The mesh to free.\r\n */\r\n public abstract _disposeMesh(mesh: Mesh): void;\r\n\r\n /**\r\n * Serializes this layer (Glow or Highlight for example)\r\n * @returns a serialized layer object\r\n */\r\n public abstract serialize?(): any;\r\n\r\n /**\r\n * Number of times _internalRender will be called. Some effect layers need to render the mesh several times, so they should override this method with the number of times the mesh should be rendered\r\n * @returns Number of times a mesh must be rendered in the layer\r\n */\r\n protected _numInternalDraws(): number {\r\n return 1;\r\n }\r\n\r\n /**\r\n * Initializes the effect layer with the required options.\r\n * @param options Sets of none mandatory options to use with the layer (see IEffectLayerOptions for more information)\r\n */\r\n protected _init(options: Partial<IEffectLayerOptions>): void {\r\n // Adapt options\r\n this._effectLayerOptions = {\r\n mainTextureRatio: 0.5,\r\n alphaBlendingMode: Constants.ALPHA_COMBINE,\r\n camera: null,\r\n renderingGroupId: -1,\r\n mainTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n generateStencilBuffer: false,\r\n ...options,\r\n };\r\n\r\n this._setMainTextureSize();\r\n this._createMainTexture();\r\n this._createTextureAndPostProcesses();\r\n }\r\n\r\n /**\r\n * Generates the index buffer of the full screen quad blending to the main canvas.\r\n */\r\n private _generateIndexBuffer(): void {\r\n // Indices\r\n const indices = [];\r\n indices.push(0);\r\n indices.push(1);\r\n indices.push(2);\r\n\r\n indices.push(0);\r\n indices.push(2);\r\n indices.push(3);\r\n\r\n this._indexBuffer = this._engine.createIndexBuffer(indices);\r\n }\r\n\r\n /**\r\n * Generates the vertex buffer of the full screen quad blending to the main canvas.\r\n */\r\n private _generateVertexBuffer(): void {\r\n // VBO\r\n const vertices = [];\r\n vertices.push(1, 1);\r\n vertices.push(-1, 1);\r\n vertices.push(-1, -1);\r\n vertices.push(1, -1);\r\n\r\n const vertexBuffer = new VertexBuffer(this._engine, vertices, VertexBuffer.PositionKind, false, false, 2);\r\n this._vertexBuffers[VertexBuffer.PositionKind] = vertexBuffer;\r\n }\r\n\r\n /**\r\n * Sets the main texture desired size which is the closest power of two\r\n * of the engine canvas size.\r\n */\r\n private _setMainTextureSize(): void {\r\n if (this._effectLayerOptions.mainTextureFixedSize) {\r\n this._mainTextureDesiredSize.width = this._effectLayerOptions.mainTextureFixedSize;\r\n this._mainTextureDesiredSize.height = this._effectLayerOptions.mainTextureFixedSize;\r\n } else {\r\n this._mainTextureDesiredSize.width = this._engine.getRenderWidth() * this._effectLayerOptions.mainTextureRatio;\r\n this._mainTextureDesiredSize.height = this._engine.getRenderHeight() * this._effectLayerOptions.mainTextureRatio;\r\n\r\n this._mainTextureDesiredSize.width = this._engine.needPOTTextures\r\n ? GetExponentOfTwo(this._mainTextureDesiredSize.width, this._maxSize)\r\n : this._mainTextureDesiredSize.width;\r\n this._mainTextureDesiredSize.height = this._engine.needPOTTextures\r\n ? GetExponentOfTwo(this._mainTextureDesiredSize.height, this._maxSize)\r\n : this._mainTextureDesiredSize.height;\r\n }\r\n\r\n this._mainTextureDesiredSize.width = Math.floor(this._mainTextureDesiredSize.width);\r\n this._mainTextureDesiredSize.height = Math.floor(this._mainTextureDesiredSize.height);\r\n }\r\n\r\n /**\r\n * Creates the main texture for the effect layer.\r\n */\r\n protected _createMainTexture(): void {\r\n this._mainTexture = new RenderTargetTexture(\r\n \"EffectLayerMainRTT\",\r\n {\r\n width: this._mainTextureDesiredSize.width,\r\n height: this._mainTextureDesiredSize.height,\r\n },\r\n this._scene,\r\n false,\r\n true,\r\n this._effectLayerOptions.mainTextureType,\r\n false,\r\n Texture.TRILINEAR_SAMPLINGMODE,\r\n true,\r\n this._effectLayerOptions.generateStencilBuffer\r\n );\r\n this._mainTexture.activeCamera = this._effectLayerOptions.camera;\r\n this._mainTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._mainTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._mainTexture.anisotropicFilteringLevel = 1;\r\n this._mainTexture.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\r\n this._mainTexture.renderParticles = false;\r\n this._mainTexture.renderList = null;\r\n this._mainTexture.ignoreCameraViewport = true;\r\n\r\n for (const id in this._materialForRendering) {\r\n const [mesh, material] = this._materialForRendering[id];\r\n this._mainTexture.setMaterialForRendering(mesh, material);\r\n }\r\n\r\n this._mainTexture.customIsReadyFunction = (mesh: AbstractMesh, refreshRate: number, preWarm?: boolean) => {\r\n if ((preWarm || refreshRate === 0) && mesh.subMeshes) {\r\n for (let i = 0; i < mesh.subMeshes.length; ++i) {\r\n const subMesh = mesh.subMeshes[i];\r\n const material = subMesh.getMaterial();\r\n const renderingMesh = subMesh.getRenderingMesh();\r\n\r\n if (!material) {\r\n continue;\r\n }\r\n\r\n const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!subMesh.getReplacementMesh());\r\n const hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] || renderingMesh.hasThinInstances;\r\n\r\n this._setEmissiveTextureAndColor(renderingMesh, subMesh, material);\r\n\r\n if (!this._isReady(subMesh, hardwareInstancedRendering, this._emissiveTextureAndColor.texture)) {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n };\r\n\r\n // Custom render function\r\n this._mainTexture.customRenderFunction = (\r\n opaqueSubMeshes: SmartArray<SubMesh>,\r\n alphaTestSubMeshes: SmartArray<SubMesh>,\r\n transparentSubMeshes: SmartArray<SubMesh>,\r\n depthOnlySubMeshes: SmartArray<SubMesh>\r\n ): void => {\r\n this.onBeforeRenderMainTextureObservable.notifyObservers(this);\r\n\r\n let index: number;\r\n\r\n const engine = this._scene.getEngine();\r\n\r\n if (depthOnlySubMeshes.length) {\r\n engine.setColorWrite(false);\r\n for (index = 0; index < depthOnlySubMeshes.length; index++) {\r\n this._renderSubMesh(depthOnlySubMeshes.data[index]);\r\n }\r\n engine.setColorWrite(true);\r\n }\r\n\r\n for (index = 0; index < opaqueSubMeshes.length; index++) {\r\n this._renderSubMesh(opaqueSubMeshes.data[index]);\r\n }\r\n\r\n for (index = 0; index < alphaTestSubMeshes.length; index++) {\r\n this._renderSubMesh(alphaTestSubMeshes.data[index]);\r\n }\r\n\r\n const previousAlphaMode = engine.getAlphaMode();\r\n\r\n for (index = 0; index < transparentSubMeshes.length; index++) {\r\n const subMesh = transparentSubMeshes.data[index];\r\n const material = subMesh.getMaterial();\r\n if (material && material.needDepthPrePass) {\r\n const engine = material.getScene().getEngine();\r\n engine.setColorWrite(false);\r\n this._renderSubMesh(subMesh);\r\n engine.setColorWrite(true);\r\n }\r\n this._renderSubMesh(subMesh, true);\r\n }\r\n\r\n engine.setAlphaMode(previousAlphaMode);\r\n };\r\n\r\n this._mainTexture.onClearObservable.add((engine: AbstractEngine) => {\r\n engine.clear(this.neutralColor, true, true, true);\r\n });\r\n\r\n // Prevent package size in es6 (getBoundingBoxRenderer might not be present)\r\n if (this._scene.getBoundingBoxRenderer) {\r\n const boundingBoxRendererEnabled = this._scene.getBoundingBoxRenderer().enabled;\r\n\r\n this._mainTexture.onBeforeBindObservable.add(() => {\r\n this._scene.getBoundingBoxRenderer().enabled = !this.disableBoundingBoxesFromEffectLayer && boundingBoxRendererEnabled;\r\n });\r\n\r\n this._mainTexture.onAfterUnbindObservable.add(() => {\r\n this._scene.getBoundingBoxRenderer().enabled = boundingBoxRendererEnabled;\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Adds specific effects defines.\r\n * @param defines The defines to add specifics to.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _addCustomEffectDefines(defines: string[]): void {\r\n // Nothing to add by default.\r\n }\r\n\r\n /**\r\n * Checks for the readiness of the element composing the layer.\r\n * @param subMesh the mesh to check for\r\n * @param useInstances specify whether or not to use instances to render the mesh\r\n * @param emissiveTexture the associated emissive texture used to generate the glow\r\n * @returns true if ready otherwise, false\r\n */\r\n protected _isReady(subMesh: SubMesh, useInstances: boolean, emissiveTexture: Nullable<BaseTexture>): boolean {\r\n const engine = this._scene.getEngine();\r\n const mesh = subMesh.getMesh();\r\n\r\n const renderingMaterial = mesh._internalAbstractMeshDataInfo._materialForRenderPass?.[engine.currentRenderPassId];\r\n\r\n if (renderingMaterial) {\r\n return renderingMaterial.isReadyForSubMesh(mesh, subMesh, useInstances);\r\n }\r\n\r\n const material = subMesh.getMaterial();\r\n\r\n if (!material) {\r\n return false;\r\n }\r\n\r\n if (this._useMeshMaterial(subMesh.getRenderingMesh())) {\r\n return material.isReadyForSubMesh(subMesh.getMesh(), subMesh, useInstances);\r\n }\r\n\r\n const defines: string[] = [];\r\n\r\n const attribs = [VertexBuffer.PositionKind];\r\n\r\n let uv1 = false;\r\n let uv2 = false;\r\n\r\n // Diffuse\r\n if (material) {\r\n const needAlphaTest = material.needAlphaTesting();\r\n\r\n const diffuseTexture = material.getAlphaTestTexture();\r\n const needAlphaBlendFromDiffuse =\r\n diffuseTexture && diffuseTexture.hasAlpha && ((material as any).useAlphaFromDiffuseTexture || (material as any)._useAlphaFromAlbedoTexture);\r\n\r\n if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) {\r\n defines.push(\"#define DIFFUSE\");\r\n if (mesh.isVerticesDataPresent(VertexBuffer.UV2Kind) && diffuseTexture.coordinatesIndex === 1) {\r\n defines.push(\"#define DIFFUSEUV2\");\r\n uv2 = true;\r\n } else if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {\r\n defines.push(\"#define DIFFUSEUV1\");\r\n uv1 = true;\r\n }\r\n\r\n if (needAlphaTest) {\r\n defines.push(\"#define ALPHATEST\");\r\n defines.push(\"#define ALPHATESTVALUE 0.4\");\r\n }\r\n if (!diffuseTexture.gammaSpace) {\r\n defines.push(\"#define DIFFUSE_ISLINEAR\");\r\n }\r\n }\r\n\r\n const opacityTexture = (material as any).opacityTexture;\r\n if (opacityTexture) {\r\n defines.push(\"#define OPACITY\");\r\n if (mesh.isVerticesDataPresent(VertexBuffer.UV2Kind) && opacityTexture.coordinatesIndex === 1) {\r\n defines.push(\"#define OPACITYUV2\");\r\n uv2 = true;\r\n } else if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {\r\n defines.push(\"#define OPACITYUV1\");\r\n uv1 = true;\r\n }\r\n }\r\n }\r\n\r\n // Emissive\r\n if (emissiveTexture) {\r\n defines.push(\"#define EMISSIVE\");\r\n if (mesh.isVerticesDataPresent(VertexBuffer.UV2Kind) && emissiveTexture.coordinatesIndex === 1) {\r\n defines.push(\"#define EMISSIVEUV2\");\r\n uv2 = true;\r\n } else if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {\r\n defines.push(\"#define EMISSIVEUV1\");\r\n uv1 = true;\r\n }\r\n if (!emissiveTexture.gammaSpace) {\r\n defines.push(\"#define EMISSIVE_ISLINEAR\");\r\n }\r\n }\r\n\r\n // Vertex\r\n if (mesh.useVertexColors && mesh.isVerticesDataPresent(VertexBuffer.ColorKind) && mesh.hasVertexAlpha && material.transparencyMode !== Material.MATERIAL_OPAQUE) {\r\n attribs.push(VertexBuffer.ColorKind);\r\n defines.push(\"#define VERTEXALPHA\");\r\n }\r\n\r\n if (uv1) {\r\n attribs.push(VertexBuffer.UVKind);\r\n defines.push(\"#define UV1\");\r\n }\r\n if (uv2) {\r\n attribs.push(VertexBuffer.UV2Kind);\r\n defines.push(\"#define UV2\");\r\n }\r\n\r\n // Bones\r\n const fallbacks = new EffectFallbacks();\r\n if (mesh.useBones && mesh.computeBonesUsingShaders) {\r\n attribs.push(VertexBuffer.MatricesIndicesKind);\r\n attribs.push(VertexBuffer.MatricesWeightsKind);\r\n if (mesh.numBoneInfluencers > 4) {\r\n attribs.push(VertexBuffer.MatricesIndicesExtraKind);\r\n attribs.push(VertexBuffer.MatricesWeightsExtraKind);\r\n }\r\n\r\n defines.push(\"#define NUM_BONE_INFLUENCERS \" + mesh.numBoneInfluencers);\r\n\r\n const skeleton = mesh.skeleton;\r\n if (skeleton && skeleton.isUsingTextureForMatrices) {\r\n defines.push(\"#define BONETEXTURE\");\r\n } else {\r\n defines.push(\"#define BonesPerMesh \" + (skeleton ? skeleton.bones.length + 1 : 0));\r\n }\r\n\r\n if (mesh.numBoneInfluencers > 0) {\r\n fallbacks.addCPUSkinningFallback(0, mesh);\r\n }\r\n } else {\r\n defines.push(\"#define NUM_BONE_INFLUENCERS 0\");\r\n }\r\n\r\n // Morph targets\r\n const manager = (<Mesh>mesh).morphTargetManager;\r\n let morphInfluencers = 0;\r\n if (manager) {\r\n morphInfluencers = manager.numMaxInfluencers || manager.numInfluencers;\r\n if (morphInfluencers > 0) {\r\n defines.push(\"#define MORPHTARGETS\");\r\n defines.push(\"#define NUM_MORPH_INFLUENCERS \" + morphInfluencers);\r\n if (manager.isUsingTextureForTargets) {\r\n defines.push(\"#define MORPHTARGETS_TEXTURE\");\r\n }\r\n PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, morphInfluencers);\r\n }\r\n }\r\n\r\n // Instances\r\n if (useInstances) {\r\n defines.push(\"#define INSTANCES\");\r\n PushAttributesForInstances(attribs);\r\n if (subMesh.getRenderingMesh().hasThinInstances) {\r\n defines.push(\"#define THIN_INSTANCES\");\r\n }\r\n }\r\n\r\n // ClipPlanes\r\n prepareStringDefinesForClipPlanes(material, this._scene, defines);\r\n\r\n this._addCustomEffectDefines(defines);\r\n\r\n // Get correct effect\r\n const drawWrapper = subMesh._getDrawWrapper(undefined, true)!;\r\n const cachedDefines = drawWrapper.defines as string;\r\n const join = defines.join(\"\\n\");\r\n if (cachedDefines !== join) {\r\n const uniforms = [\r\n \"world\",\r\n \"mBones\",\r\n \"viewProjection\",\r\n \"glowColor\",\r\n \"morphTargetInfluences\",\r\n \"morphTargetCount\",\r\n \"boneTextureWidth\",\r\n \"diffuseMatrix\",\r\n \"emissiveMatrix\",\r\n \"opacityMatrix\",\r\n \"opacityIntensity\",\r\n \"morphTargetTextureInfo\",\r\n \"morphTargetTextureIndices\",\r\n \"glowIntensity\",\r\n ];\r\n\r\n addClipPlaneUniforms(uniforms);\r\n\r\n drawWrapper.setEffect(\r\n this._engine.createEffect(\r\n \"glowMapGeneration\",\r\n attribs,\r\n uniforms,\r\n [\"diffuseSampler\", \"emissiveSampler\", \"opacitySampler\", \"boneSampler\", \"morphTargets\"],\r\n join,\r\n fallbacks,\r\n undefined,\r\n undefined,\r\n { maxSimultaneousMorphTargets: morphInfluencers },\r\n this._shaderLanguage,\r\n this._shadersLoaded\r\n ? undefined\r\n : async () => {\r\n await this._importShadersAsync();\r\n this._shadersLoaded = true;\r\n }\r\n ),\r\n join\r\n );\r\n }\r\n\r\n const effectIsReady = drawWrapper.effect!.isReady();\r\n\r\n return this._arePostProcessAndMergeReady() && effectIsReady;\r\n }\r\n\r\n protected async _importShadersAsync(): Promise<void> {\r\n if (this._shaderLanguage === ShaderLanguage.WGSL) {\r\n await Promise.all([import(\"../ShadersWGSL/glowMapGeneration.vertex\"), import(\"../ShadersWGSL/glowMapGeneration.fragment\")]);\r\n } else {\r\n await Promise.all([import(\"../Shaders/glowMapGeneration.vertex\"), import(\"../Shaders/glowMapGeneration.fragment\")]);\r\n }\r\n }\r\n\r\n protected _arePostProcessAndMergeReady(): boolean {\r\n let isReady = true;\r\n\r\n for (let i = 0; i < this._postProcesses.length; i++) {\r\n isReady = this._postProcesses[i].isReady() && isReady;\r\n }\r\n\r\n const numDraws = this._numInternalDraws();\r\n\r\n for (let i = 0; i < numDraws; ++i) {\r\n let currentEffect = this._mergeDrawWrapper[i];\r\n if (!currentEffect) {\r\n currentEffect = this._mergeDrawWrapper[i] = new DrawWrapper(this._engine);\r\n currentEffect.setEffect(this._createMergeEffect());\r\n }\r\n isReady = currentEffect.effect!.isReady() && isReady;\r\n }\r\n\r\n return isReady;\r\n }\r\n\r\n /**\r\n * Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene.\r\n */\r\n public render(): void {\r\n if (!this._arePostProcessAndMergeReady()) {\r\n return;\r\n }\r\n\r\n const engine = this._scene.getEngine();\r\n const numDraws = this._numInternalDraws();\r\n\r\n this.onBeforeComposeObservable.notifyObservers(this);\r\n\r\n const previousAlphaMode = engine.getAlphaMode();\r\n\r\n for (let i = 0; i < numDraws; ++i) {\r\n const currentEffect = this._mergeDrawWrapper[i];\r\n\r\n // Render\r\n engine.enableEffect(currentEffect);\r\n engine.setState(false);\r\n\r\n // VBOs\r\n engine.bindBuffers(this._vertexBuffers, this._indexBuffer, currentEffect.effect!);\r\n\r\n // Go Blend.\r\n engine.setAlphaMode(this._effectLayerOptions.alphaBlendingMode);\r\n\r\n // Blends the map on the main canvas.\r\n this._internalRender(currentEffect.effect!, i);\r\n }\r\n\r\n // Restore Alpha\r\n engine.setAlphaMode(previousAlphaMode);\r\n\r\n this.onAfterComposeObservable.notifyObservers(this);\r\n\r\n // Handle size changes.\r\n const size = this._mainTexture.getSize();\r\n this._setMainTextureSize();\r\n if (\r\n (size.width !== this._mainTextureDesiredSize.width || size.height !== this._mainTextureDesiredSize.height) &&\r\n this._mainTextureDesiredSize.width !== 0 &&\r\n this._mainTextureDesiredSize.height !== 0\r\n ) {\r\n // Recreate RTT and post processes on size change.\r\n this.onSizeChangedObservable.notifyObservers(this);\r\n this._disposeTextureAndPostProcesses();\r\n this._createMainTexture();\r\n this._createTextureAndPostProcesses();\r\n }\r\n }\r\n\r\n /**\r\n * Determine if a given mesh will be used in the current effect.\r\n * @param mesh mesh to test\r\n * @returns true if the mesh will be used\r\n */\r\n public hasMesh(mesh: AbstractMesh): boolean {\r\n if (this.renderingGroupId === -1 || mesh.renderingGroupId === this.renderingGroupId) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Returns true if the layer contains information to display, otherwise false.\r\n * @returns true if the glow layer should be rendered\r\n */\r\n public shouldRender(): boolean {\r\n return this.isEnabled && this._shouldRender;\r\n }\r\n\r\n /**\r\n * Returns true if the mesh should render, otherwise false.\r\n * @param mesh The mesh to render\r\n * @returns true if it should render otherwise false\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _shouldRenderMesh(mesh: AbstractMesh): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Returns true if the mesh can be rendered, otherwise false.\r\n * @param mesh The mesh to render\r\n * @param material The material used on the mesh\r\n * @returns true if it can be rendered otherwise false\r\n */\r\n protected _canRenderMesh(mesh: AbstractMesh, material: Material): boolean {\r\n return !material.needAlphaBlendingForMesh(mesh);\r\n }\r\n\r\n /**\r\n * Returns true if the mesh should render, otherwise false.\r\n * @returns true if it should render otherwise false\r\n */\r\n protected _shouldRenderEmissiveTextureForMesh(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Renders the submesh passed in parameter to the generation map.\r\n * @param subMesh\r\n * @param enableAlphaMode\r\n */\r\n protected _renderSubMesh(subMesh: SubMesh, enableAlphaMode: boolean = false): void {\r\n if (!this.shouldRender()) {\r\n return;\r\n }\r\n\r\n const material = subMesh.getMaterial();\r\n const ownerMesh = subMesh.getMesh();\r\n const replacementMesh = subMesh.getReplacementMesh();\r\n const renderingMesh = subMesh.getRenderingMesh();\r\n const effectiveMesh = subMesh.getEffectiveMesh();\r\n const scene = this._scene;\r\n const engine = scene.getEngine();\r\n\r\n effectiveMesh._internalAbstractMeshDataInfo._isActiveIntermediate = false;\r\n\r\n if (!material) {\r\n return;\r\n }\r\n\r\n // Do not block in blend mode.\r\n if (!this._canRenderMesh(renderingMesh, material)) {\r\n return;\r\n }\r\n\r\n // Culling\r\n let sideOrientation = material._getEffectiveOrientation(renderingMesh);\r\n const mainDeterminant = effectiveMesh._getWorldMatrixDeterminant();\r\n if (mainDeterminant < 0) {\r\n sideOrientation = sideOrientation === Material.ClockWiseSideOrientation ? Material.CounterClockWiseSideOrientation : Material.ClockWiseSideOrientation;\r\n }\r\n\r\n const reverse = sideOrientation === Material.ClockWiseSideOrientation;\r\n engine.setState(material.backFaceCulling, material.zOffset, undefined, reverse, material.cullBackFaces, undefined, material.zOffsetUnits);\r\n\r\n // Managing instances\r\n const batch = renderingMesh._getInstancesRenderList(subMesh._id, !!replacementMesh);\r\n if (batch.mustReturn) {\r\n return;\r\n }\r\n\r\n // Early Exit per mesh\r\n if (!this._shouldRenderMesh(renderingMesh)) {\r\n return;\r\n }\r\n\r\n const hardwareInstancedRendering = batch.hardwareInstancedRendering[subMesh._id] || renderingMesh.hasThinInstances;\r\n\r\n this._setEmissiveTextureAndColor(renderingMesh, subMesh, material);\r\n\r\n this.onBeforeRenderMeshToEffect.notifyObservers(ownerMesh);\r\n\r\n if (this._useMeshMaterial(renderingMesh)) {\r\n renderingMesh.render(subMesh, enableAlphaMode, replacementMesh || undefined);\r\n } else if (this._isReady(subMesh, hardwareInstancedRendering, this._emissiveTextureAndColor.texture)) {\r\n const renderingMaterial = effectiveMesh._internalAbstractMeshDataInfo._materialForRenderPass?.[engine.currentRenderPassId];\r\n\r\n let drawWrapper = subMesh._getDrawWrapper();\r\n if (!drawWrapper && renderingMaterial) {\r\n drawWrapper = renderingMaterial._getDrawWrapper();\r\n }\r\n\r\n if (!drawWrapper) {\r\n return;\r\n }\r\n\r\n const effect = drawWrapper.effect!;\r\n\r\n engine.enableEffect(drawWrapper);\r\n if (!hardwareInstancedRendering) {\r\n renderingMesh._bind(subMesh, effect, material.fillMode);\r\n }\r\n\r\n if (!renderingMaterial) {\r\n effect.setMatrix(\"viewProjection\", scene.getTransformMatrix());\r\n effect.setMatrix(\"world\", effectiveMesh.getWorldMatrix());\r\n effect.setFloat4(\r\n \"glowColor\",\r\n this._emissiveTextureAndColor.color.r,\r\n this._emissiveTextureAndColor.color.g,\r\n this._emissiveTextureAndColor.color.b,\r\n this._emissiveTextureAndColor.color.a\r\n );\r\n } else {\r\n renderingMaterial.bindForSubMesh(effectiveMesh.getWorldMatrix(), effectiveMesh as Mesh, subMesh);\r\n }\r\n\r\n if (!renderingMaterial) {\r\n const needAlphaTest = material.needAlphaTesting();\r\n\r\n const diffuseTexture = material.getAlphaTestTexture();\r\n const needAlphaBlendFromDiffuse =\r\n diffuseTexture && diffuseTexture.hasAlpha && ((material as any).useAlphaFromDiffuseTexture || (material as any)._useAlphaFromAlbedoTexture);\r\n\r\n if (diffuseTexture && (needAlphaTest || needAlphaBlendFromDiffuse)) {\r\n effect.setTexture(\"diffuseSampler\", diffuseTexture);\r\n const textureMatrix = diffuseTexture.getTextureMatrix();\r\n\r\n if (textureMatrix) {\r\n effect.setMatrix(\"diffuseMatrix\", textureMatrix);\r\n }\r\n }\r\n\r\n const opacityTexture = (material as any).opacityTexture;\r\n if (opacityTexture) {\r\n effect.setTexture(\"opacitySampler\", opacityTexture);\r\n effect.setFloat(\"opacityIntensity\", opacityTexture.level);\r\n const textureMatrix = opacityTexture.getTextureMatrix();\r\n if (textureMatrix) {\r\n effect.setMatrix(\"opacityMatrix\", textureMatrix);\r\n }\r\n }\r\n\r\n // Glow emissive only\r\n if (this._emissiveTextureAndColor.texture) {\r\n effect.setTexture(\"emissiveSampler\", this._emissiveTextureAndColor.texture);\r\n effect.setMatrix(\"emissiveMatrix\", this._emissiveTextureAndColor.texture.getTextureMatrix());\r\n }\r\n\r\n // Bones\r\n if (renderingMesh.useBones && renderingMesh.computeBonesUsingShaders && renderingMesh.skeleton) {\r\n const skeleton = renderingMesh.skeleton;\r\n\r\n if (skeleton.isUsingTextureForMatrices) {\r\n const boneTexture = skeleton.getTransformMatrixTexture(renderingMesh);\r\n if (!boneTexture) {\r\n return;\r\n }\r\n\r\n effect.setTexture(\"boneSampler\", boneTexture);\r\n effect.setFloat(\"boneTextureWidth\", 4.0 * (skeleton.bones.length + 1));\r\n } else {\r\n effect.setMatrices(\"mBones\", skeleton.getTransformMatrices(renderingMesh));\r\n }\r\n }\r\n\r\n // Morph targets\r\n BindMorphTargetParameters(renderingMesh, effect);\r\n if (renderingMesh.morphTargetManager && renderingMesh.morphTargetManager.isUsingTextureForTargets) {\r\n renderingMesh.morphTargetManager._bind(effect);\r\n }\r\n\r\n // Alpha mode\r\n if (enableAlphaMode) {\r\n engine.setAlphaMode(material.alphaMode);\r\n }\r\n\r\n // Intensity of effect\r\n effect.setFloat(\"glowIntensity\", this.getEffectIntensity(renderingMesh));\r\n\r\n // Clip planes\r\n bindClipPlane(effect, material, scene);\r\n }\r\n\r\n // Draw\r\n renderingMesh._processRendering(effectiveMesh, subMesh, effect, material.fillMode, batch, hardwareInstancedRendering, (isInstance, world) =>\r\n effect.setMatrix(\"world\", world)\r\n );\r\n } else {\r\n // Need to reset refresh rate of the main map\r\n this._mainTexture.resetRefreshCounter();\r\n }\r\n\r\n this.onAfterRenderMeshToEffect.notifyObservers(ownerMesh);\r\n }\r\n\r\n /**\r\n * Defines whether the current material of the mesh should be use to render the effect.\r\n * @param mesh defines the current mesh to render\r\n * @returns true if the mesh material should be use\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _useMeshMaterial(mesh: AbstractMesh): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Rebuild the required buffers.\r\n * @internal Internal use only.\r\n */\r\n public _rebuild(): void {\r\n const vb = this._vertexBuffers[VertexBuffer.PositionKind];\r\n\r\n if (vb) {\r\n vb._rebuild();\r\n }\r\n\r\n this._generateIndexBuffer();\r\n }\r\n\r\n /**\r\n * Dispose only the render target textures and post process.\r\n */\r\n private _disposeTextureAndPostProcesses(): void {\r\n this._mainTexture.dispose();\r\n\r\n for (let i = 0; i < this._postProcesses.length; i++) {\r\n if (this._postProcesses[i]) {\r\n this._postProcesses[i].dispose();\r\n }\r\n }\r\n this._postProcesses = [];\r\n\r\n for (let i = 0; i < this._textures.length; i++) {\r\n if (this._textures[i]) {\r\n this._textures[i].dispose();\r\n }\r\n }\r\n this._textures = [];\r\n }\r\n\r\n /**\r\n * Dispose the highlight layer and free resources.\r\n */\r\n public dispose(): void {\r\n const vertexBuffer = this._vertexBuffers[VertexBuffer.PositionKind];\r\n if (vertexBuffer) {\r\n vertexBuffer.dispose();\r\n this._vertexBuffers[VertexBuffer.PositionKind] = null;\r\n }\r\n\r\n if (this._indexBuffer) {\r\n this._scene.getEngine()._releaseBuffer(this._indexBuffer);\r\n this._indexBuffer = null;\r\n }\r\n\r\n for (const drawWrapper of this._mergeDrawWrapper) {\r\n drawWrapper.dispose();\r\n }\r\n this._mergeDrawWrapper = [];\r\n\r\n // Clean textures and post processes\r\n this._disposeTextureAndPostProcesses();\r\n\r\n // Remove from scene\r\n const index = this._scene.effectLayers.indexOf(this, 0);\r\n if (index > -1) {\r\n this._scene.effectLayers.splice(index, 1);\r\n }\r\n\r\n // Callback\r\n this.onDisposeObservable.notifyObservers(this);\r\n\r\n this.onDisposeObservable.clear();\r\n this.onBeforeRenderMainTextureObservable.clear();\r\n this.onBeforeComposeObservable.clear();\r\n this.onBeforeRenderMeshToEffect.clear();\r\n this.onAfterRenderMeshToEffect.clear();\r\n this.onAfterComposeObservable.clear();\r\n this.onSizeChangedObservable.clear();\r\n }\r\n\r\n /**\r\n * Gets the class name of the effect layer\r\n * @returns the string with the class name of the effect layer\r\n */\r\n public getClassName(): string {\r\n return \"EffectLayer\";\r\n }\r\n\r\n /**\r\n * Creates an effect layer from parsed effect layer data\r\n * @param parsedEffectLayer defines effect layer data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing the effect layer information\r\n * @returns a parsed effect Layer\r\n */\r\n public static Parse(parsedEffectLayer: any, scene: Scene, rootUrl: string): EffectLayer {\r\n const effectLayerType = Tools.Instantiate(parsedEffectLayer.customType);\r\n\r\n return effectLayerType.Parse(parsedEffectLayer, scene, rootUrl);\r\n }\r\n}\r\n"]}
@@ -59,7 +59,7 @@ export interface IGlowLayerOptions {
59
59
  */
60
60
  alphaBlendingMode?: number;
61
61
  /**
62
- * The type of the main texture. Default: TEXTURETYPE_UNSIGNED_INT
62
+ * The type of the main texture. Default: TEXTURETYPE_UNSIGNED_BYTE
63
63
  */
64
64
  mainTextureType: number;
65
65
  /**