@onerjs/core 8.36.2 → 8.36.4
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.
- package/Animations/animation.d.ts +4 -0
- package/Animations/animation.js +7 -0
- package/Animations/animation.js.map +1 -1
- package/Behaviors/Cameras/geospatialClippingBehavior.d.ts +40 -0
- package/Behaviors/Cameras/geospatialClippingBehavior.js +80 -0
- package/Behaviors/Cameras/geospatialClippingBehavior.js.map +1 -0
- package/Behaviors/Cameras/index.d.ts +2 -0
- package/Behaviors/Cameras/index.js +2 -0
- package/Behaviors/Cameras/index.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraPointersInput.js +4 -2
- package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
- package/Cameras/Limits/geospatialLimits.d.ts +9 -1
- package/Cameras/Limits/geospatialLimits.js +23 -3
- package/Cameras/Limits/geospatialLimits.js.map +1 -1
- package/Cameras/geospatialCamera.d.ts +23 -0
- package/Cameras/geospatialCamera.js +109 -34
- package/Cameras/geospatialCamera.js.map +1 -1
- package/Cameras/geospatialCameraMovement.js +1 -0
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Debug/debugLayer.js +11 -3
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/IAssetContainer.d.ts +5 -0
- package/IAssetContainer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +5 -0
- package/Layers/highlightLayer.js +13 -0
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.js +1 -1
- package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +2 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/effectRenderer.d.ts +2 -1
- package/Materials/effectRenderer.js +2 -12
- package/Materials/effectRenderer.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +6 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +21 -17
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Particles/Node/Blocks/index.d.ts +3 -0
- package/Particles/Node/Blocks/index.js +3 -0
- package/Particles/Node/Blocks/index.js.map +1 -1
- package/Particles/Node/Blocks/particleNLerpBlock.d.ts +35 -0
- package/Particles/Node/Blocks/particleNLerpBlock.js +97 -0
- package/Particles/Node/Blocks/particleNLerpBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleSmoothStepBlock.d.ts +34 -0
- package/Particles/Node/Blocks/particleSmoothStepBlock.js +91 -0
- package/Particles/Node/Blocks/particleSmoothStepBlock.js.map +1 -0
- package/Particles/Node/Blocks/particleStepBlock.d.ts +30 -0
- package/Particles/Node/Blocks/particleStepBlock.js +84 -0
- package/Particles/Node/Blocks/particleStepBlock.js.map +1 -0
- package/Particles/solidParticleSystem.d.ts +3 -0
- package/Particles/solidParticleSystem.js +7 -4
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Sprites/spriteManager.d.ts +3 -0
- package/Sprites/spriteManager.js +9 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/assetContainer.d.ts +5 -0
- package/assetContainer.js +32 -0
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
package/IAssetContainer.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ import type { EffectLayer } from "./Layers/effectLayer.js";
|
|
|
21
21
|
import type { ReflectionProbe } from "./Probes/reflectionProbe.js";
|
|
22
22
|
import type { LensFlareSystem } from "./LensFlares/lensFlareSystem.js";
|
|
23
23
|
import type { ProceduralTexture } from "./Materials/Textures/Procedurals/proceduralTexture.js";
|
|
24
|
+
import type { ISpriteManager } from "./Sprites/spriteManager.js";
|
|
24
25
|
/**
|
|
25
26
|
* Interface defining container for the different elements composing a scene.
|
|
26
27
|
* This class is dynamically extended by the different components of the scene increasing
|
|
@@ -136,6 +137,10 @@ export interface IAssetContainer {
|
|
|
136
137
|
* The list of procedural textures added to the scene
|
|
137
138
|
*/
|
|
138
139
|
proceduralTextures: ProceduralTexture[];
|
|
140
|
+
/**
|
|
141
|
+
* The list of sprite managers added to the scene
|
|
142
|
+
*/
|
|
143
|
+
spriteManagers?: ISpriteManager[];
|
|
139
144
|
/**
|
|
140
145
|
* @returns all meshes, lights, cameras, transformNodes and bones
|
|
141
146
|
*/
|
package/IAssetContainer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAssetContainer.js","sourceRoot":"","sources":["../../../dev/core/src/IAssetContainer.ts"],"names":[],"mappings":"","sourcesContent":["import type { Nullable } from \"./types\";\r\nimport type { AbstractMesh } from \"./Meshes/abstractMesh\";\r\nimport type { TransformNode } from \"./Meshes/transformNode\";\r\nimport type { Geometry } from \"./Meshes/geometry\";\r\nimport type { Skeleton } from \"./Bones/skeleton\";\r\nimport type { MorphTargetManager } from \"./Morph/morphTargetManager\";\r\nimport type { IParticleSystem } from \"./Particles/IParticleSystem\";\r\nimport type { AnimationGroup } from \"./Animations/animationGroup\";\r\nimport type { BaseTexture } from \"./Materials/Textures/baseTexture\";\r\nimport type { Material } from \"./Materials/material\";\r\nimport type { MultiMaterial } from \"./Materials/multiMaterial\";\r\nimport type { AbstractActionManager } from \"./Actions/abstractActionManager\";\r\nimport type { Camera } from \"./Cameras/camera\";\r\nimport type { Light } from \"./Lights/light\";\r\nimport type { Node } from \"./node\";\r\nimport type { PostProcess } from \"./PostProcesses/postProcess\";\r\nimport type { Animation } from \"./Animations/animation\";\r\nimport type { Sound } from \"./Audio/sound\";\r\nimport type { Layer } from \"./Layers/layer\";\r\nimport type { EffectLayer } from \"./Layers/effectLayer\";\r\nimport type { ReflectionProbe } from \"./Probes/reflectionProbe\";\r\nimport type { LensFlareSystem } from \"./LensFlares/lensFlareSystem\";\r\nimport type { ProceduralTexture } from \"./Materials/Textures/Procedurals/proceduralTexture\";\r\n/**\r\n * Interface defining container for the different elements composing a scene.\r\n * This class is dynamically extended by the different components of the scene increasing\r\n * flexibility and reducing coupling\r\n */\r\nexport interface IAssetContainer {\r\n /**\r\n * Gets the list of root nodes (ie. nodes with no parent)\r\n */\r\n rootNodes: Node[];\r\n\r\n /** All of the cameras added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n */\r\n cameras: Camera[];\r\n\r\n /**\r\n * All of the lights added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction\r\n */\r\n lights: Light[];\r\n\r\n /**\r\n * All of the (abstract) meshes added to this scene\r\n */\r\n meshes: AbstractMesh[];\r\n\r\n /**\r\n * The list of skeletons added to the scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons\r\n */\r\n skeletons: Skeleton[];\r\n\r\n /**\r\n * All of the particle systems added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro\r\n */\r\n particleSystems: IParticleSystem[];\r\n\r\n /**\r\n * Gets a list of Animations associated with the scene\r\n */\r\n animations: Animation[];\r\n\r\n /**\r\n * All of the animation groups added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations\r\n */\r\n animationGroups: AnimationGroup[];\r\n\r\n /**\r\n * All of the multi-materials added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials\r\n */\r\n multiMaterials: MultiMaterial[];\r\n\r\n /**\r\n * All of the materials added to this scene\r\n * In the context of a Scene, it is not supposed to be modified manually.\r\n * Any addition or removal should be done using the addMaterial and removeMaterial Scene methods.\r\n * Note also that the order of the Material within the array is not significant and might change.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction\r\n */\r\n materials: Material[];\r\n\r\n /**\r\n * The list of morph target managers added to the scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph\r\n */\r\n morphTargetManagers: MorphTargetManager[];\r\n\r\n /**\r\n * The list of geometries used in the scene.\r\n */\r\n geometries: Geometry[];\r\n\r\n /**\r\n * All of the transform nodes added to this scene\r\n * In the context of a Scene, it is not supposed to be modified manually.\r\n * Any addition or removal should be done using the addTransformNode and removeTransformNode Scene methods.\r\n * Note also that the order of the TransformNode within the array is not significant and might change.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/transform_node\r\n */\r\n transformNodes: TransformNode[];\r\n\r\n /**\r\n * ActionManagers available on the scene.\r\n * @deprecated\r\n */\r\n actionManagers: AbstractActionManager[];\r\n\r\n /**\r\n * Textures to keep.\r\n */\r\n textures: BaseTexture[];\r\n\r\n /**\r\n * Texture used in all pbr material as the reflection texture.\r\n * As in the majority of the scene they are the same (exception for multi room and so on),\r\n * this is easier to reference from here than from all the materials.\r\n */\r\n environmentTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * The list of postprocesses added to the scene\r\n */\r\n postProcesses: PostProcess[];\r\n\r\n /**\r\n * The list of sound added to the scene\r\n */\r\n sounds: Nullable<Sound[]>;\r\n\r\n /**\r\n * The list of effect layers added to the scene\r\n */\r\n effectLayers: EffectLayer[];\r\n\r\n /**\r\n * The list of layers added to the scene\r\n */\r\n layers: Layer[];\r\n\r\n /**\r\n * The list of reflection probes added to the scene\r\n */\r\n reflectionProbes: ReflectionProbe[];\r\n\r\n /**\r\n * The list of lens flare system added to the scene\r\n */\r\n lensFlareSystems: LensFlareSystem[];\r\n\r\n /**\r\n * The list of procedural textures added to the scene\r\n */\r\n proceduralTextures: ProceduralTexture[];\r\n\r\n /**\r\n * @returns all meshes, lights, cameras, transformNodes and bones\r\n */\r\n getNodes(): Array<Node>;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"IAssetContainer.js","sourceRoot":"","sources":["../../../dev/core/src/IAssetContainer.ts"],"names":[],"mappings":"","sourcesContent":["import type { Nullable } from \"./types\";\r\nimport type { AbstractMesh } from \"./Meshes/abstractMesh\";\r\nimport type { TransformNode } from \"./Meshes/transformNode\";\r\nimport type { Geometry } from \"./Meshes/geometry\";\r\nimport type { Skeleton } from \"./Bones/skeleton\";\r\nimport type { MorphTargetManager } from \"./Morph/morphTargetManager\";\r\nimport type { IParticleSystem } from \"./Particles/IParticleSystem\";\r\nimport type { AnimationGroup } from \"./Animations/animationGroup\";\r\nimport type { BaseTexture } from \"./Materials/Textures/baseTexture\";\r\nimport type { Material } from \"./Materials/material\";\r\nimport type { MultiMaterial } from \"./Materials/multiMaterial\";\r\nimport type { AbstractActionManager } from \"./Actions/abstractActionManager\";\r\nimport type { Camera } from \"./Cameras/camera\";\r\nimport type { Light } from \"./Lights/light\";\r\nimport type { Node } from \"./node\";\r\nimport type { PostProcess } from \"./PostProcesses/postProcess\";\r\nimport type { Animation } from \"./Animations/animation\";\r\nimport type { Sound } from \"./Audio/sound\";\r\nimport type { Layer } from \"./Layers/layer\";\r\nimport type { EffectLayer } from \"./Layers/effectLayer\";\r\nimport type { ReflectionProbe } from \"./Probes/reflectionProbe\";\r\nimport type { LensFlareSystem } from \"./LensFlares/lensFlareSystem\";\r\nimport type { ProceduralTexture } from \"./Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { ISpriteManager } from \"./Sprites/spriteManager\";\r\n/**\r\n * Interface defining container for the different elements composing a scene.\r\n * This class is dynamically extended by the different components of the scene increasing\r\n * flexibility and reducing coupling\r\n */\r\nexport interface IAssetContainer {\r\n /**\r\n * Gets the list of root nodes (ie. nodes with no parent)\r\n */\r\n rootNodes: Node[];\r\n\r\n /** All of the cameras added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n */\r\n cameras: Camera[];\r\n\r\n /**\r\n * All of the lights added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction\r\n */\r\n lights: Light[];\r\n\r\n /**\r\n * All of the (abstract) meshes added to this scene\r\n */\r\n meshes: AbstractMesh[];\r\n\r\n /**\r\n * The list of skeletons added to the scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons\r\n */\r\n skeletons: Skeleton[];\r\n\r\n /**\r\n * All of the particle systems added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro\r\n */\r\n particleSystems: IParticleSystem[];\r\n\r\n /**\r\n * Gets a list of Animations associated with the scene\r\n */\r\n animations: Animation[];\r\n\r\n /**\r\n * All of the animation groups added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations\r\n */\r\n animationGroups: AnimationGroup[];\r\n\r\n /**\r\n * All of the multi-materials added to this scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials\r\n */\r\n multiMaterials: MultiMaterial[];\r\n\r\n /**\r\n * All of the materials added to this scene\r\n * In the context of a Scene, it is not supposed to be modified manually.\r\n * Any addition or removal should be done using the addMaterial and removeMaterial Scene methods.\r\n * Note also that the order of the Material within the array is not significant and might change.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction\r\n */\r\n materials: Material[];\r\n\r\n /**\r\n * The list of morph target managers added to the scene\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph\r\n */\r\n morphTargetManagers: MorphTargetManager[];\r\n\r\n /**\r\n * The list of geometries used in the scene.\r\n */\r\n geometries: Geometry[];\r\n\r\n /**\r\n * All of the transform nodes added to this scene\r\n * In the context of a Scene, it is not supposed to be modified manually.\r\n * Any addition or removal should be done using the addTransformNode and removeTransformNode Scene methods.\r\n * Note also that the order of the TransformNode within the array is not significant and might change.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/transform_node\r\n */\r\n transformNodes: TransformNode[];\r\n\r\n /**\r\n * ActionManagers available on the scene.\r\n * @deprecated\r\n */\r\n actionManagers: AbstractActionManager[];\r\n\r\n /**\r\n * Textures to keep.\r\n */\r\n textures: BaseTexture[];\r\n\r\n /**\r\n * Texture used in all pbr material as the reflection texture.\r\n * As in the majority of the scene they are the same (exception for multi room and so on),\r\n * this is easier to reference from here than from all the materials.\r\n */\r\n environmentTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * The list of postprocesses added to the scene\r\n */\r\n postProcesses: PostProcess[];\r\n\r\n /**\r\n * The list of sound added to the scene\r\n */\r\n sounds: Nullable<Sound[]>;\r\n\r\n /**\r\n * The list of effect layers added to the scene\r\n */\r\n effectLayers: EffectLayer[];\r\n\r\n /**\r\n * The list of layers added to the scene\r\n */\r\n layers: Layer[];\r\n\r\n /**\r\n * The list of reflection probes added to the scene\r\n */\r\n reflectionProbes: ReflectionProbe[];\r\n\r\n /**\r\n * The list of lens flare system added to the scene\r\n */\r\n lensFlareSystems: LensFlareSystem[];\r\n\r\n /**\r\n * The list of procedural textures added to the scene\r\n */\r\n proceduralTextures: ProceduralTexture[];\r\n\r\n /**\r\n * The list of sprite managers added to the scene\r\n */\r\n spriteManagers?: ISpriteManager[];\r\n\r\n /**\r\n * @returns all meshes, lights, cameras, transformNodes and bones\r\n */\r\n getNodes(): Array<Node>;\r\n}\r\n"]}
|
|
@@ -178,6 +178,11 @@ export declare class HighlightLayer extends EffectLayer {
|
|
|
178
178
|
* @param glowEmissiveOnly Extract the glow from the emissive texture
|
|
179
179
|
*/
|
|
180
180
|
addMesh(mesh: Mesh, color: Color3, glowEmissiveOnly?: boolean): void;
|
|
181
|
+
/**
|
|
182
|
+
* Get all meshes from the highlight layer
|
|
183
|
+
* @returns Mesh[]
|
|
184
|
+
*/
|
|
185
|
+
getAllMeshes(): Mesh[];
|
|
181
186
|
/**
|
|
182
187
|
* Remove a mesh from the highlight layer in order to make it stop glowing.
|
|
183
188
|
* @param mesh The mesh to highlight
|
package/Layers/highlightLayer.js
CHANGED
|
@@ -378,6 +378,19 @@ export class HighlightLayer extends EffectLayer {
|
|
|
378
378
|
addMesh(mesh, color, glowEmissiveOnly = false) {
|
|
379
379
|
this._thinEffectLayer.addMesh(mesh, color, glowEmissiveOnly);
|
|
380
380
|
}
|
|
381
|
+
/**
|
|
382
|
+
* Get all meshes from the highlight layer
|
|
383
|
+
* @returns Mesh[]
|
|
384
|
+
*/
|
|
385
|
+
getAllMeshes() {
|
|
386
|
+
return this._thinEffectLayer._meshes
|
|
387
|
+
? Object.values(this._thinEffectLayer._meshes)
|
|
388
|
+
.map((mesh) => {
|
|
389
|
+
return mesh?.mesh;
|
|
390
|
+
})
|
|
391
|
+
.filter(Boolean)
|
|
392
|
+
: [];
|
|
393
|
+
}
|
|
381
394
|
/**
|
|
382
395
|
* Remove a mesh from the highlight layer in order to make it stop glowing.
|
|
383
396
|
* @param mesh The mesh to highlight
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlightLayer.js","sourceRoot":"","sources":["../../../../dev/core/src/Layers/highlightLayer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAO/C,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;A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AAC,KAAK,CAAC,CAAC,CAAC;YAC5E,IAAI,IAAI,EAAE,CAAC;gBACP,EAAE,CAAC,eAAe,CAAO,IAAI,CAAC,CAAC;YACnC,CAAC;QACL,CAAC;QAED,kBAAkB;QAClB,KAAK,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,qBAAqB,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;YACnE,MAAM,eAAe,GAAG,qBAAqB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5D,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAEvD,IAAI,IAAI,EAAE,CAAC;gBACP,EAAE,CAAC,OAAO,CAAO,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;YACtG,CAAC;QACL,CAAC;QAED,OAAO,EAAE,CAAC;IACd,CAAC;;AApeD;;GAEG;AACoB,yBAAU,GAAG,gBAAgB,AAAnB,CAAoB;AAkBrD;IADC,SAAS,EAAE;+CAGX;AAUD;IADC,SAAS,EAAE;+CAGX;AAwBD;IADC,SAAS,EAAE;wDAGX;AAMD;IADC,SAAS,EAAE;sDAGX;AAaO;IADP,SAAS,CAAC,SAAS,CAAC;gDAC8B;AAqZvD,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport { Scene } from \"../scene\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Material } from \"../Materials/material\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { PostProcessOptions } from \"../PostProcesses/postProcess\";\r\nimport { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport { PassPostProcess } from \"../PostProcesses/passPostProcess\";\r\nimport { BlurPostProcess } from \"../PostProcesses/blurPostProcess\";\r\nimport { EffectLayer } from \"./effectLayer\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { Color4 } from \"../Maths/math.color\";\r\nimport { Color3 } from \"../Maths/math.color\";\r\n\r\nimport type { ThinPassPostProcess } from \"core/PostProcesses/thinPassPostProcess\";\r\nimport type { ThinBlurPostProcess } from \"core/PostProcesses/thinBlurPostProcess\";\r\nimport type { IThinHighlightLayerOptions } from \"./thinHighlightLayer\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\nimport { GetExponentOfTwo } from \"../Misc/tools.functions\";\r\nimport { ThinHighlightLayer } from \"./thinHighlightLayer\";\r\nimport { ThinGlowBlurPostProcess } from \"./thinEffectLayer\";\r\n\r\ndeclare module \"../scene\" {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n export interface Scene {\r\n /**\r\n * Return a the first highlight layer of the scene with a given name.\r\n * @param name The name of the highlight layer to look for.\r\n * @returns The highlight layer if found otherwise null.\r\n */\r\n getHighlightLayerByName(name: string): Nullable<HighlightLayer>;\r\n }\r\n}\r\n\r\nScene.prototype.getHighlightLayerByName = function (name: string): Nullable<HighlightLayer> {\r\n for (let index = 0; index < this.effectLayers?.length; index++) {\r\n if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === HighlightLayer.EffectName) {\r\n return (<any>this.effectLayers[index]) as HighlightLayer;\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\ninterface IBlurPostProcess extends PostProcess {\r\n kernel: number;\r\n}\r\n\r\n/**\r\n * Special Glow Blur post process only blurring the alpha channel\r\n * It enforces keeping the most luminous color in the color channel.\r\n */\r\nclass GlowBlurPostProcess extends PostProcess {\r\n protected override _effectWrapper: ThinGlowBlurPostProcess;\r\n\r\n constructor(\r\n name: string,\r\n public direction: Vector2,\r\n public kernel: number,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera> = null,\r\n samplingMode: number = Texture.BILINEAR_SAMPLINGMODE,\r\n engine?: AbstractEngine,\r\n reusable?: boolean\r\n ) {\r\n const localOptions = {\r\n uniforms: ThinGlowBlurPostProcess.Uniforms,\r\n size: typeof options === \"number\" ? options : undefined,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n ...(options as PostProcessOptions),\r\n };\r\n\r\n super(name, ThinGlowBlurPostProcess.FragmentUrl, {\r\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinGlowBlurPostProcess(name, engine, direction, kernel, localOptions) : undefined,\r\n ...localOptions,\r\n });\r\n\r\n this.onApplyObservable.add(() => {\r\n this._effectWrapper.textureWidth = this.width;\r\n this._effectWrapper.textureHeight = this.height;\r\n });\r\n }\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/glowBlurPostProcess.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/glowBlurPostProcess.fragment\"));\r\n }\r\n\r\n super._gatherImports(useWebGPU, list);\r\n }\r\n}\r\n\r\n/**\r\n * Highlight layer options. This helps customizing the behaviour\r\n * of the highlight layer.\r\n */\r\nexport interface IHighlightLayerOptions extends IThinHighlightLayerOptions {}\r\n\r\n/**\r\n * The highlight layer Helps adding a glow effect around a mesh.\r\n *\r\n * Once instantiated in a scene, simply use the addMesh or removeMesh method to add or remove\r\n * glowy meshes to your scene.\r\n *\r\n * !!! THIS REQUIRES AN ACTIVE STENCIL BUFFER ON THE CANVAS !!!\r\n */\r\nexport class HighlightLayer extends EffectLayer {\r\n /**\r\n * Effect Name of the highlight layer.\r\n */\r\n public static readonly EffectName = \"HighlightLayer\";\r\n\r\n /**\r\n * The neutral color used during the preparation of the glow effect.\r\n * This is black by default as the blend operation is a blend operation.\r\n */\r\n public static get NeutralColor() {\r\n return ThinHighlightLayer.NeutralColor;\r\n }\r\n\r\n public static set NeutralColor(value: Color4) {\r\n ThinHighlightLayer.NeutralColor = value;\r\n }\r\n\r\n /**\r\n * Specifies whether or not the inner glow is ACTIVE in the layer.\r\n */\r\n @serialize()\r\n public get innerGlow() {\r\n return this._thinEffectLayer.innerGlow;\r\n }\r\n\r\n public set innerGlow(value: boolean) {\r\n this._thinEffectLayer.innerGlow = value;\r\n }\r\n\r\n /**\r\n * Specifies whether or not the outer glow is ACTIVE in the layer.\r\n */\r\n @serialize()\r\n public get outerGlow() {\r\n return this._thinEffectLayer.outerGlow;\r\n }\r\n\r\n public set outerGlow(value: boolean) {\r\n this._thinEffectLayer.outerGlow = value;\r\n }\r\n\r\n /**\r\n * Specifies the horizontal size of the blur.\r\n */\r\n public set blurHorizontalSize(value: number) {\r\n this._thinEffectLayer.blurHorizontalSize = value;\r\n }\r\n\r\n /**\r\n * Specifies the vertical size of the blur.\r\n */\r\n public set blurVerticalSize(value: number) {\r\n this._thinEffectLayer.blurVerticalSize = value;\r\n }\r\n\r\n /**\r\n * Gets the horizontal size of the blur.\r\n */\r\n @serialize()\r\n public get blurHorizontalSize(): number {\r\n return this._thinEffectLayer.blurHorizontalSize;\r\n }\r\n\r\n /**\r\n * Gets the vertical size of the blur.\r\n */\r\n @serialize()\r\n public get blurVerticalSize(): number {\r\n return this._thinEffectLayer.blurVerticalSize;\r\n }\r\n\r\n /**\r\n * An event triggered when the highlight layer is being blurred.\r\n */\r\n public onBeforeBlurObservable = new Observable<HighlightLayer>();\r\n\r\n /**\r\n * An event triggered when the highlight layer has been blurred.\r\n */\r\n public onAfterBlurObservable = new Observable<HighlightLayer>();\r\n\r\n @serialize(\"options\")\r\n private _options: Required<IHighlightLayerOptions>;\r\n\r\n protected override readonly _thinEffectLayer: ThinHighlightLayer;\r\n private _downSamplePostprocess: PassPostProcess;\r\n private _horizontalBlurPostprocess: IBlurPostProcess;\r\n private _verticalBlurPostprocess: IBlurPostProcess;\r\n private _blurTexture: RenderTargetTexture;\r\n\r\n /**\r\n * Instantiates a new highlight Layer and references it to 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 options Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information)\r\n */\r\n constructor(name: string, scene?: Scene, options?: Partial<IHighlightLayerOptions>) {\r\n super(name, scene, options !== undefined ? !!options.forceGLSL : false, new ThinHighlightLayer(name, scene, options));\r\n\r\n // Warn on stencil\r\n if (!this._engine.isStencilEnable) {\r\n Logger.Warn(\"Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }\");\r\n }\r\n\r\n // Adapt options\r\n this._options = {\r\n mainTextureRatio: 0.5,\r\n blurTextureSizeRatio: 0.5,\r\n mainTextureFixedSize: 0,\r\n blurHorizontalSize: 1.0,\r\n blurVerticalSize: 1.0,\r\n alphaBlendingMode: Constants.ALPHA_COMBINE,\r\n camera: null,\r\n renderingGroupId: -1,\r\n mainTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n forceGLSL: false,\r\n isStroke: false,\r\n ...options,\r\n };\r\n\r\n // Initialize the layer\r\n this._init(this._options);\r\n\r\n // Do not render as long as no meshes have been added\r\n this._shouldRender = false;\r\n }\r\n\r\n /**\r\n * Get the effect name of the layer.\r\n * @returns The effect name\r\n */\r\n public getEffectName(): string {\r\n return HighlightLayer.EffectName;\r\n }\r\n\r\n protected override _numInternalDraws(): number {\r\n return 2; // we need two rendering, one for the inner glow and the other for the outer glow\r\n }\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 created\r\n */\r\n protected _createMergeEffect(): Effect {\r\n return this._thinEffectLayer._createMergeEffect();\r\n }\r\n\r\n /**\r\n * Creates the render target textures and post processes used in the highlight layer.\r\n */\r\n protected _createTextureAndPostProcesses(): void {\r\n let blurTextureWidth = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio;\r\n let blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;\r\n blurTextureWidth = this._engine.needPOTTextures ? GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;\r\n blurTextureHeight = this._engine.needPOTTextures ? GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;\r\n\r\n let textureType = 0;\r\n if (this._engine.getCaps().textureHalfFloatRender) {\r\n textureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else {\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n }\r\n\r\n this._blurTexture = new RenderTargetTexture(\r\n \"HighlightLayerBlurRTT\",\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n this._scene,\r\n false,\r\n true,\r\n textureType\r\n );\r\n this._blurTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture.anisotropicFilteringLevel = 16;\r\n this._blurTexture.updateSamplingMode(Texture.TRILINEAR_SAMPLINGMODE);\r\n this._blurTexture.renderParticles = false;\r\n this._blurTexture.ignoreCameraViewport = true;\r\n\r\n this._textures = [this._blurTexture];\r\n\r\n this._thinEffectLayer.bindTexturesForCompose = (effect: Effect) => {\r\n effect.setTexture(\"textureSampler\", this._blurTexture);\r\n };\r\n\r\n this._thinEffectLayer._createTextureAndPostProcesses();\r\n\r\n if (this._options.alphaBlendingMode === Constants.ALPHA_COMBINE) {\r\n this._downSamplePostprocess = new PassPostProcess(\"HighlightLayerPPP\", {\r\n size: this._options.blurTextureSizeRatio,\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n effectWrapper: this._thinEffectLayer._postProcesses[0] as ThinPassPostProcess,\r\n });\r\n this._downSamplePostprocess.externalTextureSamplerBinding = true;\r\n this._downSamplePostprocess.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._mainTexture);\r\n });\r\n\r\n this._horizontalBlurPostprocess = new GlowBlurPostProcess(\"HighlightLayerHBP\", new Vector2(1.0, 0), this._options.blurHorizontalSize, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n effectWrapper: this._thinEffectLayer._postProcesses[1] as ThinGlowBlurPostProcess,\r\n });\r\n this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setFloat2(\"screenSize\", blurTextureWidth, blurTextureHeight);\r\n });\r\n\r\n this._verticalBlurPostprocess = new GlowBlurPostProcess(\"HighlightLayerVBP\", new Vector2(0, 1.0), this._options.blurVerticalSize, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n effectWrapper: this._thinEffectLayer._postProcesses[2] as ThinGlowBlurPostProcess,\r\n });\r\n this._verticalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setFloat2(\"screenSize\", blurTextureWidth, blurTextureHeight);\r\n });\r\n\r\n this._postProcesses = [this._downSamplePostprocess, this._horizontalBlurPostprocess, this._verticalBlurPostprocess];\r\n } else {\r\n this._horizontalBlurPostprocess = new BlurPostProcess(\"HighlightLayerHBP\", new Vector2(1.0, 0), this._options.blurHorizontalSize / 2, {\r\n size: {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n textureType,\r\n effectWrapper: this._thinEffectLayer._postProcesses[0] as ThinBlurPostProcess,\r\n });\r\n this._horizontalBlurPostprocess.width = blurTextureWidth;\r\n this._horizontalBlurPostprocess.height = blurTextureHeight;\r\n this._horizontalBlurPostprocess.externalTextureSamplerBinding = true;\r\n this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._mainTexture);\r\n });\r\n\r\n this._verticalBlurPostprocess = new BlurPostProcess(\"HighlightLayerVBP\", new Vector2(0, 1.0), this._options.blurVerticalSize / 2, {\r\n size: {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n textureType,\r\n });\r\n\r\n this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess];\r\n }\r\n\r\n this._mainTexture.onAfterUnbindObservable.add(() => {\r\n this.onBeforeBlurObservable.notifyObservers(this);\r\n\r\n const internalTexture = this._blurTexture.renderTarget;\r\n if (internalTexture) {\r\n this._scene.postProcessManager.directRender(this._postProcesses, internalTexture, true);\r\n this._engine.unBindFramebuffer(internalTexture, true);\r\n }\r\n\r\n this.onAfterBlurObservable.notifyObservers(this);\r\n });\r\n\r\n // Prevent autoClear.\r\n this._postProcesses.map((pp) => {\r\n pp.autoClear = false;\r\n });\r\n\r\n this._mainTextureCreatedSize.width = this._mainTextureDesiredSize.width;\r\n this._mainTextureCreatedSize.height = this._mainTextureDesiredSize.height;\r\n }\r\n\r\n /**\r\n * @returns whether or not the layer needs stencil enabled during the mesh rendering.\r\n */\r\n public needStencil(): boolean {\r\n return this._thinEffectLayer.needStencil();\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 * @returns true if ready otherwise, false\r\n */\r\n public isReady(subMesh: SubMesh, useInstances: boolean): boolean {\r\n return this._thinEffectLayer.isReady(subMesh, useInstances);\r\n }\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 renderIndex\r\n */\r\n protected _internalRender(effect: Effect, renderIndex: number): void {\r\n this._thinEffectLayer._internalCompose(effect, renderIndex);\r\n }\r\n\r\n /**\r\n * @returns true if the layer contains information to display, otherwise false.\r\n */\r\n public override shouldRender(): boolean {\r\n return this._thinEffectLayer.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 protected override _shouldRenderMesh(mesh: Mesh): boolean {\r\n return this._thinEffectLayer._shouldRenderMesh(mesh);\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 override _canRenderMesh(mesh: AbstractMesh, material: Material): boolean {\r\n return this._thinEffectLayer._canRenderMesh(mesh, material);\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 protected override _addCustomEffectDefines(defines: string[]): void {\r\n this._thinEffectLayer._addCustomEffectDefines(defines);\r\n }\r\n\r\n /**\r\n * Sets the required values for both the emissive texture and and the main color.\r\n * @param mesh\r\n * @param subMesh\r\n * @param material\r\n */\r\n protected _setEmissiveTextureAndColor(mesh: Mesh, subMesh: SubMesh, material: Material): void {\r\n this._thinEffectLayer._setEmissiveTextureAndColor(mesh, subMesh, material);\r\n }\r\n\r\n /**\r\n * Add a mesh in the exclusion list to prevent it to impact or being impacted by the highlight layer.\r\n * @param mesh The mesh to exclude from the highlight layer\r\n */\r\n public addExcludedMesh(mesh: Mesh) {\r\n this._thinEffectLayer.addExcludedMesh(mesh);\r\n }\r\n\r\n /**\r\n * Remove a mesh from the exclusion list to let it impact or being impacted by the highlight layer.\r\n * @param mesh The mesh to highlight\r\n */\r\n public removeExcludedMesh(mesh: Mesh) {\r\n this._thinEffectLayer.removeExcludedMesh(mesh);\r\n }\r\n\r\n /**\r\n * Determine if a given mesh will be highlighted by the current HighlightLayer\r\n * @param mesh mesh to test\r\n * @returns true if the mesh will be highlighted by the current HighlightLayer\r\n */\r\n public override hasMesh(mesh: AbstractMesh): boolean {\r\n return this._thinEffectLayer.hasMesh(mesh);\r\n }\r\n\r\n /**\r\n * Add a mesh in the highlight layer in order to make it glow with the chosen color.\r\n * @param mesh The mesh to highlight\r\n * @param color The color of the highlight\r\n * @param glowEmissiveOnly Extract the glow from the emissive texture\r\n */\r\n public addMesh(mesh: Mesh, color: Color3, glowEmissiveOnly = false) {\r\n this._thinEffectLayer.addMesh(mesh, color, glowEmissiveOnly);\r\n }\r\n\r\n /**\r\n * Remove a mesh from the highlight layer in order to make it stop glowing.\r\n * @param mesh The mesh to highlight\r\n */\r\n public removeMesh(mesh: Mesh) {\r\n this._thinEffectLayer.removeMesh(mesh);\r\n }\r\n\r\n /**\r\n * Remove all the meshes currently referenced in the highlight layer\r\n */\r\n public removeAllMeshes(): void {\r\n this._thinEffectLayer.removeAllMeshes();\r\n }\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 * @internal\r\n */\r\n public _disposeMesh(mesh: Mesh): void {\r\n this._thinEffectLayer._disposeMesh(mesh);\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 override getClassName(): string {\r\n return \"HighlightLayer\";\r\n }\r\n\r\n /**\r\n * Serializes this Highlight layer\r\n * @returns a serialized Highlight layer object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.HighlightLayer\";\r\n\r\n // Highlighted meshes\r\n serializationObject.meshes = [];\r\n\r\n const meshes = this._thinEffectLayer._meshes;\r\n if (meshes) {\r\n for (const m in meshes) {\r\n const mesh = meshes[m];\r\n\r\n if (mesh) {\r\n serializationObject.meshes.push({\r\n glowEmissiveOnly: mesh.glowEmissiveOnly,\r\n color: mesh.color.asArray(),\r\n meshId: mesh.mesh.id,\r\n });\r\n }\r\n }\r\n }\r\n\r\n // Excluded meshes\r\n serializationObject.excludedMeshes = [];\r\n\r\n const excludedMeshes = this._thinEffectLayer._excludedMeshes;\r\n if (excludedMeshes) {\r\n for (const e in excludedMeshes) {\r\n const excludedMesh = excludedMeshes[e];\r\n\r\n if (excludedMesh) {\r\n serializationObject.excludedMeshes.push(excludedMesh.mesh.id);\r\n }\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Highlight layer from parsed Highlight layer data\r\n * @param parsedHightlightLayer defines the Highlight layer data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing the Highlight layer information\r\n * @returns a parsed Highlight layer\r\n */\r\n public static override Parse(parsedHightlightLayer: any, scene: Scene, rootUrl: string): HighlightLayer {\r\n const hl = SerializationHelper.Parse(() => new HighlightLayer(parsedHightlightLayer.name, scene, parsedHightlightLayer.options), parsedHightlightLayer, scene, rootUrl);\r\n let index;\r\n\r\n // Excluded meshes\r\n for (index = 0; index < parsedHightlightLayer.excludedMeshes.length; index++) {\r\n const mesh = scene.getMeshById(parsedHightlightLayer.excludedMeshes[index]);\r\n if (mesh) {\r\n hl.addExcludedMesh(<Mesh>mesh);\r\n }\r\n }\r\n\r\n // Included meshes\r\n for (index = 0; index < parsedHightlightLayer.meshes.length; index++) {\r\n const highlightedMesh = parsedHightlightLayer.meshes[index];\r\n const mesh = scene.getMeshById(highlightedMesh.meshId);\r\n\r\n if (mesh) {\r\n hl.addMesh(<Mesh>mesh, Color3.FromArray(highlightedMesh.color), highlightedMesh.glowEmissiveOnly);\r\n }\r\n }\r\n\r\n return hl;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.HighlightLayer\", HighlightLayer);\r\n"]}
|
|
1
|
+
{"version":3,"file":"highlightLayer.js","sourceRoot":"","sources":["../../../../dev/core/src/Layers/highlightLayer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AAC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C,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;YACnE,MAAM,eAAe,GAAG,qBAAqB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5D,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAEvD,IAAI,IAAI,EAAE,CAAC;gBACP,EAAE,CAAC,OAAO,CAAO,IAAI,EAAE,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC,gBAAgB,CAAC,CAAC;YACtG,CAAC;QACL,CAAC;QAED,OAAO,EAAE,CAAC;IACd,CAAC;;AAlfD;;GAEG;AACoB,yBAAU,GAAG,gBAAgB,AAAnB,CAAoB;AAkBrD;IADC,SAAS,EAAE;+CAGX;AAUD;IADC,SAAS,EAAE;+CAGX;AAwBD;IADC,SAAS,EAAE;wDAGX;AAMD;IADC,SAAS,EAAE;sDAGX;AAaO;IADP,SAAS,CAAC,SAAS,CAAC;gDAC8B;AAmavD,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport { Scene } from \"../scene\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Material } from \"../Materials/material\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { PostProcessOptions } from \"../PostProcesses/postProcess\";\r\nimport { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport { PassPostProcess } from \"../PostProcesses/passPostProcess\";\r\nimport { BlurPostProcess } from \"../PostProcesses/blurPostProcess\";\r\nimport { EffectLayer } from \"./effectLayer\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { Color4 } from \"../Maths/math.color\";\r\nimport { Color3 } from \"../Maths/math.color\";\r\n\r\nimport type { ThinPassPostProcess } from \"core/PostProcesses/thinPassPostProcess\";\r\nimport type { ThinBlurPostProcess } from \"core/PostProcesses/thinBlurPostProcess\";\r\nimport type { IThinHighlightLayerOptions } from \"./thinHighlightLayer\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\nimport { GetExponentOfTwo } from \"../Misc/tools.functions\";\r\nimport { ThinHighlightLayer } from \"./thinHighlightLayer\";\r\nimport { ThinGlowBlurPostProcess } from \"./thinEffectLayer\";\r\n\r\ndeclare module \"../scene\" {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n export interface Scene {\r\n /**\r\n * Return a the first highlight layer of the scene with a given name.\r\n * @param name The name of the highlight layer to look for.\r\n * @returns The highlight layer if found otherwise null.\r\n */\r\n getHighlightLayerByName(name: string): Nullable<HighlightLayer>;\r\n }\r\n}\r\n\r\nScene.prototype.getHighlightLayerByName = function (name: string): Nullable<HighlightLayer> {\r\n for (let index = 0; index < this.effectLayers?.length; index++) {\r\n if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === HighlightLayer.EffectName) {\r\n return (<any>this.effectLayers[index]) as HighlightLayer;\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\ninterface IBlurPostProcess extends PostProcess {\r\n kernel: number;\r\n}\r\n\r\n/**\r\n * Special Glow Blur post process only blurring the alpha channel\r\n * It enforces keeping the most luminous color in the color channel.\r\n */\r\nclass GlowBlurPostProcess extends PostProcess {\r\n protected override _effectWrapper: ThinGlowBlurPostProcess;\r\n\r\n constructor(\r\n name: string,\r\n public direction: Vector2,\r\n public kernel: number,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera> = null,\r\n samplingMode: number = Texture.BILINEAR_SAMPLINGMODE,\r\n engine?: AbstractEngine,\r\n reusable?: boolean\r\n ) {\r\n const localOptions = {\r\n uniforms: ThinGlowBlurPostProcess.Uniforms,\r\n size: typeof options === \"number\" ? options : undefined,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n ...(options as PostProcessOptions),\r\n };\r\n\r\n super(name, ThinGlowBlurPostProcess.FragmentUrl, {\r\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinGlowBlurPostProcess(name, engine, direction, kernel, localOptions) : undefined,\r\n ...localOptions,\r\n });\r\n\r\n this.onApplyObservable.add(() => {\r\n this._effectWrapper.textureWidth = this.width;\r\n this._effectWrapper.textureHeight = this.height;\r\n });\r\n }\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/glowBlurPostProcess.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/glowBlurPostProcess.fragment\"));\r\n }\r\n\r\n super._gatherImports(useWebGPU, list);\r\n }\r\n}\r\n\r\n/**\r\n * Highlight layer options. This helps customizing the behaviour\r\n * of the highlight layer.\r\n */\r\nexport interface IHighlightLayerOptions extends IThinHighlightLayerOptions {}\r\n\r\n/**\r\n * The highlight layer Helps adding a glow effect around a mesh.\r\n *\r\n * Once instantiated in a scene, simply use the addMesh or removeMesh method to add or remove\r\n * glowy meshes to your scene.\r\n *\r\n * !!! THIS REQUIRES AN ACTIVE STENCIL BUFFER ON THE CANVAS !!!\r\n */\r\nexport class HighlightLayer extends EffectLayer {\r\n /**\r\n * Effect Name of the highlight layer.\r\n */\r\n public static readonly EffectName = \"HighlightLayer\";\r\n\r\n /**\r\n * The neutral color used during the preparation of the glow effect.\r\n * This is black by default as the blend operation is a blend operation.\r\n */\r\n public static get NeutralColor() {\r\n return ThinHighlightLayer.NeutralColor;\r\n }\r\n\r\n public static set NeutralColor(value: Color4) {\r\n ThinHighlightLayer.NeutralColor = value;\r\n }\r\n\r\n /**\r\n * Specifies whether or not the inner glow is ACTIVE in the layer.\r\n */\r\n @serialize()\r\n public get innerGlow() {\r\n return this._thinEffectLayer.innerGlow;\r\n }\r\n\r\n public set innerGlow(value: boolean) {\r\n this._thinEffectLayer.innerGlow = value;\r\n }\r\n\r\n /**\r\n * Specifies whether or not the outer glow is ACTIVE in the layer.\r\n */\r\n @serialize()\r\n public get outerGlow() {\r\n return this._thinEffectLayer.outerGlow;\r\n }\r\n\r\n public set outerGlow(value: boolean) {\r\n this._thinEffectLayer.outerGlow = value;\r\n }\r\n\r\n /**\r\n * Specifies the horizontal size of the blur.\r\n */\r\n public set blurHorizontalSize(value: number) {\r\n this._thinEffectLayer.blurHorizontalSize = value;\r\n }\r\n\r\n /**\r\n * Specifies the vertical size of the blur.\r\n */\r\n public set blurVerticalSize(value: number) {\r\n this._thinEffectLayer.blurVerticalSize = value;\r\n }\r\n\r\n /**\r\n * Gets the horizontal size of the blur.\r\n */\r\n @serialize()\r\n public get blurHorizontalSize(): number {\r\n return this._thinEffectLayer.blurHorizontalSize;\r\n }\r\n\r\n /**\r\n * Gets the vertical size of the blur.\r\n */\r\n @serialize()\r\n public get blurVerticalSize(): number {\r\n return this._thinEffectLayer.blurVerticalSize;\r\n }\r\n\r\n /**\r\n * An event triggered when the highlight layer is being blurred.\r\n */\r\n public onBeforeBlurObservable = new Observable<HighlightLayer>();\r\n\r\n /**\r\n * An event triggered when the highlight layer has been blurred.\r\n */\r\n public onAfterBlurObservable = new Observable<HighlightLayer>();\r\n\r\n @serialize(\"options\")\r\n private _options: Required<IHighlightLayerOptions>;\r\n\r\n protected override readonly _thinEffectLayer: ThinHighlightLayer;\r\n private _downSamplePostprocess: PassPostProcess;\r\n private _horizontalBlurPostprocess: IBlurPostProcess;\r\n private _verticalBlurPostprocess: IBlurPostProcess;\r\n private _blurTexture: RenderTargetTexture;\r\n\r\n /**\r\n * Instantiates a new highlight Layer and references it to 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 options Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information)\r\n */\r\n constructor(name: string, scene?: Scene, options?: Partial<IHighlightLayerOptions>) {\r\n super(name, scene, options !== undefined ? !!options.forceGLSL : false, new ThinHighlightLayer(name, scene, options));\r\n\r\n // Warn on stencil\r\n if (!this._engine.isStencilEnable) {\r\n Logger.Warn(\"Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }\");\r\n }\r\n\r\n // Adapt options\r\n this._options = {\r\n mainTextureRatio: 0.5,\r\n blurTextureSizeRatio: 0.5,\r\n mainTextureFixedSize: 0,\r\n blurHorizontalSize: 1.0,\r\n blurVerticalSize: 1.0,\r\n alphaBlendingMode: Constants.ALPHA_COMBINE,\r\n camera: null,\r\n renderingGroupId: -1,\r\n mainTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n forceGLSL: false,\r\n isStroke: false,\r\n ...options,\r\n };\r\n\r\n // Initialize the layer\r\n this._init(this._options);\r\n\r\n // Do not render as long as no meshes have been added\r\n this._shouldRender = false;\r\n }\r\n\r\n /**\r\n * Get the effect name of the layer.\r\n * @returns The effect name\r\n */\r\n public getEffectName(): string {\r\n return HighlightLayer.EffectName;\r\n }\r\n\r\n protected override _numInternalDraws(): number {\r\n return 2; // we need two rendering, one for the inner glow and the other for the outer glow\r\n }\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 created\r\n */\r\n protected _createMergeEffect(): Effect {\r\n return this._thinEffectLayer._createMergeEffect();\r\n }\r\n\r\n /**\r\n * Creates the render target textures and post processes used in the highlight layer.\r\n */\r\n protected _createTextureAndPostProcesses(): void {\r\n let blurTextureWidth = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio;\r\n let blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;\r\n blurTextureWidth = this._engine.needPOTTextures ? GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;\r\n blurTextureHeight = this._engine.needPOTTextures ? GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;\r\n\r\n let textureType = 0;\r\n if (this._engine.getCaps().textureHalfFloatRender) {\r\n textureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else {\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n }\r\n\r\n this._blurTexture = new RenderTargetTexture(\r\n \"HighlightLayerBlurRTT\",\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n this._scene,\r\n false,\r\n true,\r\n textureType\r\n );\r\n this._blurTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture.anisotropicFilteringLevel = 16;\r\n this._blurTexture.updateSamplingMode(Texture.TRILINEAR_SAMPLINGMODE);\r\n this._blurTexture.renderParticles = false;\r\n this._blurTexture.ignoreCameraViewport = true;\r\n\r\n this._textures = [this._blurTexture];\r\n\r\n this._thinEffectLayer.bindTexturesForCompose = (effect: Effect) => {\r\n effect.setTexture(\"textureSampler\", this._blurTexture);\r\n };\r\n\r\n this._thinEffectLayer._createTextureAndPostProcesses();\r\n\r\n if (this._options.alphaBlendingMode === Constants.ALPHA_COMBINE) {\r\n this._downSamplePostprocess = new PassPostProcess(\"HighlightLayerPPP\", {\r\n size: this._options.blurTextureSizeRatio,\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n effectWrapper: this._thinEffectLayer._postProcesses[0] as ThinPassPostProcess,\r\n });\r\n this._downSamplePostprocess.externalTextureSamplerBinding = true;\r\n this._downSamplePostprocess.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._mainTexture);\r\n });\r\n\r\n this._horizontalBlurPostprocess = new GlowBlurPostProcess(\"HighlightLayerHBP\", new Vector2(1.0, 0), this._options.blurHorizontalSize, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n effectWrapper: this._thinEffectLayer._postProcesses[1] as ThinGlowBlurPostProcess,\r\n });\r\n this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setFloat2(\"screenSize\", blurTextureWidth, blurTextureHeight);\r\n });\r\n\r\n this._verticalBlurPostprocess = new GlowBlurPostProcess(\"HighlightLayerVBP\", new Vector2(0, 1.0), this._options.blurVerticalSize, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n effectWrapper: this._thinEffectLayer._postProcesses[2] as ThinGlowBlurPostProcess,\r\n });\r\n this._verticalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setFloat2(\"screenSize\", blurTextureWidth, blurTextureHeight);\r\n });\r\n\r\n this._postProcesses = [this._downSamplePostprocess, this._horizontalBlurPostprocess, this._verticalBlurPostprocess];\r\n } else {\r\n this._horizontalBlurPostprocess = new BlurPostProcess(\"HighlightLayerHBP\", new Vector2(1.0, 0), this._options.blurHorizontalSize / 2, {\r\n size: {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n textureType,\r\n effectWrapper: this._thinEffectLayer._postProcesses[0] as ThinBlurPostProcess,\r\n });\r\n this._horizontalBlurPostprocess.width = blurTextureWidth;\r\n this._horizontalBlurPostprocess.height = blurTextureHeight;\r\n this._horizontalBlurPostprocess.externalTextureSamplerBinding = true;\r\n this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._mainTexture);\r\n });\r\n\r\n this._verticalBlurPostprocess = new BlurPostProcess(\"HighlightLayerVBP\", new Vector2(0, 1.0), this._options.blurVerticalSize / 2, {\r\n size: {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n textureType,\r\n });\r\n\r\n this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess];\r\n }\r\n\r\n this._mainTexture.onAfterUnbindObservable.add(() => {\r\n this.onBeforeBlurObservable.notifyObservers(this);\r\n\r\n const internalTexture = this._blurTexture.renderTarget;\r\n if (internalTexture) {\r\n this._scene.postProcessManager.directRender(this._postProcesses, internalTexture, true);\r\n this._engine.unBindFramebuffer(internalTexture, true);\r\n }\r\n\r\n this.onAfterBlurObservable.notifyObservers(this);\r\n });\r\n\r\n // Prevent autoClear.\r\n this._postProcesses.map((pp) => {\r\n pp.autoClear = false;\r\n });\r\n\r\n this._mainTextureCreatedSize.width = this._mainTextureDesiredSize.width;\r\n this._mainTextureCreatedSize.height = this._mainTextureDesiredSize.height;\r\n }\r\n\r\n /**\r\n * @returns whether or not the layer needs stencil enabled during the mesh rendering.\r\n */\r\n public needStencil(): boolean {\r\n return this._thinEffectLayer.needStencil();\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 * @returns true if ready otherwise, false\r\n */\r\n public isReady(subMesh: SubMesh, useInstances: boolean): boolean {\r\n return this._thinEffectLayer.isReady(subMesh, useInstances);\r\n }\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 renderIndex\r\n */\r\n protected _internalRender(effect: Effect, renderIndex: number): void {\r\n this._thinEffectLayer._internalCompose(effect, renderIndex);\r\n }\r\n\r\n /**\r\n * @returns true if the layer contains information to display, otherwise false.\r\n */\r\n public override shouldRender(): boolean {\r\n return this._thinEffectLayer.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 protected override _shouldRenderMesh(mesh: Mesh): boolean {\r\n return this._thinEffectLayer._shouldRenderMesh(mesh);\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 override _canRenderMesh(mesh: AbstractMesh, material: Material): boolean {\r\n return this._thinEffectLayer._canRenderMesh(mesh, material);\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 protected override _addCustomEffectDefines(defines: string[]): void {\r\n this._thinEffectLayer._addCustomEffectDefines(defines);\r\n }\r\n\r\n /**\r\n * Sets the required values for both the emissive texture and and the main color.\r\n * @param mesh\r\n * @param subMesh\r\n * @param material\r\n */\r\n protected _setEmissiveTextureAndColor(mesh: Mesh, subMesh: SubMesh, material: Material): void {\r\n this._thinEffectLayer._setEmissiveTextureAndColor(mesh, subMesh, material);\r\n }\r\n\r\n /**\r\n * Add a mesh in the exclusion list to prevent it to impact or being impacted by the highlight layer.\r\n * @param mesh The mesh to exclude from the highlight layer\r\n */\r\n public addExcludedMesh(mesh: Mesh) {\r\n this._thinEffectLayer.addExcludedMesh(mesh);\r\n }\r\n\r\n /**\r\n * Remove a mesh from the exclusion list to let it impact or being impacted by the highlight layer.\r\n * @param mesh The mesh to highlight\r\n */\r\n public removeExcludedMesh(mesh: Mesh) {\r\n this._thinEffectLayer.removeExcludedMesh(mesh);\r\n }\r\n\r\n /**\r\n * Determine if a given mesh will be highlighted by the current HighlightLayer\r\n * @param mesh mesh to test\r\n * @returns true if the mesh will be highlighted by the current HighlightLayer\r\n */\r\n public override hasMesh(mesh: AbstractMesh): boolean {\r\n return this._thinEffectLayer.hasMesh(mesh);\r\n }\r\n\r\n /**\r\n * Add a mesh in the highlight layer in order to make it glow with the chosen color.\r\n * @param mesh The mesh to highlight\r\n * @param color The color of the highlight\r\n * @param glowEmissiveOnly Extract the glow from the emissive texture\r\n */\r\n public addMesh(mesh: Mesh, color: Color3, glowEmissiveOnly = false) {\r\n this._thinEffectLayer.addMesh(mesh, color, glowEmissiveOnly);\r\n }\r\n\r\n /**\r\n * Get all meshes from the highlight layer\r\n * @returns Mesh[]\r\n */\r\n public getAllMeshes(): Mesh[] {\r\n return this._thinEffectLayer._meshes\r\n ? Object.values(this._thinEffectLayer._meshes)\r\n .map((mesh) => {\r\n return mesh?.mesh!;\r\n })\r\n .filter(Boolean)\r\n : [];\r\n }\r\n\r\n /**\r\n * Remove a mesh from the highlight layer in order to make it stop glowing.\r\n * @param mesh The mesh to highlight\r\n */\r\n public removeMesh(mesh: Mesh) {\r\n this._thinEffectLayer.removeMesh(mesh);\r\n }\r\n\r\n /**\r\n * Remove all the meshes currently referenced in the highlight layer\r\n */\r\n public removeAllMeshes(): void {\r\n this._thinEffectLayer.removeAllMeshes();\r\n }\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 * @internal\r\n */\r\n public _disposeMesh(mesh: Mesh): void {\r\n this._thinEffectLayer._disposeMesh(mesh);\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 override getClassName(): string {\r\n return \"HighlightLayer\";\r\n }\r\n\r\n /**\r\n * Serializes this Highlight layer\r\n * @returns a serialized Highlight layer object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.HighlightLayer\";\r\n\r\n // Highlighted meshes\r\n serializationObject.meshes = [];\r\n\r\n const meshes = this._thinEffectLayer._meshes;\r\n if (meshes) {\r\n for (const m in meshes) {\r\n const mesh = meshes[m];\r\n\r\n if (mesh) {\r\n serializationObject.meshes.push({\r\n glowEmissiveOnly: mesh.glowEmissiveOnly,\r\n color: mesh.color.asArray(),\r\n meshId: mesh.mesh.id,\r\n });\r\n }\r\n }\r\n }\r\n\r\n // Excluded meshes\r\n serializationObject.excludedMeshes = [];\r\n\r\n const excludedMeshes = this._thinEffectLayer._excludedMeshes;\r\n if (excludedMeshes) {\r\n for (const e in excludedMeshes) {\r\n const excludedMesh = excludedMeshes[e];\r\n\r\n if (excludedMesh) {\r\n serializationObject.excludedMeshes.push(excludedMesh.mesh.id);\r\n }\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Highlight layer from parsed Highlight layer data\r\n * @param parsedHightlightLayer defines the Highlight layer data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing the Highlight layer information\r\n * @returns a parsed Highlight layer\r\n */\r\n public static override Parse(parsedHightlightLayer: any, scene: Scene, rootUrl: string): HighlightLayer {\r\n const hl = SerializationHelper.Parse(() => new HighlightLayer(parsedHightlightLayer.name, scene, parsedHightlightLayer.options), parsedHightlightLayer, scene, rootUrl);\r\n let index;\r\n\r\n // Excluded meshes\r\n for (index = 0; index < parsedHightlightLayer.excludedMeshes.length; index++) {\r\n const mesh = scene.getMeshById(parsedHightlightLayer.excludedMeshes[index]);\r\n if (mesh) {\r\n hl.addExcludedMesh(<Mesh>mesh);\r\n }\r\n }\r\n\r\n // Included meshes\r\n for (index = 0; index < parsedHightlightLayer.meshes.length; index++) {\r\n const highlightedMesh = parsedHightlightLayer.meshes[index];\r\n const mesh = scene.getMeshById(highlightedMesh.meshId);\r\n\r\n if (mesh) {\r\n hl.addMesh(<Mesh>mesh, Color3.FromArray(highlightedMesh.color), highlightedMesh.glowEmissiveOnly);\r\n }\r\n }\r\n\r\n return hl;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.HighlightLayer\", HighlightLayer);\r\n"]}
|
|
@@ -199,7 +199,7 @@ export class ClusteredLightContainer extends Light {
|
|
|
199
199
|
this._proxyMaterial.transparencyMode = ShaderMaterial.MATERIAL_ALPHABLEND;
|
|
200
200
|
this._proxyMaterial.alphaMode = 1;
|
|
201
201
|
this._proxyMaterial.sideOrientation = 1;
|
|
202
|
-
this._proxyMesh = CreatePlane("ProxyMesh", { size: 2 });
|
|
202
|
+
this._proxyMesh = CreatePlane("ProxyMesh", { size: 2 }, this._scene);
|
|
203
203
|
// Make sure it doesn't render for the default scene
|
|
204
204
|
this._scene.removeMesh(this._proxyMesh);
|
|
205
205
|
this._proxyMesh.material = this._proxyMaterial;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clusteredLightContainer.js","sourceRoot":"","sources":["../../../../../dev/core/src/Lights/Clustered/clusteredLightContainer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,uCAAmC;AAG3D,OAAO,EAAE,SAAS,EAAE,mCAA+B;AAInD,OAAO,EAAE,cAAc,EAAE,0CAAsC;AAC/D,OAAO,EAAE,UAAU,EAAE,+CAA2C;AAChE,OAAO,EAAE,mBAAmB,EAAE,wDAAoD;AAClF,OAAO,EAAE,aAAa,EAAE,yCAAqC;AAC7D,OAAO,EAAE,SAAS,EAAE,kCAA8B;AAClD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,mCAA+B;AAC7D,OAAO,EAAE,WAAW,EAAE,8CAA0C;AAEhE,OAAO,EAAE,SAAS,EAAE,iCAA6B;AACjD,OAAO,EAAE,WAAW,EAAE,+BAA2B;AACjD,OAAO,EAAE,MAAM,EAAE,6BAAyB;AAC1C,OAAO,EAAE,aAAa,EAAE,gCAA4B;AACpD,OAAO,EAAE,IAAI,EAAE,sBAAkB;AAIjC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKnD,0CAAsC;AAEtC,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IACpD,OAAO,GAAG,EAAE,CAAC,IAAI,uBAAuB,CAAC,I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AC,YAAY,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC;QAC1C,OAAO,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QAC9C,OAAO,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC;IACrD,CAAC;IAEe,QAAQ;QACpB,IAAI,CAAC,cAAc,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;;AA/eD,gBAAgB;AACF,qDAA6B,GAA2B,GAAG,EAAE;IACvE,MAAM,WAAW,CAAC,iCAAiC,CAAC,CAAC;AACzD,CAAC,AAF0C,CAEzC;AAsCF;IADC,SAAS,EAAE;8DAGX;AAiBD;IADC,SAAS,EAAE;4DAGX;AA8CD;IADC,SAAS,EAAE;uDAGX;AAoYL,sBAAsB;AACtB,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { StorageBuffer } from \"core/Buffers/storageBuffer\";\nimport type { Camera } from \"core/Cameras/camera\";\nimport type { AbstractEngine } from \"core/Engines/abstractEngine\";\nimport { Constants } from \"core/Engines/constants\";\nimport type { WebGPUEngine } from \"core/Engines/webgpuEngine\";\nimport type { Effect } from \"core/Materials/effect\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { ShaderMaterial } from \"core/Materials/shaderMaterial\";\nimport { RawTexture } from \"core/Materials/Textures/rawTexture\";\nimport { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\nimport { UniformBuffer } from \"core/Materials/uniformBuffer\";\nimport { TmpColors } from \"core/Maths/math.color\";\nimport { TmpVectors, Vector3 } from \"core/Maths/math.vector\";\nimport { CreatePlane } from \"core/Meshes/Builders/planeBuilder\";\nimport type { Mesh } from \"core/Meshes/mesh\";\nimport { serialize } from \"core/Misc/decorators\";\nimport { _WarnImport } from \"core/Misc/devTools\";\nimport { Logger } from \"core/Misc/logger\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { Node } from \"core/node\";\nimport type { Scene } from \"core/scene\";\nimport type { Nullable } from \"core/types\";\n\nimport { Light } from \"../light\";\nimport { LightConstants } from \"../lightConstants\";\nimport type { PointLight } from \"../pointLight\";\nimport type { SpotLight } from \"../spotLight\";\nimport type { RenderTargetWrapper } from \"../../Engines/renderTargetWrapper\";\n\nimport \"core/Meshes/thinInstanceMesh\";\n\nNode.AddNodeConstructor(\"Light_Type_5\", (name, scene) => {\n return () => new ClusteredLightContainer(name, [], scene);\n});\n\nconst DefaultDepthSlices = 16;\n\n/**\n * A special light that renders all its associated spot or point lights using a clustered or forward+ system.\n */\nexport class ClusteredLightContainer extends Light {\n private static _GetEngineBatchSize(engine: AbstractEngine): number {\n const caps = engine._caps;\n if (!caps.texelFetch) {\n return 0;\n } else if (engine.isWebGPU) {\n // On WebGPU we use atomic writes to storage textures\n return 32;\n } else if (engine.version > 1) {\n // On WebGL 2 we use additive float blending as the light mask\n if (!caps.colorBufferFloat || !caps.blendFloat) {\n return 0;\n }\n // Due to the use of floats we want to limit lights to the precision of floats\n return caps.shaderFloatPrecision;\n } else {\n // WebGL 1 is not supported due to lack of dynamic for loops\n return 0;\n }\n }\n\n /**\n * Checks if the clustered lighting system supports the given light with its current parameters.\n * This will also check if the light's associated engine supports clustered lighting.\n *\n * @param light The light to test\n * @returns true if the light and its engine is supported\n */\n public static IsLightSupported(light: Light): boolean {\n if (ClusteredLightContainer._GetEngineBatchSize(light.getEngine()) === 0) {\n return false;\n } else if (light.shadowEnabled && light._scene.shadowsEnabled && light.getShadowGenerators()) {\n // Shadows are not supported\n return false;\n } else if (light.falloffType !== Light.FALLOFF_DEFAULT) {\n // Only the default falloff is supported\n return false;\n } else if (light.getTypeID() === LightConstants.LIGHTTYPEID_POINTLIGHT) {\n return true;\n } else if (light.getTypeID() === LightConstants.LIGHTTYPEID_SPOTLIGHT) {\n // Extra texture bindings per light are not supported\n return !(<SpotLight>light).projectionTexture && !(<SpotLight>light).iesProfileTexture;\n } else {\n // Currently only point and spot lights are supported\n return false;\n }\n }\n\n /** @internal */\n public static _SceneComponentInitialization: (scene: Scene) => void = () => {\n throw _WarnImport(\"ClusteredLightingSceneComponent\");\n };\n\n private readonly _batchSize: number;\n\n /**\n * True if clustered lighting is supported.\n */\n public get isSupported(): boolean {\n return this._batchSize > 0;\n }\n\n private readonly _lights: Light[] = [];\n /**\n * Gets the current list of lights added to this clustering system.\n */\n public get lights(): readonly Light[] {\n return this._lights;\n }\n\n private _camera: Nullable<Camera> = null;\n\n // The lights sorted by depth\n private readonly _sortedLights: (PointLight | SpotLight)[] = [];\n\n private _lightDataBuffer: Float32Array;\n private _lightDataTexture: RawTexture;\n private _lightDataRenderId = -1;\n\n private _tileMaskBatches = -1;\n private _tileMaskTexture: RenderTargetTexture;\n private _tileMaskBuffer: Nullable<StorageBuffer>;\n\n private _horizontalTiles = 64;\n /**\n * The number of tiles in the horizontal direction to cluster lights into.\n * A lower value will reduce memory and make the clustering step faster, while a higher value increases memory and makes the rendering step faster.\n */\n @serialize()\n public get horizontalTiles(): number {\n return this._horizontalTiles;\n }\n\n public set horizontalTiles(horizontal: number) {\n if (this._horizontalTiles === horizontal) {\n return;\n }\n this._horizontalTiles = horizontal;\n // Force the batch data to be recreated\n this._tileMaskBatches = -1;\n }\n\n private _verticalTiles = 64;\n /**\n * The number of tiles in the vertical direction to cluster lights into.\n * A lower value will reduce memory and make the clustering step faster, while a higher value increases memory and makes the rendering step faster.\n */\n @serialize()\n public get verticalTiles(): number {\n return this._verticalTiles;\n }\n\n public set verticalTiles(vertical: number) {\n if (this._verticalTiles === vertical) {\n return;\n }\n this._verticalTiles = vertical;\n // Force the batch data to be recreated\n this._tileMaskBatches = -1;\n }\n\n private _sliceScale = 0;\n private _sliceBias = 0;\n // List of vec2's that keep track of the min and max index per slice\n private _sliceRanges: Float32Array;\n\n private _depthSlices = DefaultDepthSlices;\n /**\n * The number of slices to split the depth range by and cluster lights into.\n */\n public get depthSlices(): number {\n return this._depthSlices;\n }\n\n public set depthSlices(slices: number) {\n if (this._depthSlices === slices) {\n return;\n }\n this._depthSlices = slices;\n this._sliceRanges = new Float32Array(slices * 2);\n\n // UBO size depends on the number of depth slices\n this._uniformBuffer.dispose();\n this._uniformBuffer = new UniformBuffer(this.getEngine(), undefined, undefined, this.name);\n this._buildUniformLayout();\n }\n\n private readonly _proxyMaterial: ShaderMaterial;\n private readonly _proxyMesh: Mesh;\n\n private _maxRange = 16383;\n private _minInverseSquaredRange = 1 / (this._maxRange * this._maxRange);\n /**\n * This limits the range of all the added lights, so even lights with extreme ranges will still have bounds for clustering.\n */\n @serialize()\n public get maxRange(): number {\n return this._maxRange;\n }\n\n public set maxRange(range: number) {\n if (this._maxRange === range) {\n return;\n }\n this._maxRange = range;\n this._minInverseSquaredRange = 1 / (range * range);\n }\n\n /**\n * Creates a new clustered light system with an initial set of lights.\n *\n * @param name The name of the clustered light container\n * @param lights The initial set of lights to add\n * @param scene The scene the clustered light container belongs to\n */\n constructor(name: string, lights: Light[] = [], scene?: Scene) {\n super(name, scene);\n const engine = this.getEngine();\n this._batchSize = ClusteredLightContainer._GetEngineBatchSize(engine);\n\n const proxyShader = { vertex: \"lightProxy\", fragment: \"lightProxy\" };\n const defines = [`CLUSTLIGHT_BATCH ${this._batchSize}`];\n if (this._scene.useRightHandedSystem) {\n defines.push(\"#define RIGHT_HANDED\");\n }\n this._proxyMaterial = new ShaderMaterial(\"ProxyMaterial\", this._scene, proxyShader, {\n attributes: [\"position\"],\n uniforms: [\"view\", \"projection\", \"tileMaskResolution\"],\n samplers: [\"lightDataTexture\"],\n uniformBuffers: [\"Scene\"],\n storageBuffers: [\"tileMaskBuffer\"],\n defines,\n shaderLanguage: engine.isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\n extraInitializationsAsync: async () => {\n if (engine.isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/lightProxy.vertex\"), import(\"../../ShadersWGSL/lightProxy.fragment\")]);\n } else {\n await Promise.all([import(\"../../Shaders/lightProxy.vertex\"), import(\"../../Shaders/lightProxy.fragment\")]);\n }\n },\n });\n\n // Additive blending is for merging masks on WebGL\n this._proxyMaterial.transparencyMode = ShaderMaterial.MATERIAL_ALPHABLEND;\n this._proxyMaterial.alphaMode = Constants.ALPHA_ADD;\n this._proxyMaterial.sideOrientation = Constants.MATERIAL_CounterClockWiseSideOrientation;\n\n this._proxyMesh = CreatePlane(\"ProxyMesh\", { size: 2 });\n // Make sure it doesn't render for the default scene\n this._scene.removeMesh(this._proxyMesh);\n this._proxyMesh.material = this._proxyMaterial;\n\n this._updateBatches();\n\n this._sliceRanges = new Float32Array(this._depthSlices * 2);\n\n if (this._batchSize > 0) {\n ClusteredLightContainer._SceneComponentInitialization(this._scene);\n for (const light of lights) {\n this.addLight(light);\n }\n }\n }\n\n public override getClassName(): string {\n return \"ClusteredLightContainer\";\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public override getTypeID(): number {\n return LightConstants.LIGHTTYPEID_CLUSTERED_CONTAINER;\n }\n\n /** @internal */\n public _updateBatches(camera: Nullable<Camera> = null): RenderTargetTexture {\n this._camera = camera;\n this._proxyMesh.isVisible = this._sortedLights.length > 0;\n\n // Ensure space for atleast 1 batch\n const batches = Math.max(Math.ceil(this._sortedLights.length / this._batchSize), 1);\n if (this._tileMaskBatches >= batches) {\n this._proxyMesh.thinInstanceCount = this._sortedLights.length;\n return this._tileMaskTexture;\n }\n const engine = this.getEngine();\n // Round up to a batch size so we don't have to reallocate as often\n const maxLights = batches * this._batchSize;\n\n this._lightDataBuffer = new Float32Array(20 * maxLights);\n this._lightDataTexture?.dispose();\n this._lightDataTexture = new RawTexture(\n this._lightDataBuffer,\n 5,\n maxLights,\n Constants.TEXTUREFORMAT_RGBA,\n this._scene,\n false,\n false,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURETYPE_FLOAT\n );\n this._lightDataTexture.name = \"LightDataTexture_clustered_\" + this.name;\n this._proxyMaterial.setTexture(\"lightDataTexture\", this._lightDataTexture);\n\n this._tileMaskTexture?.dispose();\n const textureSize = { width: this._horizontalTiles, height: this._verticalTiles };\n if (!engine.isWebGPU) {\n // In WebGL we shift the light proxy by the batch number\n textureSize.height *= batches;\n }\n this._tileMaskTexture = new RenderTargetTexture(\"TileMaskTexture\", textureSize, this._scene, {\n // We don't write anything on WebGPU so make it as small as possible\n type: engine.isWebGPU ? Constants.TEXTURETYPE_UNSIGNED_BYTE : Constants.TEXTURETYPE_FLOAT,\n format: Constants.TEXTUREFORMAT_RED,\n generateDepthBuffer: false,\n });\n\n this._tileMaskTexture.renderParticles = false;\n this._tileMaskTexture.renderSprites = false;\n this._tileMaskTexture.noPrePassRenderer = true;\n this._tileMaskTexture.renderList = [this._proxyMesh];\n\n let currentRenderTarget: Nullable<RenderTargetWrapper> = null;\n\n this._tileMaskTexture.onBeforeBindObservable.add(() => {\n currentRenderTarget = engine._currentRenderTarget;\n this._updateLightData();\n });\n\n this._tileMaskTexture.onAfterUnbindObservable.add(() => {\n if (engine._currentRenderTarget !== currentRenderTarget) {\n if (!currentRenderTarget) {\n engine.restoreDefaultFramebuffer();\n } else {\n engine.bindFramebuffer(currentRenderTarget);\n }\n }\n });\n\n this._tileMaskTexture.onClearObservable.add(() => {\n if (engine.isWebGPU) {\n // Clear the storage buffer for WebGPU\n this._tileMaskBuffer?.clear();\n } else {\n // Only clear the texture on WebGL\n engine.clear({ r: 0, g: 0, b: 0, a: 1 }, true, false);\n }\n });\n\n if (engine.isWebGPU) {\n // WebGPU also needs a storage buffer to write to\n this._tileMaskBuffer?.dispose();\n const bufferSize = this._horizontalTiles * this._verticalTiles * batches * 4;\n this._tileMaskBuffer = new StorageBuffer(<WebGPUEngine>engine, bufferSize);\n this._proxyMaterial.setStorageBuffer(\"tileMaskBuffer\", this._tileMaskBuffer);\n }\n\n this._proxyMaterial.setVector3(\"tileMaskResolution\", new Vector3(this._horizontalTiles, this.verticalTiles, batches));\n\n // We don't actually use the matrix data but we need enough capacity for the lights\n this._proxyMesh.thinInstanceSetBuffer(\"matrix\", new Float32Array(maxLights * 16));\n this._proxyMesh.thinInstanceCount = this._sortedLights.length;\n this._tileMaskBatches = batches;\n return this._tileMaskTexture;\n }\n\n private _getSliceIndex(camera: Camera, depth: number): number {\n if (depth < camera.minZ) {\n // Prevent calling log on small or negative values\n return -1;\n }\n return Math.floor(Math.log(depth) * this._sliceScale + this._sliceBias);\n }\n\n private _updateLightData(): void {\n const camera = this._camera || this._scene.activeCamera;\n const renderId = this._scene.getRenderId();\n if (!camera || this._lightDataRenderId === renderId) {\n return;\n }\n this._lightDataRenderId = renderId;\n\n // Resort lights based on distance from camera\n const view = camera.getViewMatrix();\n for (const light of this._sortedLights) {\n const position = light.computeTransformedInformation() ? light.transformedPosition : light.position;\n const viewPosition = Vector3.TransformCoordinatesToRef(position, view, TmpVectors.Vector3[0]);\n light._currentViewDepth = this._scene.useRightHandedSystem ? -viewPosition.z : viewPosition.z;\n }\n this._sortedLights.sort((a, b) => a._currentViewDepth - b._currentViewDepth);\n\n // DOOM 2016 subdivision scheme, copied from: https://www.aortiz.me/2018/12/21/CG.html\n const logFarNear = Math.log(camera.maxZ / camera.minZ);\n this._sliceScale = this._depthSlices / logFarNear;\n this._sliceBias = -(this._depthSlices * Math.log(camera.minZ)) / logFarNear;\n\n this._sliceRanges.fill(0);\n // Last slice which had had its min index updated\n let minSlice = -1;\n\n const buf = this._lightDataBuffer;\n const offset = this._scene.floatingOriginOffset;\n\n for (let i = 0; i < this._sortedLights.length; i += 1) {\n const light = this._sortedLights[i];\n const off = i * 20;\n const computed = light.computeTransformedInformation();\n const scaledIntensity = light.getScaledIntensity();\n\n const position = computed ? light.transformedPosition : light.position;\n const diffuse = light.diffuse.scaleToRef(scaledIntensity, TmpColors.Color3[0]);\n const specular = light.specular.scaleToRef(scaledIntensity, TmpColors.Color3[1]);\n const range = Math.min(light.range, this.maxRange);\n const inverseSquaredRange = Math.max(light._inverseSquaredRange, this._minInverseSquaredRange);\n\n // vLightData\n buf[off + 0] = position.x - offset.x;\n buf[off + 1] = position.y - offset.y;\n buf[off + 2] = position.z - offset.z;\n buf[off + 3] = 0;\n // vLightDiffuse\n buf[off + 4] = diffuse.r;\n buf[off + 5] = diffuse.g;\n buf[off + 6] = diffuse.b;\n buf[off + 7] = range;\n // vLightSpecular\n buf[off + 8] = specular.r;\n buf[off + 9] = specular.g;\n buf[off + 10] = specular.b;\n buf[off + 11] = light.radius;\n // vLightDirection\n buf[off + 12] = 0;\n buf[off + 13] = 0;\n buf[off + 14] = 0;\n buf[off + 15] = -1;\n // vLightFalloff\n buf[off + 16] = range;\n buf[off + 17] = inverseSquaredRange;\n buf[off + 18] = 0;\n buf[off + 19] = 0;\n\n if (light.getTypeID() === LightConstants.LIGHTTYPEID_SPOTLIGHT) {\n const spotLight = <SpotLight>light;\n const direction = Vector3.NormalizeToRef(computed ? spotLight.transformedDirection : spotLight.direction, TmpVectors.Vector3[0]);\n\n // vLightData.a\n buf[off + 3] = spotLight.exponent;\n // vLightDirection\n buf[off + 12] = direction.x;\n buf[off + 13] = direction.y;\n buf[off + 14] = direction.z;\n buf[off + 15] = spotLight._cosHalfAngle;\n // vLightFalloff.zw\n buf[off + 18] = spotLight._lightAngleScale;\n buf[off + 19] = spotLight._lightAngleOffset;\n }\n\n // Update the depth slices that include this light\n const firstSlice = this._getSliceIndex(camera, light._currentViewDepth - range);\n const lastSlice = this._getSliceIndex(camera, light._currentViewDepth + range);\n for (let j = firstSlice; j <= lastSlice; j += 1) {\n if (j < 0 || j >= this._depthSlices) {\n continue;\n } else if (j > minSlice) {\n // Update min index\n this._sliceRanges[j * 2] = i;\n minSlice = j;\n }\n // Update max index\n this._sliceRanges[j * 2 + 1] = i;\n }\n }\n\n const engine = this.getEngine();\n if (engine.isWebGPU) {\n // Whenever the light data changes we have to flush pending WebGPU command buffers so that\n // previous render passes use the old data and later render passes use the new data.\n engine.flushFramebuffer();\n }\n this._lightDataTexture.update(this._lightDataBuffer);\n }\n\n public override dispose(doNotRecurse?: boolean, disposeMaterialAndTextures?: boolean): void {\n for (const light of this._lights) {\n light.dispose(doNotRecurse, disposeMaterialAndTextures);\n }\n this._lightDataTexture.dispose();\n this._tileMaskTexture.dispose();\n this._tileMaskBuffer?.dispose();\n this._proxyMesh.dispose(doNotRecurse, disposeMaterialAndTextures);\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\n }\n\n /**\n * Adds a light to the clustering system.\n * @param light The light to add\n */\n public addLight(light: Light): void {\n if (!ClusteredLightContainer.IsLightSupported(light)) {\n Logger.Warn(\"Attempting to add a light to cluster that does not support clustering\");\n return;\n }\n this._scene.removeLight(light);\n this._lights.push(light);\n this._sortedLights.push(<PointLight | SpotLight>light);\n\n this._proxyMesh.isVisible = true;\n this._proxyMesh.thinInstanceCount = this._sortedLights.length;\n }\n\n /**\n * Removes a light from the clustering system.\n * @param light The light to remove\n * @returns the index where the light was in the light list\n */\n public removeLight(light: Light): number {\n // Convert to `Light` array without cast so `indexOf` has correct typing\n const sortedLights: Light[] = this._sortedLights;\n const sortedIndex = sortedLights.indexOf(light);\n if (sortedIndex !== -1) {\n sortedLights.splice(sortedIndex, 1);\n\n this._proxyMesh.thinInstanceCount = sortedLights.length;\n if (sortedLights.length === 0) {\n this._proxyMesh.isVisible = false;\n }\n }\n\n const index = this._lights.indexOf(light);\n if (index !== -1) {\n this._lights.splice(index, 1);\n // We treat the unsorted array as the \"real\" one so only add back to the scene if it was found in that\n this._scene.addLight(light);\n }\n return index;\n }\n\n protected override _buildUniformLayout(): void {\n this._uniformBuffer.addUniform(\"vLightData\", 4);\n this._uniformBuffer.addUniform(\"vLightDiffuse\", 4);\n this._uniformBuffer.addUniform(\"vLightSpecular\", 4);\n this._uniformBuffer.addUniform(\"vSliceData\", 2);\n // _depthSlices might not be initialized yet\n this._uniformBuffer.addUniform(\"vSliceRanges\", 2, this._depthSlices ?? DefaultDepthSlices);\n this._uniformBuffer.addUniform(\"shadowsInfo\", 3);\n this._uniformBuffer.addUniform(\"depthValues\", 2);\n this._uniformBuffer.create();\n }\n\n public override transferToEffect(effect: Effect, lightIndex: string): Light {\n const engine = this.getEngine();\n const hscale = this._horizontalTiles / engine.getRenderWidth();\n const vscale = this._verticalTiles / engine.getRenderHeight();\n this._uniformBuffer.updateFloat4(\"vLightData\", hscale, vscale, this._verticalTiles, this._tileMaskBatches, lightIndex);\n this._uniformBuffer.updateFloat2(\"vSliceData\", this._sliceScale, this._sliceBias, lightIndex);\n this._uniformBuffer.updateFloatArray(\"vSliceRanges\", this._sliceRanges, lightIndex);\n return this;\n }\n\n public override transferTexturesToEffect(effect: Effect, lightIndex: string): Light {\n const engine = this.getEngine();\n effect.setTexture(\"lightDataTexture\" + lightIndex, this._lightDataTexture);\n if (engine.isWebGPU) {\n (<WebGPUEngine>engine).setStorageBuffer(\"tileMaskBuffer\" + lightIndex, this._tileMaskBuffer);\n } else {\n effect.setTexture(\"tileMaskTexture\" + lightIndex, this._tileMaskTexture);\n }\n return this;\n }\n\n public override transferToNodeMaterialEffect(_effect: Effect): Light {\n return this;\n }\n\n public override prepareLightSpecificDefines(defines: any, lightIndex: number): void {\n defines[\"CLUSTLIGHT\" + lightIndex] = true;\n defines[\"CLUSTLIGHT_BATCH\"] = this._batchSize;\n defines[\"CLUSTLIGHT_SLICES\"] = this._depthSlices;\n }\n\n public override _isReady(): boolean {\n this._updateBatches();\n return this._proxyMesh.isReady(true, true);\n }\n}\n\n// Register Class Name\nRegisterClass(\"BABYLON.ClusteredLightContainer\", ClusteredLightContainer);\n"]}
|
|
1
|
+
{"version":3,"file":"clusteredLightContainer.js","sourceRoot":"","sources":["../../../../../dev/core/src/Lights/Clustered/clusteredLightContainer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,uCAAmC;AAG3D,OAAO,EAAE,SAAS,EAAE,mCAA+B;AAInD,OAAO,EAAE,cAAc,EAAE,0CAAsC;AAC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C,SAAS,EAAE;uDAGX;AAoYL,sBAAsB;AACtB,aAAa,CAAC,iCAAiC,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { StorageBuffer } from \"core/Buffers/storageBuffer\";\nimport type { Camera } from \"core/Cameras/camera\";\nimport type { AbstractEngine } from \"core/Engines/abstractEngine\";\nimport { Constants } from \"core/Engines/constants\";\nimport type { WebGPUEngine } from \"core/Engines/webgpuEngine\";\nimport type { Effect } from \"core/Materials/effect\";\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\nimport { ShaderMaterial } from \"core/Materials/shaderMaterial\";\nimport { RawTexture } from \"core/Materials/Textures/rawTexture\";\nimport { RenderTargetTexture } from \"core/Materials/Textures/renderTargetTexture\";\nimport { UniformBuffer } from \"core/Materials/uniformBuffer\";\nimport { TmpColors } from \"core/Maths/math.color\";\nimport { TmpVectors, Vector3 } from \"core/Maths/math.vector\";\nimport { CreatePlane } from \"core/Meshes/Builders/planeBuilder\";\nimport type { Mesh } from \"core/Meshes/mesh\";\nimport { serialize } from \"core/Misc/decorators\";\nimport { _WarnImport } from \"core/Misc/devTools\";\nimport { Logger } from \"core/Misc/logger\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { Node } from \"core/node\";\nimport type { Scene } from \"core/scene\";\nimport type { Nullable } from \"core/types\";\n\nimport { Light } from \"../light\";\nimport { LightConstants } from \"../lightConstants\";\nimport type { PointLight } from \"../pointLight\";\nimport type { SpotLight } from \"../spotLight\";\nimport type { RenderTargetWrapper } from \"../../Engines/renderTargetWrapper\";\n\nimport \"core/Meshes/thinInstanceMesh\";\n\nNode.AddNodeConstructor(\"Light_Type_5\", (name, scene) => {\n return () => new ClusteredLightContainer(name, [], scene);\n});\n\nconst DefaultDepthSlices = 16;\n\n/**\n * A special light that renders all its associated spot or point lights using a clustered or forward+ system.\n */\nexport class ClusteredLightContainer extends Light {\n private static _GetEngineBatchSize(engine: AbstractEngine): number {\n const caps = engine._caps;\n if (!caps.texelFetch) {\n return 0;\n } else if (engine.isWebGPU) {\n // On WebGPU we use atomic writes to storage textures\n return 32;\n } else if (engine.version > 1) {\n // On WebGL 2 we use additive float blending as the light mask\n if (!caps.colorBufferFloat || !caps.blendFloat) {\n return 0;\n }\n // Due to the use of floats we want to limit lights to the precision of floats\n return caps.shaderFloatPrecision;\n } else {\n // WebGL 1 is not supported due to lack of dynamic for loops\n return 0;\n }\n }\n\n /**\n * Checks if the clustered lighting system supports the given light with its current parameters.\n * This will also check if the light's associated engine supports clustered lighting.\n *\n * @param light The light to test\n * @returns true if the light and its engine is supported\n */\n public static IsLightSupported(light: Light): boolean {\n if (ClusteredLightContainer._GetEngineBatchSize(light.getEngine()) === 0) {\n return false;\n } else if (light.shadowEnabled && light._scene.shadowsEnabled && light.getShadowGenerators()) {\n // Shadows are not supported\n return false;\n } else if (light.falloffType !== Light.FALLOFF_DEFAULT) {\n // Only the default falloff is supported\n return false;\n } else if (light.getTypeID() === LightConstants.LIGHTTYPEID_POINTLIGHT) {\n return true;\n } else if (light.getTypeID() === LightConstants.LIGHTTYPEID_SPOTLIGHT) {\n // Extra texture bindings per light are not supported\n return !(<SpotLight>light).projectionTexture && !(<SpotLight>light).iesProfileTexture;\n } else {\n // Currently only point and spot lights are supported\n return false;\n }\n }\n\n /** @internal */\n public static _SceneComponentInitialization: (scene: Scene) => void = () => {\n throw _WarnImport(\"ClusteredLightingSceneComponent\");\n };\n\n private readonly _batchSize: number;\n\n /**\n * True if clustered lighting is supported.\n */\n public get isSupported(): boolean {\n return this._batchSize > 0;\n }\n\n private readonly _lights: Light[] = [];\n /**\n * Gets the current list of lights added to this clustering system.\n */\n public get lights(): readonly Light[] {\n return this._lights;\n }\n\n private _camera: Nullable<Camera> = null;\n\n // The lights sorted by depth\n private readonly _sortedLights: (PointLight | SpotLight)[] = [];\n\n private _lightDataBuffer: Float32Array;\n private _lightDataTexture: RawTexture;\n private _lightDataRenderId = -1;\n\n private _tileMaskBatches = -1;\n private _tileMaskTexture: RenderTargetTexture;\n private _tileMaskBuffer: Nullable<StorageBuffer>;\n\n private _horizontalTiles = 64;\n /**\n * The number of tiles in the horizontal direction to cluster lights into.\n * A lower value will reduce memory and make the clustering step faster, while a higher value increases memory and makes the rendering step faster.\n */\n @serialize()\n public get horizontalTiles(): number {\n return this._horizontalTiles;\n }\n\n public set horizontalTiles(horizontal: number) {\n if (this._horizontalTiles === horizontal) {\n return;\n }\n this._horizontalTiles = horizontal;\n // Force the batch data to be recreated\n this._tileMaskBatches = -1;\n }\n\n private _verticalTiles = 64;\n /**\n * The number of tiles in the vertical direction to cluster lights into.\n * A lower value will reduce memory and make the clustering step faster, while a higher value increases memory and makes the rendering step faster.\n */\n @serialize()\n public get verticalTiles(): number {\n return this._verticalTiles;\n }\n\n public set verticalTiles(vertical: number) {\n if (this._verticalTiles === vertical) {\n return;\n }\n this._verticalTiles = vertical;\n // Force the batch data to be recreated\n this._tileMaskBatches = -1;\n }\n\n private _sliceScale = 0;\n private _sliceBias = 0;\n // List of vec2's that keep track of the min and max index per slice\n private _sliceRanges: Float32Array;\n\n private _depthSlices = DefaultDepthSlices;\n /**\n * The number of slices to split the depth range by and cluster lights into.\n */\n public get depthSlices(): number {\n return this._depthSlices;\n }\n\n public set depthSlices(slices: number) {\n if (this._depthSlices === slices) {\n return;\n }\n this._depthSlices = slices;\n this._sliceRanges = new Float32Array(slices * 2);\n\n // UBO size depends on the number of depth slices\n this._uniformBuffer.dispose();\n this._uniformBuffer = new UniformBuffer(this.getEngine(), undefined, undefined, this.name);\n this._buildUniformLayout();\n }\n\n private readonly _proxyMaterial: ShaderMaterial;\n private readonly _proxyMesh: Mesh;\n\n private _maxRange = 16383;\n private _minInverseSquaredRange = 1 / (this._maxRange * this._maxRange);\n /**\n * This limits the range of all the added lights, so even lights with extreme ranges will still have bounds for clustering.\n */\n @serialize()\n public get maxRange(): number {\n return this._maxRange;\n }\n\n public set maxRange(range: number) {\n if (this._maxRange === range) {\n return;\n }\n this._maxRange = range;\n this._minInverseSquaredRange = 1 / (range * range);\n }\n\n /**\n * Creates a new clustered light system with an initial set of lights.\n *\n * @param name The name of the clustered light container\n * @param lights The initial set of lights to add\n * @param scene The scene the clustered light container belongs to\n */\n constructor(name: string, lights: Light[] = [], scene?: Scene) {\n super(name, scene);\n const engine = this.getEngine();\n this._batchSize = ClusteredLightContainer._GetEngineBatchSize(engine);\n\n const proxyShader = { vertex: \"lightProxy\", fragment: \"lightProxy\" };\n const defines = [`CLUSTLIGHT_BATCH ${this._batchSize}`];\n if (this._scene.useRightHandedSystem) {\n defines.push(\"#define RIGHT_HANDED\");\n }\n this._proxyMaterial = new ShaderMaterial(\"ProxyMaterial\", this._scene, proxyShader, {\n attributes: [\"position\"],\n uniforms: [\"view\", \"projection\", \"tileMaskResolution\"],\n samplers: [\"lightDataTexture\"],\n uniformBuffers: [\"Scene\"],\n storageBuffers: [\"tileMaskBuffer\"],\n defines,\n shaderLanguage: engine.isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\n extraInitializationsAsync: async () => {\n if (engine.isWebGPU) {\n await Promise.all([import(\"../../ShadersWGSL/lightProxy.vertex\"), import(\"../../ShadersWGSL/lightProxy.fragment\")]);\n } else {\n await Promise.all([import(\"../../Shaders/lightProxy.vertex\"), import(\"../../Shaders/lightProxy.fragment\")]);\n }\n },\n });\n\n // Additive blending is for merging masks on WebGL\n this._proxyMaterial.transparencyMode = ShaderMaterial.MATERIAL_ALPHABLEND;\n this._proxyMaterial.alphaMode = Constants.ALPHA_ADD;\n this._proxyMaterial.sideOrientation = Constants.MATERIAL_CounterClockWiseSideOrientation;\n\n this._proxyMesh = CreatePlane(\"ProxyMesh\", { size: 2 }, this._scene);\n // Make sure it doesn't render for the default scene\n this._scene.removeMesh(this._proxyMesh);\n this._proxyMesh.material = this._proxyMaterial;\n\n this._updateBatches();\n\n this._sliceRanges = new Float32Array(this._depthSlices * 2);\n\n if (this._batchSize > 0) {\n ClusteredLightContainer._SceneComponentInitialization(this._scene);\n for (const light of lights) {\n this.addLight(light);\n }\n }\n }\n\n public override getClassName(): string {\n return \"ClusteredLightContainer\";\n }\n\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public override getTypeID(): number {\n return LightConstants.LIGHTTYPEID_CLUSTERED_CONTAINER;\n }\n\n /** @internal */\n public _updateBatches(camera: Nullable<Camera> = null): RenderTargetTexture {\n this._camera = camera;\n this._proxyMesh.isVisible = this._sortedLights.length > 0;\n\n // Ensure space for atleast 1 batch\n const batches = Math.max(Math.ceil(this._sortedLights.length / this._batchSize), 1);\n if (this._tileMaskBatches >= batches) {\n this._proxyMesh.thinInstanceCount = this._sortedLights.length;\n return this._tileMaskTexture;\n }\n const engine = this.getEngine();\n // Round up to a batch size so we don't have to reallocate as often\n const maxLights = batches * this._batchSize;\n\n this._lightDataBuffer = new Float32Array(20 * maxLights);\n this._lightDataTexture?.dispose();\n this._lightDataTexture = new RawTexture(\n this._lightDataBuffer,\n 5,\n maxLights,\n Constants.TEXTUREFORMAT_RGBA,\n this._scene,\n false,\n false,\n Constants.TEXTURE_NEAREST_SAMPLINGMODE,\n Constants.TEXTURETYPE_FLOAT\n );\n this._lightDataTexture.name = \"LightDataTexture_clustered_\" + this.name;\n this._proxyMaterial.setTexture(\"lightDataTexture\", this._lightDataTexture);\n\n this._tileMaskTexture?.dispose();\n const textureSize = { width: this._horizontalTiles, height: this._verticalTiles };\n if (!engine.isWebGPU) {\n // In WebGL we shift the light proxy by the batch number\n textureSize.height *= batches;\n }\n this._tileMaskTexture = new RenderTargetTexture(\"TileMaskTexture\", textureSize, this._scene, {\n // We don't write anything on WebGPU so make it as small as possible\n type: engine.isWebGPU ? Constants.TEXTURETYPE_UNSIGNED_BYTE : Constants.TEXTURETYPE_FLOAT,\n format: Constants.TEXTUREFORMAT_RED,\n generateDepthBuffer: false,\n });\n\n this._tileMaskTexture.renderParticles = false;\n this._tileMaskTexture.renderSprites = false;\n this._tileMaskTexture.noPrePassRenderer = true;\n this._tileMaskTexture.renderList = [this._proxyMesh];\n\n let currentRenderTarget: Nullable<RenderTargetWrapper> = null;\n\n this._tileMaskTexture.onBeforeBindObservable.add(() => {\n currentRenderTarget = engine._currentRenderTarget;\n this._updateLightData();\n });\n\n this._tileMaskTexture.onAfterUnbindObservable.add(() => {\n if (engine._currentRenderTarget !== currentRenderTarget) {\n if (!currentRenderTarget) {\n engine.restoreDefaultFramebuffer();\n } else {\n engine.bindFramebuffer(currentRenderTarget);\n }\n }\n });\n\n this._tileMaskTexture.onClearObservable.add(() => {\n if (engine.isWebGPU) {\n // Clear the storage buffer for WebGPU\n this._tileMaskBuffer?.clear();\n } else {\n // Only clear the texture on WebGL\n engine.clear({ r: 0, g: 0, b: 0, a: 1 }, true, false);\n }\n });\n\n if (engine.isWebGPU) {\n // WebGPU also needs a storage buffer to write to\n this._tileMaskBuffer?.dispose();\n const bufferSize = this._horizontalTiles * this._verticalTiles * batches * 4;\n this._tileMaskBuffer = new StorageBuffer(<WebGPUEngine>engine, bufferSize);\n this._proxyMaterial.setStorageBuffer(\"tileMaskBuffer\", this._tileMaskBuffer);\n }\n\n this._proxyMaterial.setVector3(\"tileMaskResolution\", new Vector3(this._horizontalTiles, this.verticalTiles, batches));\n\n // We don't actually use the matrix data but we need enough capacity for the lights\n this._proxyMesh.thinInstanceSetBuffer(\"matrix\", new Float32Array(maxLights * 16));\n this._proxyMesh.thinInstanceCount = this._sortedLights.length;\n this._tileMaskBatches = batches;\n return this._tileMaskTexture;\n }\n\n private _getSliceIndex(camera: Camera, depth: number): number {\n if (depth < camera.minZ) {\n // Prevent calling log on small or negative values\n return -1;\n }\n return Math.floor(Math.log(depth) * this._sliceScale + this._sliceBias);\n }\n\n private _updateLightData(): void {\n const camera = this._camera || this._scene.activeCamera;\n const renderId = this._scene.getRenderId();\n if (!camera || this._lightDataRenderId === renderId) {\n return;\n }\n this._lightDataRenderId = renderId;\n\n // Resort lights based on distance from camera\n const view = camera.getViewMatrix();\n for (const light of this._sortedLights) {\n const position = light.computeTransformedInformation() ? light.transformedPosition : light.position;\n const viewPosition = Vector3.TransformCoordinatesToRef(position, view, TmpVectors.Vector3[0]);\n light._currentViewDepth = this._scene.useRightHandedSystem ? -viewPosition.z : viewPosition.z;\n }\n this._sortedLights.sort((a, b) => a._currentViewDepth - b._currentViewDepth);\n\n // DOOM 2016 subdivision scheme, copied from: https://www.aortiz.me/2018/12/21/CG.html\n const logFarNear = Math.log(camera.maxZ / camera.minZ);\n this._sliceScale = this._depthSlices / logFarNear;\n this._sliceBias = -(this._depthSlices * Math.log(camera.minZ)) / logFarNear;\n\n this._sliceRanges.fill(0);\n // Last slice which had had its min index updated\n let minSlice = -1;\n\n const buf = this._lightDataBuffer;\n const offset = this._scene.floatingOriginOffset;\n\n for (let i = 0; i < this._sortedLights.length; i += 1) {\n const light = this._sortedLights[i];\n const off = i * 20;\n const computed = light.computeTransformedInformation();\n const scaledIntensity = light.getScaledIntensity();\n\n const position = computed ? light.transformedPosition : light.position;\n const diffuse = light.diffuse.scaleToRef(scaledIntensity, TmpColors.Color3[0]);\n const specular = light.specular.scaleToRef(scaledIntensity, TmpColors.Color3[1]);\n const range = Math.min(light.range, this.maxRange);\n const inverseSquaredRange = Math.max(light._inverseSquaredRange, this._minInverseSquaredRange);\n\n // vLightData\n buf[off + 0] = position.x - offset.x;\n buf[off + 1] = position.y - offset.y;\n buf[off + 2] = position.z - offset.z;\n buf[off + 3] = 0;\n // vLightDiffuse\n buf[off + 4] = diffuse.r;\n buf[off + 5] = diffuse.g;\n buf[off + 6] = diffuse.b;\n buf[off + 7] = range;\n // vLightSpecular\n buf[off + 8] = specular.r;\n buf[off + 9] = specular.g;\n buf[off + 10] = specular.b;\n buf[off + 11] = light.radius;\n // vLightDirection\n buf[off + 12] = 0;\n buf[off + 13] = 0;\n buf[off + 14] = 0;\n buf[off + 15] = -1;\n // vLightFalloff\n buf[off + 16] = range;\n buf[off + 17] = inverseSquaredRange;\n buf[off + 18] = 0;\n buf[off + 19] = 0;\n\n if (light.getTypeID() === LightConstants.LIGHTTYPEID_SPOTLIGHT) {\n const spotLight = <SpotLight>light;\n const direction = Vector3.NormalizeToRef(computed ? spotLight.transformedDirection : spotLight.direction, TmpVectors.Vector3[0]);\n\n // vLightData.a\n buf[off + 3] = spotLight.exponent;\n // vLightDirection\n buf[off + 12] = direction.x;\n buf[off + 13] = direction.y;\n buf[off + 14] = direction.z;\n buf[off + 15] = spotLight._cosHalfAngle;\n // vLightFalloff.zw\n buf[off + 18] = spotLight._lightAngleScale;\n buf[off + 19] = spotLight._lightAngleOffset;\n }\n\n // Update the depth slices that include this light\n const firstSlice = this._getSliceIndex(camera, light._currentViewDepth - range);\n const lastSlice = this._getSliceIndex(camera, light._currentViewDepth + range);\n for (let j = firstSlice; j <= lastSlice; j += 1) {\n if (j < 0 || j >= this._depthSlices) {\n continue;\n } else if (j > minSlice) {\n // Update min index\n this._sliceRanges[j * 2] = i;\n minSlice = j;\n }\n // Update max index\n this._sliceRanges[j * 2 + 1] = i;\n }\n }\n\n const engine = this.getEngine();\n if (engine.isWebGPU) {\n // Whenever the light data changes we have to flush pending WebGPU command buffers so that\n // previous render passes use the old data and later render passes use the new data.\n engine.flushFramebuffer();\n }\n this._lightDataTexture.update(this._lightDataBuffer);\n }\n\n public override dispose(doNotRecurse?: boolean, disposeMaterialAndTextures?: boolean): void {\n for (const light of this._lights) {\n light.dispose(doNotRecurse, disposeMaterialAndTextures);\n }\n this._lightDataTexture.dispose();\n this._tileMaskTexture.dispose();\n this._tileMaskBuffer?.dispose();\n this._proxyMesh.dispose(doNotRecurse, disposeMaterialAndTextures);\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\n }\n\n /**\n * Adds a light to the clustering system.\n * @param light The light to add\n */\n public addLight(light: Light): void {\n if (!ClusteredLightContainer.IsLightSupported(light)) {\n Logger.Warn(\"Attempting to add a light to cluster that does not support clustering\");\n return;\n }\n this._scene.removeLight(light);\n this._lights.push(light);\n this._sortedLights.push(<PointLight | SpotLight>light);\n\n this._proxyMesh.isVisible = true;\n this._proxyMesh.thinInstanceCount = this._sortedLights.length;\n }\n\n /**\n * Removes a light from the clustering system.\n * @param light The light to remove\n * @returns the index where the light was in the light list\n */\n public removeLight(light: Light): number {\n // Convert to `Light` array without cast so `indexOf` has correct typing\n const sortedLights: Light[] = this._sortedLights;\n const sortedIndex = sortedLights.indexOf(light);\n if (sortedIndex !== -1) {\n sortedLights.splice(sortedIndex, 1);\n\n this._proxyMesh.thinInstanceCount = sortedLights.length;\n if (sortedLights.length === 0) {\n this._proxyMesh.isVisible = false;\n }\n }\n\n const index = this._lights.indexOf(light);\n if (index !== -1) {\n this._lights.splice(index, 1);\n // We treat the unsorted array as the \"real\" one so only add back to the scene if it was found in that\n this._scene.addLight(light);\n }\n return index;\n }\n\n protected override _buildUniformLayout(): void {\n this._uniformBuffer.addUniform(\"vLightData\", 4);\n this._uniformBuffer.addUniform(\"vLightDiffuse\", 4);\n this._uniformBuffer.addUniform(\"vLightSpecular\", 4);\n this._uniformBuffer.addUniform(\"vSliceData\", 2);\n // _depthSlices might not be initialized yet\n this._uniformBuffer.addUniform(\"vSliceRanges\", 2, this._depthSlices ?? DefaultDepthSlices);\n this._uniformBuffer.addUniform(\"shadowsInfo\", 3);\n this._uniformBuffer.addUniform(\"depthValues\", 2);\n this._uniformBuffer.create();\n }\n\n public override transferToEffect(effect: Effect, lightIndex: string): Light {\n const engine = this.getEngine();\n const hscale = this._horizontalTiles / engine.getRenderWidth();\n const vscale = this._verticalTiles / engine.getRenderHeight();\n this._uniformBuffer.updateFloat4(\"vLightData\", hscale, vscale, this._verticalTiles, this._tileMaskBatches, lightIndex);\n this._uniformBuffer.updateFloat2(\"vSliceData\", this._sliceScale, this._sliceBias, lightIndex);\n this._uniformBuffer.updateFloatArray(\"vSliceRanges\", this._sliceRanges, lightIndex);\n return this;\n }\n\n public override transferTexturesToEffect(effect: Effect, lightIndex: string): Light {\n const engine = this.getEngine();\n effect.setTexture(\"lightDataTexture\" + lightIndex, this._lightDataTexture);\n if (engine.isWebGPU) {\n (<WebGPUEngine>engine).setStorageBuffer(\"tileMaskBuffer\" + lightIndex, this._tileMaskBuffer);\n } else {\n effect.setTexture(\"tileMaskTexture\" + lightIndex, this._tileMaskTexture);\n }\n return this;\n }\n\n public override transferToNodeMaterialEffect(_effect: Effect): Light {\n return this;\n }\n\n public override prepareLightSpecificDefines(defines: any, lightIndex: number): void {\n defines[\"CLUSTLIGHT\" + lightIndex] = true;\n defines[\"CLUSTLIGHT_BATCH\"] = this._batchSize;\n defines[\"CLUSTLIGHT_SLICES\"] = this._depthSlices;\n }\n\n public override _isReady(): boolean {\n this._updateBatches();\n return this._proxyMesh.isReady(true, true);\n }\n}\n\n// Register Class Name\nRegisterClass(\"BABYLON.ClusteredLightContainer\", ClusteredLightContainer);\n"]}
|
|
@@ -455,6 +455,8 @@ const LoadAssetContainer = (scene, data, rootUrl, onError, addToScene = false) =
|
|
|
455
455
|
for (let index = 0, cache = parsedData.spriteManagers.length; index < cache; index++) {
|
|
456
456
|
const parsedSpriteManager = parsedData.spriteManagers[index];
|
|
457
457
|
const spriteManager = SpriteManager.Parse(parsedSpriteManager, scene, rootUrl);
|
|
458
|
+
container.spriteManagers.push(spriteManager);
|
|
459
|
+
spriteManager._parentContainer = container;
|
|
458
460
|
log += "\n\t\tSpriteManager " + spriteManager.name;
|
|
459
461
|
}
|
|
460
462
|
}
|