@onerjs/core 8.32.8 → 8.32.9

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.
@@ -60,7 +60,7 @@ export interface IEffectLayerOptions {
60
60
  */
61
61
  export declare abstract class EffectLayer {
62
62
  private _effectLayerOptions;
63
- private _mainTextureCreatedSize;
63
+ protected _mainTextureCreatedSize: ISize;
64
64
  protected _scene: Scene;
65
65
  protected _engine: AbstractEngine;
66
66
  protected _maxSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"effectLayer.js","sourceRoot":"","sources":["../../../../dev/core/src/Layers/effectLayer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOhD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,qCAAoC;AA4ChE;;;;;;;GAOG;AACH,MAAM,OAAgB,WAAW;IAS7B,IAAc,aAAa;QACvB,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC;IAC/C,CAAC;IACD,IAAc,aAAa,CAAC,KAAK;QAC7B,IAAI,CAAC,gBAAgB,CAAC,aAAa,GAAG,KAAK,CAAC;IAChD,CAAC;IAGD,I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EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;;AAtbD;;GAEG;AACW,yCAA6B,GAA2B,CAAC,CAAC,EAAE,EAAE;IACxE,MAAM,WAAW,CAAC,2BAA2B,CAAC,CAAC;AACnD,CAAC,AAF0C,CAEzC;AAzHF;IADC,SAAS,EAAE;uCAGX;AAUD;IADC,iBAAiB,EAAE;+CAGnB;AAUD;IADC,SAAS,EAAE;4CAGX;AAUD;IADC,0BAA0B,EAAE;yCAG5B;AAMD;IADC,SAAS,EAAE;mDAGX;AASD;IADC,SAAS,EAAE;sEAGX","sourcesContent":["import { serialize, serializeAsColor4, serializeAsCameraReference } from \"../Misc/decorators\";\r\nimport { Tools } from \"../Misc/tools\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ISize } from \"../Maths/math.size\";\r\nimport type { Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Material } from \"../Materials/material\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { _WarnImport } from \"../Misc/devTools\";\r\nimport { GetExponentOfTwo } from \"../Misc/tools.functions\";\r\nimport type { ShaderLanguage } from \"core/Materials/shaderLanguage\";\r\nimport { ThinEffectLayer } from \"./thinEffectLayer\";\r\nimport { UniqueIdGenerator } from \"core/Misc/uniqueIdGenerator\";\r\n\r\n/**\r\n * Effect layer options. This helps customizing the behaviour\r\n * of the effect layer.\r\n */\r\nexport interface IEffectLayerOptions {\r\n /**\r\n * Multiplication factor apply to the canvas size to compute the render target size\r\n * used to generated the objects (the smaller the faster). Default: 0.5\r\n */\r\n mainTextureRatio: number;\r\n\r\n /**\r\n * Enforces a fixed size texture to ensure effect stability across devices. Default: undefined\r\n */\r\n mainTextureFixedSize?: number;\r\n\r\n /**\r\n * Alpha blending mode used to apply the blur. Default depends of the implementation. Default: ALPHA_COMBINE\r\n */\r\n alphaBlendingMode: number;\r\n\r\n /**\r\n * The camera attached to the layer. Default: null\r\n */\r\n camera: Nullable<Camera>;\r\n\r\n /**\r\n * The rendering group to draw the layer in. Default: -1\r\n */\r\n renderingGroupId: number;\r\n\r\n /**\r\n * The type of the main texture. Default: TEXTURETYPE_UNSIGNED_BYTE\r\n */\r\n mainTextureType: number;\r\n\r\n /**\r\n * Whether or not to generate a stencil buffer. Default: false\r\n */\r\n generateStencilBuffer: boolean;\r\n}\r\n\r\n/**\r\n * The effect layer Helps adding post process effect blended with the main pass.\r\n *\r\n * This can be for instance use to generate glow or highlight effects on the scene.\r\n *\r\n * The effect layer class can not be used directly and is intented to inherited from to be\r\n * customized per effects.\r\n */\r\nexport abstract class EffectLayer {\r\n private _effectLayerOptions: IEffectLayerOptions;\r\n private _mainTextureCreatedSize: ISize = { width: 0, height: 0 };\r\n\r\n protected _scene: Scene;\r\n protected _engine: AbstractEngine;\r\n protected _maxSize: number = 0;\r\n protected _mainTextureDesiredSize: ISize = { width: 0, height: 0 };\r\n protected _mainTexture: RenderTargetTexture;\r\n protected get _shouldRender() {\r\n return this._thinEffectLayer._shouldRender;\r\n }\r\n protected set _shouldRender(value) {\r\n this._thinEffectLayer._shouldRender = value;\r\n }\r\n protected _postProcesses: PostProcess[] = [];\r\n protected _textures: BaseTexture[] = [];\r\n protected get _emissiveTextureAndColor(): { texture: Nullable<BaseTexture>; color: Color4 } {\r\n return this._thinEffectLayer._emissiveTextureAndColor;\r\n }\r\n protected set _emissiveTextureAndColor(value) {\r\n this._thinEffectLayer._emissiveTextureAndColor = value;\r\n }\r\n protected get _effectIntensity(): { [meshUniqueId: number]: number } {\r\n return this._thinEffectLayer._effectIntensity;\r\n }\r\n protected set _effectIntensity(value) {\r\n this._thinEffectLayer._effectIntensity = value;\r\n }\r\n protected readonly _thinEffectLayer: ThinEffectLayer;\r\n private readonly _internalThinEffectLayer: boolean;\r\n\r\n /**\r\n * Force all the effect layers to compile to glsl even on WebGPU engines.\r\n * False by default. This is mostly meant for backward compatibility.\r\n */\r\n public static get ForceGLSL() {\r\n return ThinEffectLayer.ForceGLSL;\r\n }\r\n\r\n public static set ForceGLSL(value: boolean) {\r\n ThinEffectLayer.ForceGLSL = value;\r\n }\r\n\r\n /**\r\n * The unique id of the layer\r\n */\r\n public readonly uniqueId = UniqueIdGenerator.UniqueId;\r\n\r\n /**\r\n * The name of the layer\r\n */\r\n @serialize()\r\n public get name() {\r\n return this._thinEffectLayer.name;\r\n }\r\n\r\n public set name(value: string) {\r\n this._thinEffectLayer.name = value;\r\n }\r\n\r\n /**\r\n * The clear color of the texture used to generate the glow map.\r\n */\r\n @serializeAsColor4()\r\n public get neutralColor(): Color4 {\r\n return this._thinEffectLayer.neutralColor;\r\n }\r\n\r\n public set neutralColor(value: Color4) {\r\n this._thinEffectLayer.neutralColor = value;\r\n }\r\n\r\n /**\r\n * Specifies whether the highlight layer is enabled or not.\r\n */\r\n @serialize()\r\n public get isEnabled(): boolean {\r\n return this._thinEffectLayer.isEnabled;\r\n }\r\n\r\n public set isEnabled(value: boolean) {\r\n this._thinEffectLayer.isEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the camera attached to the layer.\r\n */\r\n @serializeAsCameraReference()\r\n public get camera(): Nullable<Camera> {\r\n return this._thinEffectLayer.camera;\r\n }\r\n\r\n /**\r\n * Gets the rendering group id the layer should render in.\r\n */\r\n @serialize()\r\n public get renderingGroupId(): number {\r\n return this._thinEffectLayer.renderingGroupId;\r\n }\r\n public set renderingGroupId(renderingGroupId: number) {\r\n this._thinEffectLayer.renderingGroupId = renderingGroupId;\r\n }\r\n\r\n /**\r\n * Specifies if the bounding boxes should be rendered normally or if they should undergo the effect of the layer\r\n */\r\n @serialize()\r\n public get disableBoundingBoxesFromEffectLayer() {\r\n return this._thinEffectLayer.disableBoundingBoxesFromEffectLayer;\r\n }\r\n\r\n public set disableBoundingBoxesFromEffectLayer(value: boolean) {\r\n this._thinEffectLayer.disableBoundingBoxesFromEffectLayer = value;\r\n }\r\n\r\n /**\r\n * An event triggered when the effect layer has been disposed.\r\n */\r\n public onDisposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the effect layer is about rendering the main texture with the glowy parts.\r\n */\r\n public onBeforeRenderMainTextureObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the generated texture is being merged in the scene.\r\n */\r\n public onBeforeComposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the mesh is rendered into the effect render target.\r\n */\r\n public onBeforeRenderMeshToEffect = new Observable<AbstractMesh>();\r\n\r\n /**\r\n * An event triggered after the mesh has been rendered into the effect render target.\r\n */\r\n public onAfterRenderMeshToEffect = new Observable<AbstractMesh>();\r\n\r\n /**\r\n * An event triggered when the generated texture has been merged in the scene.\r\n */\r\n public onAfterComposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the effect layer changes its size.\r\n */\r\n public onSizeChangedObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * Gets the main texture where the effect is rendered\r\n */\r\n public get mainTexture() {\r\n return this._mainTexture;\r\n }\r\n\r\n protected get _shaderLanguage(): ShaderLanguage {\r\n return this._thinEffectLayer.shaderLanguage;\r\n }\r\n\r\n /**\r\n * Gets the shader language used in this material.\r\n */\r\n public get shaderLanguage(): ShaderLanguage {\r\n return this._thinEffectLayer.shaderLanguage;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _SceneComponentInitialization: (scene: Scene) => void = (_) => {\r\n throw _WarnImport(\"EffectLayerSceneComponent\");\r\n };\r\n /**\r\n * Sets a specific material to be used to render a mesh/a list of meshes in the layer\r\n * @param mesh mesh or array of meshes\r\n * @param material material to use by the layer when rendering the mesh(es). If undefined is passed, the specific material created by the layer will be used.\r\n */\r\n public setMaterialForRendering(mesh: AbstractMesh | AbstractMesh[], material?: Material): void {\r\n this._thinEffectLayer.setMaterialForRendering(mesh, material);\r\n }\r\n\r\n /**\r\n * Gets the intensity of the effect for a specific mesh.\r\n * @param mesh The mesh to get the effect intensity for\r\n * @returns The intensity of the effect for the mesh\r\n */\r\n public getEffectIntensity(mesh: AbstractMesh) {\r\n return this._thinEffectLayer.getEffectIntensity(mesh);\r\n }\r\n\r\n /**\r\n * Sets the intensity of the effect for a specific mesh.\r\n * @param mesh The mesh to set the effect intensity for\r\n * @param intensity The intensity of the effect for the mesh\r\n */\r\n public setEffectIntensity(mesh: AbstractMesh, intensity: number): void {\r\n this._thinEffectLayer.setEffectIntensity(mesh, intensity);\r\n }\r\n\r\n /**\r\n * Instantiates a new effect Layer and references it in the scene.\r\n * @param name The name of the layer\r\n * @param scene The scene to use the layer in\r\n * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false\r\n * @param thinEffectLayer The thin instance of the effect layer (optional)\r\n */\r\n constructor(\r\n /** The Friendly of the effect in the scene */\r\n name: string,\r\n scene?: Scene,\r\n forceGLSL = false,\r\n thinEffectLayer?: ThinEffectLayer\r\n ) {\r\n this._internalThinEffectLayer = !thinEffectLayer;\r\n if (!thinEffectLayer) {\r\n thinEffectLayer = new ThinEffectLayer(name, scene, forceGLSL, false, this._importShadersAsync.bind(this));\r\n thinEffectLayer.getEffectName = this.getEffectName.bind(this);\r\n thinEffectLayer.isReady = this.isReady.bind(this);\r\n thinEffectLayer._createMergeEffect = this._createMergeEffect.bind(this);\r\n thinEffectLayer._createTextureAndPostProcesses = this._createTextureAndPostProcesses.bind(this);\r\n thinEffectLayer._internalCompose = this._internalRender.bind(this);\r\n thinEffectLayer._setEmissiveTextureAndColor = this._setEmissiveTextureAndColor.bind(this);\r\n thinEffectLayer._numInternalDraws = this._numInternalDraws.bind(this);\r\n thinEffectLayer._addCustomEffectDefines = this._addCustomEffectDefines.bind(this);\r\n thinEffectLayer.hasMesh = this.hasMesh.bind(this);\r\n thinEffectLayer.shouldRender = this.shouldRender.bind(this);\r\n thinEffectLayer._shouldRenderMesh = this._shouldRenderMesh.bind(this);\r\n thinEffectLayer._canRenderMesh = this._canRenderMesh.bind(this);\r\n thinEffectLayer._useMeshMaterial = this._useMeshMaterial.bind(this);\r\n }\r\n\r\n this._thinEffectLayer = thinEffectLayer;\r\n this.name = name;\r\n\r\n this._scene = scene || <Scene>EngineStore.LastCreatedScene;\r\n EffectLayer._SceneComponentInitialization(this._scene);\r\n\r\n this._engine = this._scene.getEngine();\r\n this._maxSize = this._engine.getCaps().maxTextureSize;\r\n this._scene.addEffectLayer(this);\r\n\r\n this._thinEffectLayer.onDisposeObservable.add(() => {\r\n this.onDisposeObservable.notifyObservers(this);\r\n });\r\n\r\n this._thinEffectLayer.onBeforeRenderLayerObservable.add(() => {\r\n this.onBeforeRenderMainTextureObservable.notifyObservers(this);\r\n });\r\n\r\n this._thinEffectLayer.onBeforeComposeObservable.add(() => {\r\n this.onBeforeComposeObservable.notifyObservers(this);\r\n });\r\n\r\n this._thinEffectLayer.onBeforeRenderMeshToEffect.add((mesh) => {\r\n this.onBeforeRenderMeshToEffect.notifyObservers(mesh);\r\n });\r\n\r\n this._thinEffectLayer.onAfterRenderMeshToEffect.add((mesh) => {\r\n this.onAfterRenderMeshToEffect.notifyObservers(mesh);\r\n });\r\n\r\n this._thinEffectLayer.onAfterComposeObservable.add(() => {\r\n this.onAfterComposeObservable.notifyObservers(this);\r\n });\r\n }\r\n\r\n protected get _shadersLoaded() {\r\n return this._thinEffectLayer._shadersLoaded;\r\n }\r\n\r\n protected set _shadersLoaded(value: boolean) {\r\n this._thinEffectLayer._shadersLoaded = value;\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 abstract getEffectName(): string;\r\n\r\n /**\r\n * Checks for the readiness of the element composing the layer.\r\n * @param subMesh the mesh to check for\r\n * @param useInstances specify whether or not to use instances to render the mesh\r\n * @returns true if ready otherwise, false\r\n */\r\n public abstract isReady(subMesh: SubMesh, useInstances: boolean): boolean;\r\n\r\n /**\r\n * Returns whether or not the layer needs stencil enabled during the mesh rendering.\r\n * @returns true if the effect requires stencil during the main canvas render pass.\r\n */\r\n public abstract needStencil(): boolean;\r\n\r\n /**\r\n * Create the merge effect. This is the shader use to blit the information back\r\n * to the main canvas at the end of the scene rendering.\r\n * @returns The effect containing the shader used to merge the effect on the main canvas\r\n */\r\n protected abstract _createMergeEffect(): Effect;\r\n\r\n /**\r\n * Creates the render target textures and post processes used in the effect layer.\r\n */\r\n protected abstract _createTextureAndPostProcesses(): void;\r\n\r\n /**\r\n * Implementation specific of rendering the generating effect on the main canvas.\r\n * @param effect The effect used to render through\r\n * @param renderNum Index of the _internalRender call (0 for the first time _internalRender is called, 1 for the second time, etc. _internalRender is called the number of times returned by _numInternalDraws())\r\n */\r\n protected abstract _internalRender(effect: Effect, renderIndex: number): void;\r\n\r\n /**\r\n * Sets the required values for both the emissive texture and and the main color.\r\n */\r\n protected abstract _setEmissiveTextureAndColor(mesh: Mesh, subMesh: SubMesh, material: Material): void;\r\n\r\n /**\r\n * Free any resources and references associated to a mesh.\r\n * Internal use\r\n * @param mesh The mesh to free.\r\n */\r\n public abstract _disposeMesh(mesh: Mesh): void;\r\n\r\n /**\r\n * Serializes this layer (Glow or Highlight for example)\r\n * @returns a serialized layer object\r\n */\r\n public abstract serialize?(): any;\r\n\r\n /**\r\n * Number of times _internalRender will be called. Some effect layers need to render the mesh several times, so they should override this method with the number of times the mesh should be rendered\r\n * @returns Number of times a mesh must be rendered in the layer\r\n */\r\n protected _numInternalDraws(): number {\r\n return this._internalThinEffectLayer ? 1 : this._thinEffectLayer._numInternalDraws();\r\n }\r\n\r\n /**\r\n * Initializes the effect layer with the required options.\r\n * @param options Sets of none mandatory options to use with the layer (see IEffectLayerOptions for more information)\r\n */\r\n protected _init(options: Partial<IEffectLayerOptions>): void {\r\n // Adapt options\r\n this._effectLayerOptions = {\r\n mainTextureRatio: 0.5,\r\n alphaBlendingMode: Constants.ALPHA_COMBINE,\r\n camera: null,\r\n renderingGroupId: -1,\r\n mainTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n generateStencilBuffer: false,\r\n ...options,\r\n };\r\n\r\n this._setMainTextureSize();\r\n this._thinEffectLayer._init(options);\r\n this._createMainTexture();\r\n this._createTextureAndPostProcesses();\r\n }\r\n\r\n /**\r\n * Sets the main texture desired size which is the closest power of two\r\n * of the engine canvas size.\r\n */\r\n private _setMainTextureSize(): void {\r\n if (this._effectLayerOptions.mainTextureFixedSize) {\r\n this._mainTextureDesiredSize.width = this._effectLayerOptions.mainTextureFixedSize;\r\n this._mainTextureDesiredSize.height = this._effectLayerOptions.mainTextureFixedSize;\r\n } else {\r\n this._mainTextureDesiredSize.width = this._engine.getRenderWidth() * this._effectLayerOptions.mainTextureRatio;\r\n this._mainTextureDesiredSize.height = this._engine.getRenderHeight() * this._effectLayerOptions.mainTextureRatio;\r\n\r\n this._mainTextureDesiredSize.width = this._engine.needPOTTextures\r\n ? GetExponentOfTwo(this._mainTextureDesiredSize.width, this._maxSize)\r\n : this._mainTextureDesiredSize.width;\r\n this._mainTextureDesiredSize.height = this._engine.needPOTTextures\r\n ? GetExponentOfTwo(this._mainTextureDesiredSize.height, this._maxSize)\r\n : this._mainTextureDesiredSize.height;\r\n }\r\n\r\n this._mainTextureDesiredSize.width = Math.floor(this._mainTextureDesiredSize.width);\r\n this._mainTextureDesiredSize.height = Math.floor(this._mainTextureDesiredSize.height);\r\n }\r\n\r\n /**\r\n * Creates the main texture for the effect layer.\r\n */\r\n protected _createMainTexture(): void {\r\n this._mainTexture = new RenderTargetTexture(\r\n \"EffectLayerMainRTT\",\r\n {\r\n width: this._mainTextureDesiredSize.width,\r\n height: this._mainTextureDesiredSize.height,\r\n },\r\n this._scene,\r\n {\r\n type: this._effectLayerOptions.mainTextureType,\r\n samplingMode: Texture.TRILINEAR_SAMPLINGMODE,\r\n generateStencilBuffer: this._effectLayerOptions.generateStencilBuffer,\r\n existingObjectRenderer: this._thinEffectLayer.objectRenderer,\r\n }\r\n );\r\n this._mainTexture.activeCamera = this._effectLayerOptions.camera;\r\n this._mainTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._mainTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._mainTexture.anisotropicFilteringLevel = 1;\r\n this._mainTexture.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\r\n this._mainTexture.renderParticles = false;\r\n this._mainTexture.renderList = null;\r\n this._mainTexture.ignoreCameraViewport = true;\r\n\r\n this._mainTexture.onClearObservable.add((engine: AbstractEngine) => {\r\n engine.clear(this.neutralColor, true, true, true);\r\n });\r\n }\r\n\r\n /**\r\n * Adds specific effects defines.\r\n * @param defines The defines to add specifics to.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _addCustomEffectDefines(defines: string[]): void {\r\n // Nothing to add by default.\r\n }\r\n\r\n /**\r\n * Checks for the readiness of the element composing the layer.\r\n * @param subMesh the mesh to check for\r\n * @param useInstances specify whether or not to use instances to render the mesh\r\n * @param emissiveTexture the associated emissive texture used to generate the glow\r\n * @returns true if ready otherwise, false\r\n */\r\n protected _isReady(subMesh: SubMesh, useInstances: boolean, emissiveTexture: Nullable<BaseTexture>): boolean {\r\n return this._internalThinEffectLayer\r\n ? this._thinEffectLayer._internalIsSubMeshReady(subMesh, useInstances, emissiveTexture)\r\n : this._thinEffectLayer._isSubMeshReady(subMesh, useInstances, emissiveTexture);\r\n }\r\n\r\n protected async _importShadersAsync(): Promise<void> {}\r\n\r\n protected _arePostProcessAndMergeReady(): boolean {\r\n return this._internalThinEffectLayer ? this._thinEffectLayer._internalIsLayerReady() : this._thinEffectLayer.isLayerReady();\r\n }\r\n\r\n /**\r\n * Checks if the layer is ready to be used.\r\n * @returns true if the layer is ready to be used\r\n */\r\n public isLayerReady(): boolean {\r\n return this._arePostProcessAndMergeReady() && this._mainTexture.isReady();\r\n }\r\n\r\n /**\r\n * Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene.\r\n */\r\n public render(): void {\r\n if (!this._thinEffectLayer.compose()) {\r\n return;\r\n }\r\n\r\n // Handle size changes.\r\n this._setMainTextureSize();\r\n if (\r\n (this._mainTextureCreatedSize.width !== this._mainTextureDesiredSize.width || this._mainTextureCreatedSize.height !== this._mainTextureDesiredSize.height) &&\r\n this._mainTextureDesiredSize.width !== 0 &&\r\n this._mainTextureDesiredSize.height !== 0\r\n ) {\r\n // Recreate RTT and post processes on size change.\r\n this.onSizeChangedObservable.notifyObservers(this);\r\n this._disposeTextureAndPostProcesses();\r\n this._createMainTexture();\r\n this._createTextureAndPostProcesses();\r\n this._mainTextureCreatedSize.width = this._mainTextureDesiredSize.width;\r\n this._mainTextureCreatedSize.height = this._mainTextureDesiredSize.height;\r\n }\r\n }\r\n\r\n /**\r\n * Determine if a given mesh will be used in the current effect.\r\n * @param mesh mesh to test\r\n * @returns true if the mesh will be used\r\n */\r\n public hasMesh(mesh: AbstractMesh): boolean {\r\n return this._internalThinEffectLayer ? this._thinEffectLayer._internalHasMesh(mesh) : this._thinEffectLayer.hasMesh(mesh);\r\n }\r\n\r\n /**\r\n * Returns true if the layer contains information to display, otherwise false.\r\n * @returns true if the glow layer should be rendered\r\n */\r\n public shouldRender(): boolean {\r\n return this._internalThinEffectLayer ? this._thinEffectLayer._internalShouldRender() : 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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _shouldRenderMesh(mesh: AbstractMesh): boolean {\r\n return this._internalThinEffectLayer ? true : 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 _canRenderMesh(mesh: AbstractMesh, material: Material): boolean {\r\n return this._internalThinEffectLayer ? this._thinEffectLayer._internalCanRenderMesh(mesh, material) : this._thinEffectLayer._canRenderMesh(mesh, material);\r\n }\r\n\r\n /**\r\n * Returns true if the mesh should render, otherwise false.\r\n * @returns true if it should render otherwise false\r\n */\r\n protected _shouldRenderEmissiveTextureForMesh(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Defines whether the current material of the mesh should be use to render the effect.\r\n * @param mesh defines the current mesh to render\r\n * @returns true if the mesh material should be use\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _useMeshMaterial(mesh: AbstractMesh): boolean {\r\n return this._internalThinEffectLayer ? false : this._thinEffectLayer._useMeshMaterial(mesh);\r\n }\r\n\r\n /**\r\n * Rebuild the required buffers.\r\n * @internal Internal use only.\r\n */\r\n public _rebuild(): void {\r\n this._thinEffectLayer._rebuild();\r\n }\r\n\r\n /**\r\n * Dispose only the render target textures and post process.\r\n */\r\n private _disposeTextureAndPostProcesses(): void {\r\n this._mainTexture.dispose();\r\n\r\n for (let i = 0; i < this._postProcesses.length; i++) {\r\n if (this._postProcesses[i]) {\r\n this._postProcesses[i].dispose();\r\n }\r\n }\r\n this._postProcesses = [];\r\n\r\n for (let i = 0; i < this._textures.length; i++) {\r\n if (this._textures[i]) {\r\n this._textures[i].dispose();\r\n }\r\n }\r\n this._textures = [];\r\n }\r\n\r\n /**\r\n * Dispose the highlight layer and free resources.\r\n */\r\n public dispose(): void {\r\n this._thinEffectLayer.dispose();\r\n\r\n // Clean textures and post processes\r\n this._disposeTextureAndPostProcesses();\r\n\r\n // Remove from scene\r\n this._scene.removeEffectLayer(this);\r\n\r\n // Callback\r\n this.onDisposeObservable.clear();\r\n this.onBeforeRenderMainTextureObservable.clear();\r\n this.onBeforeComposeObservable.clear();\r\n this.onBeforeRenderMeshToEffect.clear();\r\n this.onAfterRenderMeshToEffect.clear();\r\n this.onAfterComposeObservable.clear();\r\n this.onSizeChangedObservable.clear();\r\n }\r\n\r\n /**\r\n * Gets the class name of the effect layer\r\n * @returns the string with the class name of the effect layer\r\n */\r\n public getClassName(): string {\r\n return \"EffectLayer\";\r\n }\r\n\r\n /**\r\n * Creates an effect layer from parsed effect layer data\r\n * @param parsedEffectLayer defines effect layer data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing the effect layer information\r\n * @returns a parsed effect Layer\r\n */\r\n public static Parse(parsedEffectLayer: any, scene: Scene, rootUrl: string): EffectLayer {\r\n const effectLayerType = Tools.Instantiate(parsedEffectLayer.customType);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\r\n return effectLayerType.Parse(parsedEffectLayer, scene, rootUrl);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"effectLayer.js","sourceRoot":"","sources":["../../../../dev/core/src/Layers/effectLayer.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAOhD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAA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,CAAC;QACvC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,CAAC;IACzC,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,aAAa,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,CAAC,iBAAsB,EAAE,KAAY,EAAE,OAAe;QACrE,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAExE,+DAA+D;QAC/D,OAAO,eAAe,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;;AAtbD;;GAEG;AACW,yCAA6B,GAA2B,CAAC,CAAC,EAAE,EAAE;IACxE,MAAM,WAAW,CAAC,2BAA2B,CAAC,CAAC;AACnD,CAAC,AAF0C,CAEzC;AAzHF;IADC,SAAS,EAAE;uCAGX;AAUD;IADC,iBAAiB,EAAE;+CAGnB;AAUD;IADC,SAAS,EAAE;4CAGX;AAUD;IADC,0BAA0B,EAAE;yCAG5B;AAMD;IADC,SAAS,EAAE;mDAGX;AASD;IADC,SAAS,EAAE;sEAGX","sourcesContent":["import { serialize, serializeAsColor4, serializeAsCameraReference } from \"../Misc/decorators\";\r\nimport { Tools } from \"../Misc/tools\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { ISize } from \"../Maths/math.size\";\r\nimport type { Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport type { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Material } from \"../Materials/material\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { _WarnImport } from \"../Misc/devTools\";\r\nimport { GetExponentOfTwo } from \"../Misc/tools.functions\";\r\nimport type { ShaderLanguage } from \"core/Materials/shaderLanguage\";\r\nimport { ThinEffectLayer } from \"./thinEffectLayer\";\r\nimport { UniqueIdGenerator } from \"core/Misc/uniqueIdGenerator\";\r\n\r\n/**\r\n * Effect layer options. This helps customizing the behaviour\r\n * of the effect layer.\r\n */\r\nexport interface IEffectLayerOptions {\r\n /**\r\n * Multiplication factor apply to the canvas size to compute the render target size\r\n * used to generated the objects (the smaller the faster). Default: 0.5\r\n */\r\n mainTextureRatio: number;\r\n\r\n /**\r\n * Enforces a fixed size texture to ensure effect stability across devices. Default: undefined\r\n */\r\n mainTextureFixedSize?: number;\r\n\r\n /**\r\n * Alpha blending mode used to apply the blur. Default depends of the implementation. Default: ALPHA_COMBINE\r\n */\r\n alphaBlendingMode: number;\r\n\r\n /**\r\n * The camera attached to the layer. Default: null\r\n */\r\n camera: Nullable<Camera>;\r\n\r\n /**\r\n * The rendering group to draw the layer in. Default: -1\r\n */\r\n renderingGroupId: number;\r\n\r\n /**\r\n * The type of the main texture. Default: TEXTURETYPE_UNSIGNED_BYTE\r\n */\r\n mainTextureType: number;\r\n\r\n /**\r\n * Whether or not to generate a stencil buffer. Default: false\r\n */\r\n generateStencilBuffer: boolean;\r\n}\r\n\r\n/**\r\n * The effect layer Helps adding post process effect blended with the main pass.\r\n *\r\n * This can be for instance use to generate glow or highlight effects on the scene.\r\n *\r\n * The effect layer class can not be used directly and is intented to inherited from to be\r\n * customized per effects.\r\n */\r\nexport abstract class EffectLayer {\r\n private _effectLayerOptions: IEffectLayerOptions;\r\n protected _mainTextureCreatedSize: ISize = { width: 0, height: 0 };\r\n\r\n protected _scene: Scene;\r\n protected _engine: AbstractEngine;\r\n protected _maxSize: number = 0;\r\n protected _mainTextureDesiredSize: ISize = { width: 0, height: 0 };\r\n protected _mainTexture: RenderTargetTexture;\r\n protected get _shouldRender() {\r\n return this._thinEffectLayer._shouldRender;\r\n }\r\n protected set _shouldRender(value) {\r\n this._thinEffectLayer._shouldRender = value;\r\n }\r\n protected _postProcesses: PostProcess[] = [];\r\n protected _textures: BaseTexture[] = [];\r\n protected get _emissiveTextureAndColor(): { texture: Nullable<BaseTexture>; color: Color4 } {\r\n return this._thinEffectLayer._emissiveTextureAndColor;\r\n }\r\n protected set _emissiveTextureAndColor(value) {\r\n this._thinEffectLayer._emissiveTextureAndColor = value;\r\n }\r\n protected get _effectIntensity(): { [meshUniqueId: number]: number } {\r\n return this._thinEffectLayer._effectIntensity;\r\n }\r\n protected set _effectIntensity(value) {\r\n this._thinEffectLayer._effectIntensity = value;\r\n }\r\n protected readonly _thinEffectLayer: ThinEffectLayer;\r\n private readonly _internalThinEffectLayer: boolean;\r\n\r\n /**\r\n * Force all the effect layers to compile to glsl even on WebGPU engines.\r\n * False by default. This is mostly meant for backward compatibility.\r\n */\r\n public static get ForceGLSL() {\r\n return ThinEffectLayer.ForceGLSL;\r\n }\r\n\r\n public static set ForceGLSL(value: boolean) {\r\n ThinEffectLayer.ForceGLSL = value;\r\n }\r\n\r\n /**\r\n * The unique id of the layer\r\n */\r\n public readonly uniqueId = UniqueIdGenerator.UniqueId;\r\n\r\n /**\r\n * The name of the layer\r\n */\r\n @serialize()\r\n public get name() {\r\n return this._thinEffectLayer.name;\r\n }\r\n\r\n public set name(value: string) {\r\n this._thinEffectLayer.name = value;\r\n }\r\n\r\n /**\r\n * The clear color of the texture used to generate the glow map.\r\n */\r\n @serializeAsColor4()\r\n public get neutralColor(): Color4 {\r\n return this._thinEffectLayer.neutralColor;\r\n }\r\n\r\n public set neutralColor(value: Color4) {\r\n this._thinEffectLayer.neutralColor = value;\r\n }\r\n\r\n /**\r\n * Specifies whether the highlight layer is enabled or not.\r\n */\r\n @serialize()\r\n public get isEnabled(): boolean {\r\n return this._thinEffectLayer.isEnabled;\r\n }\r\n\r\n public set isEnabled(value: boolean) {\r\n this._thinEffectLayer.isEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the camera attached to the layer.\r\n */\r\n @serializeAsCameraReference()\r\n public get camera(): Nullable<Camera> {\r\n return this._thinEffectLayer.camera;\r\n }\r\n\r\n /**\r\n * Gets the rendering group id the layer should render in.\r\n */\r\n @serialize()\r\n public get renderingGroupId(): number {\r\n return this._thinEffectLayer.renderingGroupId;\r\n }\r\n public set renderingGroupId(renderingGroupId: number) {\r\n this._thinEffectLayer.renderingGroupId = renderingGroupId;\r\n }\r\n\r\n /**\r\n * Specifies if the bounding boxes should be rendered normally or if they should undergo the effect of the layer\r\n */\r\n @serialize()\r\n public get disableBoundingBoxesFromEffectLayer() {\r\n return this._thinEffectLayer.disableBoundingBoxesFromEffectLayer;\r\n }\r\n\r\n public set disableBoundingBoxesFromEffectLayer(value: boolean) {\r\n this._thinEffectLayer.disableBoundingBoxesFromEffectLayer = value;\r\n }\r\n\r\n /**\r\n * An event triggered when the effect layer has been disposed.\r\n */\r\n public onDisposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the effect layer is about rendering the main texture with the glowy parts.\r\n */\r\n public onBeforeRenderMainTextureObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the generated texture is being merged in the scene.\r\n */\r\n public onBeforeComposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the mesh is rendered into the effect render target.\r\n */\r\n public onBeforeRenderMeshToEffect = new Observable<AbstractMesh>();\r\n\r\n /**\r\n * An event triggered after the mesh has been rendered into the effect render target.\r\n */\r\n public onAfterRenderMeshToEffect = new Observable<AbstractMesh>();\r\n\r\n /**\r\n * An event triggered when the generated texture has been merged in the scene.\r\n */\r\n public onAfterComposeObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * An event triggered when the effect layer changes its size.\r\n */\r\n public onSizeChangedObservable = new Observable<EffectLayer>();\r\n\r\n /**\r\n * Gets the main texture where the effect is rendered\r\n */\r\n public get mainTexture() {\r\n return this._mainTexture;\r\n }\r\n\r\n protected get _shaderLanguage(): ShaderLanguage {\r\n return this._thinEffectLayer.shaderLanguage;\r\n }\r\n\r\n /**\r\n * Gets the shader language used in this material.\r\n */\r\n public get shaderLanguage(): ShaderLanguage {\r\n return this._thinEffectLayer.shaderLanguage;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static _SceneComponentInitialization: (scene: Scene) => void = (_) => {\r\n throw _WarnImport(\"EffectLayerSceneComponent\");\r\n };\r\n /**\r\n * Sets a specific material to be used to render a mesh/a list of meshes in the layer\r\n * @param mesh mesh or array of meshes\r\n * @param material material to use by the layer when rendering the mesh(es). If undefined is passed, the specific material created by the layer will be used.\r\n */\r\n public setMaterialForRendering(mesh: AbstractMesh | AbstractMesh[], material?: Material): void {\r\n this._thinEffectLayer.setMaterialForRendering(mesh, material);\r\n }\r\n\r\n /**\r\n * Gets the intensity of the effect for a specific mesh.\r\n * @param mesh The mesh to get the effect intensity for\r\n * @returns The intensity of the effect for the mesh\r\n */\r\n public getEffectIntensity(mesh: AbstractMesh) {\r\n return this._thinEffectLayer.getEffectIntensity(mesh);\r\n }\r\n\r\n /**\r\n * Sets the intensity of the effect for a specific mesh.\r\n * @param mesh The mesh to set the effect intensity for\r\n * @param intensity The intensity of the effect for the mesh\r\n */\r\n public setEffectIntensity(mesh: AbstractMesh, intensity: number): void {\r\n this._thinEffectLayer.setEffectIntensity(mesh, intensity);\r\n }\r\n\r\n /**\r\n * Instantiates a new effect Layer and references it in the scene.\r\n * @param name The name of the layer\r\n * @param scene The scene to use the layer in\r\n * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false\r\n * @param thinEffectLayer The thin instance of the effect layer (optional)\r\n */\r\n constructor(\r\n /** The Friendly of the effect in the scene */\r\n name: string,\r\n scene?: Scene,\r\n forceGLSL = false,\r\n thinEffectLayer?: ThinEffectLayer\r\n ) {\r\n this._internalThinEffectLayer = !thinEffectLayer;\r\n if (!thinEffectLayer) {\r\n thinEffectLayer = new ThinEffectLayer(name, scene, forceGLSL, false, this._importShadersAsync.bind(this));\r\n thinEffectLayer.getEffectName = this.getEffectName.bind(this);\r\n thinEffectLayer.isReady = this.isReady.bind(this);\r\n thinEffectLayer._createMergeEffect = this._createMergeEffect.bind(this);\r\n thinEffectLayer._createTextureAndPostProcesses = this._createTextureAndPostProcesses.bind(this);\r\n thinEffectLayer._internalCompose = this._internalRender.bind(this);\r\n thinEffectLayer._setEmissiveTextureAndColor = this._setEmissiveTextureAndColor.bind(this);\r\n thinEffectLayer._numInternalDraws = this._numInternalDraws.bind(this);\r\n thinEffectLayer._addCustomEffectDefines = this._addCustomEffectDefines.bind(this);\r\n thinEffectLayer.hasMesh = this.hasMesh.bind(this);\r\n thinEffectLayer.shouldRender = this.shouldRender.bind(this);\r\n thinEffectLayer._shouldRenderMesh = this._shouldRenderMesh.bind(this);\r\n thinEffectLayer._canRenderMesh = this._canRenderMesh.bind(this);\r\n thinEffectLayer._useMeshMaterial = this._useMeshMaterial.bind(this);\r\n }\r\n\r\n this._thinEffectLayer = thinEffectLayer;\r\n this.name = name;\r\n\r\n this._scene = scene || <Scene>EngineStore.LastCreatedScene;\r\n EffectLayer._SceneComponentInitialization(this._scene);\r\n\r\n this._engine = this._scene.getEngine();\r\n this._maxSize = this._engine.getCaps().maxTextureSize;\r\n this._scene.addEffectLayer(this);\r\n\r\n this._thinEffectLayer.onDisposeObservable.add(() => {\r\n this.onDisposeObservable.notifyObservers(this);\r\n });\r\n\r\n this._thinEffectLayer.onBeforeRenderLayerObservable.add(() => {\r\n this.onBeforeRenderMainTextureObservable.notifyObservers(this);\r\n });\r\n\r\n this._thinEffectLayer.onBeforeComposeObservable.add(() => {\r\n this.onBeforeComposeObservable.notifyObservers(this);\r\n });\r\n\r\n this._thinEffectLayer.onBeforeRenderMeshToEffect.add((mesh) => {\r\n this.onBeforeRenderMeshToEffect.notifyObservers(mesh);\r\n });\r\n\r\n this._thinEffectLayer.onAfterRenderMeshToEffect.add((mesh) => {\r\n this.onAfterRenderMeshToEffect.notifyObservers(mesh);\r\n });\r\n\r\n this._thinEffectLayer.onAfterComposeObservable.add(() => {\r\n this.onAfterComposeObservable.notifyObservers(this);\r\n });\r\n }\r\n\r\n protected get _shadersLoaded() {\r\n return this._thinEffectLayer._shadersLoaded;\r\n }\r\n\r\n protected set _shadersLoaded(value: boolean) {\r\n this._thinEffectLayer._shadersLoaded = value;\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 abstract getEffectName(): string;\r\n\r\n /**\r\n * Checks for the readiness of the element composing the layer.\r\n * @param subMesh the mesh to check for\r\n * @param useInstances specify whether or not to use instances to render the mesh\r\n * @returns true if ready otherwise, false\r\n */\r\n public abstract isReady(subMesh: SubMesh, useInstances: boolean): boolean;\r\n\r\n /**\r\n * Returns whether or not the layer needs stencil enabled during the mesh rendering.\r\n * @returns true if the effect requires stencil during the main canvas render pass.\r\n */\r\n public abstract needStencil(): boolean;\r\n\r\n /**\r\n * Create the merge effect. This is the shader use to blit the information back\r\n * to the main canvas at the end of the scene rendering.\r\n * @returns The effect containing the shader used to merge the effect on the main canvas\r\n */\r\n protected abstract _createMergeEffect(): Effect;\r\n\r\n /**\r\n * Creates the render target textures and post processes used in the effect layer.\r\n */\r\n protected abstract _createTextureAndPostProcesses(): void;\r\n\r\n /**\r\n * Implementation specific of rendering the generating effect on the main canvas.\r\n * @param effect The effect used to render through\r\n * @param renderNum Index of the _internalRender call (0 for the first time _internalRender is called, 1 for the second time, etc. _internalRender is called the number of times returned by _numInternalDraws())\r\n */\r\n protected abstract _internalRender(effect: Effect, renderIndex: number): void;\r\n\r\n /**\r\n * Sets the required values for both the emissive texture and and the main color.\r\n */\r\n protected abstract _setEmissiveTextureAndColor(mesh: Mesh, subMesh: SubMesh, material: Material): void;\r\n\r\n /**\r\n * Free any resources and references associated to a mesh.\r\n * Internal use\r\n * @param mesh The mesh to free.\r\n */\r\n public abstract _disposeMesh(mesh: Mesh): void;\r\n\r\n /**\r\n * Serializes this layer (Glow or Highlight for example)\r\n * @returns a serialized layer object\r\n */\r\n public abstract serialize?(): any;\r\n\r\n /**\r\n * Number of times _internalRender will be called. Some effect layers need to render the mesh several times, so they should override this method with the number of times the mesh should be rendered\r\n * @returns Number of times a mesh must be rendered in the layer\r\n */\r\n protected _numInternalDraws(): number {\r\n return this._internalThinEffectLayer ? 1 : this._thinEffectLayer._numInternalDraws();\r\n }\r\n\r\n /**\r\n * Initializes the effect layer with the required options.\r\n * @param options Sets of none mandatory options to use with the layer (see IEffectLayerOptions for more information)\r\n */\r\n protected _init(options: Partial<IEffectLayerOptions>): void {\r\n // Adapt options\r\n this._effectLayerOptions = {\r\n mainTextureRatio: 0.5,\r\n alphaBlendingMode: Constants.ALPHA_COMBINE,\r\n camera: null,\r\n renderingGroupId: -1,\r\n mainTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n generateStencilBuffer: false,\r\n ...options,\r\n };\r\n\r\n this._setMainTextureSize();\r\n this._thinEffectLayer._init(options);\r\n this._createMainTexture();\r\n this._createTextureAndPostProcesses();\r\n }\r\n\r\n /**\r\n * Sets the main texture desired size which is the closest power of two\r\n * of the engine canvas size.\r\n */\r\n private _setMainTextureSize(): void {\r\n if (this._effectLayerOptions.mainTextureFixedSize) {\r\n this._mainTextureDesiredSize.width = this._effectLayerOptions.mainTextureFixedSize;\r\n this._mainTextureDesiredSize.height = this._effectLayerOptions.mainTextureFixedSize;\r\n } else {\r\n this._mainTextureDesiredSize.width = this._engine.getRenderWidth() * this._effectLayerOptions.mainTextureRatio;\r\n this._mainTextureDesiredSize.height = this._engine.getRenderHeight() * this._effectLayerOptions.mainTextureRatio;\r\n\r\n this._mainTextureDesiredSize.width = this._engine.needPOTTextures\r\n ? GetExponentOfTwo(this._mainTextureDesiredSize.width, this._maxSize)\r\n : this._mainTextureDesiredSize.width;\r\n this._mainTextureDesiredSize.height = this._engine.needPOTTextures\r\n ? GetExponentOfTwo(this._mainTextureDesiredSize.height, this._maxSize)\r\n : this._mainTextureDesiredSize.height;\r\n }\r\n\r\n this._mainTextureDesiredSize.width = Math.floor(this._mainTextureDesiredSize.width);\r\n this._mainTextureDesiredSize.height = Math.floor(this._mainTextureDesiredSize.height);\r\n }\r\n\r\n /**\r\n * Creates the main texture for the effect layer.\r\n */\r\n protected _createMainTexture(): void {\r\n this._mainTexture = new RenderTargetTexture(\r\n \"EffectLayerMainRTT\",\r\n {\r\n width: this._mainTextureDesiredSize.width,\r\n height: this._mainTextureDesiredSize.height,\r\n },\r\n this._scene,\r\n {\r\n type: this._effectLayerOptions.mainTextureType,\r\n samplingMode: Texture.TRILINEAR_SAMPLINGMODE,\r\n generateStencilBuffer: this._effectLayerOptions.generateStencilBuffer,\r\n existingObjectRenderer: this._thinEffectLayer.objectRenderer,\r\n }\r\n );\r\n this._mainTexture.activeCamera = this._effectLayerOptions.camera;\r\n this._mainTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._mainTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._mainTexture.anisotropicFilteringLevel = 1;\r\n this._mainTexture.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\r\n this._mainTexture.renderParticles = false;\r\n this._mainTexture.renderList = null;\r\n this._mainTexture.ignoreCameraViewport = true;\r\n\r\n this._mainTexture.onClearObservable.add((engine: AbstractEngine) => {\r\n engine.clear(this.neutralColor, true, true, true);\r\n });\r\n }\r\n\r\n /**\r\n * Adds specific effects defines.\r\n * @param defines The defines to add specifics to.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _addCustomEffectDefines(defines: string[]): void {\r\n // Nothing to add by default.\r\n }\r\n\r\n /**\r\n * Checks for the readiness of the element composing the layer.\r\n * @param subMesh the mesh to check for\r\n * @param useInstances specify whether or not to use instances to render the mesh\r\n * @param emissiveTexture the associated emissive texture used to generate the glow\r\n * @returns true if ready otherwise, false\r\n */\r\n protected _isReady(subMesh: SubMesh, useInstances: boolean, emissiveTexture: Nullable<BaseTexture>): boolean {\r\n return this._internalThinEffectLayer\r\n ? this._thinEffectLayer._internalIsSubMeshReady(subMesh, useInstances, emissiveTexture)\r\n : this._thinEffectLayer._isSubMeshReady(subMesh, useInstances, emissiveTexture);\r\n }\r\n\r\n protected async _importShadersAsync(): Promise<void> {}\r\n\r\n protected _arePostProcessAndMergeReady(): boolean {\r\n return this._internalThinEffectLayer ? this._thinEffectLayer._internalIsLayerReady() : this._thinEffectLayer.isLayerReady();\r\n }\r\n\r\n /**\r\n * Checks if the layer is ready to be used.\r\n * @returns true if the layer is ready to be used\r\n */\r\n public isLayerReady(): boolean {\r\n return this._arePostProcessAndMergeReady() && this._mainTexture.isReady();\r\n }\r\n\r\n /**\r\n * Renders the glowing part of the scene by blending the blurred glowing meshes on top of the rendered scene.\r\n */\r\n public render(): void {\r\n if (!this._thinEffectLayer.compose()) {\r\n return;\r\n }\r\n\r\n // Handle size changes.\r\n this._setMainTextureSize();\r\n if (\r\n (this._mainTextureCreatedSize.width !== this._mainTextureDesiredSize.width || this._mainTextureCreatedSize.height !== this._mainTextureDesiredSize.height) &&\r\n this._mainTextureDesiredSize.width !== 0 &&\r\n this._mainTextureDesiredSize.height !== 0\r\n ) {\r\n // Recreate RTT and post processes on size change.\r\n this.onSizeChangedObservable.notifyObservers(this);\r\n this._disposeTextureAndPostProcesses();\r\n this._createMainTexture();\r\n this._createTextureAndPostProcesses();\r\n this._mainTextureCreatedSize.width = this._mainTextureDesiredSize.width;\r\n this._mainTextureCreatedSize.height = this._mainTextureDesiredSize.height;\r\n }\r\n }\r\n\r\n /**\r\n * Determine if a given mesh will be used in the current effect.\r\n * @param mesh mesh to test\r\n * @returns true if the mesh will be used\r\n */\r\n public hasMesh(mesh: AbstractMesh): boolean {\r\n return this._internalThinEffectLayer ? this._thinEffectLayer._internalHasMesh(mesh) : this._thinEffectLayer.hasMesh(mesh);\r\n }\r\n\r\n /**\r\n * Returns true if the layer contains information to display, otherwise false.\r\n * @returns true if the glow layer should be rendered\r\n */\r\n public shouldRender(): boolean {\r\n return this._internalThinEffectLayer ? this._thinEffectLayer._internalShouldRender() : 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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _shouldRenderMesh(mesh: AbstractMesh): boolean {\r\n return this._internalThinEffectLayer ? true : 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 _canRenderMesh(mesh: AbstractMesh, material: Material): boolean {\r\n return this._internalThinEffectLayer ? this._thinEffectLayer._internalCanRenderMesh(mesh, material) : this._thinEffectLayer._canRenderMesh(mesh, material);\r\n }\r\n\r\n /**\r\n * Returns true if the mesh should render, otherwise false.\r\n * @returns true if it should render otherwise false\r\n */\r\n protected _shouldRenderEmissiveTextureForMesh(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Defines whether the current material of the mesh should be use to render the effect.\r\n * @param mesh defines the current mesh to render\r\n * @returns true if the mesh material should be use\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _useMeshMaterial(mesh: AbstractMesh): boolean {\r\n return this._internalThinEffectLayer ? false : this._thinEffectLayer._useMeshMaterial(mesh);\r\n }\r\n\r\n /**\r\n * Rebuild the required buffers.\r\n * @internal Internal use only.\r\n */\r\n public _rebuild(): void {\r\n this._thinEffectLayer._rebuild();\r\n }\r\n\r\n /**\r\n * Dispose only the render target textures and post process.\r\n */\r\n private _disposeTextureAndPostProcesses(): void {\r\n this._mainTexture.dispose();\r\n\r\n for (let i = 0; i < this._postProcesses.length; i++) {\r\n if (this._postProcesses[i]) {\r\n this._postProcesses[i].dispose();\r\n }\r\n }\r\n this._postProcesses = [];\r\n\r\n for (let i = 0; i < this._textures.length; i++) {\r\n if (this._textures[i]) {\r\n this._textures[i].dispose();\r\n }\r\n }\r\n this._textures = [];\r\n }\r\n\r\n /**\r\n * Dispose the highlight layer and free resources.\r\n */\r\n public dispose(): void {\r\n this._thinEffectLayer.dispose();\r\n\r\n // Clean textures and post processes\r\n this._disposeTextureAndPostProcesses();\r\n\r\n // Remove from scene\r\n this._scene.removeEffectLayer(this);\r\n\r\n // Callback\r\n this.onDisposeObservable.clear();\r\n this.onBeforeRenderMainTextureObservable.clear();\r\n this.onBeforeComposeObservable.clear();\r\n this.onBeforeRenderMeshToEffect.clear();\r\n this.onAfterRenderMeshToEffect.clear();\r\n this.onAfterComposeObservable.clear();\r\n this.onSizeChangedObservable.clear();\r\n }\r\n\r\n /**\r\n * Gets the class name of the effect layer\r\n * @returns the string with the class name of the effect layer\r\n */\r\n public getClassName(): string {\r\n return \"EffectLayer\";\r\n }\r\n\r\n /**\r\n * Creates an effect layer from parsed effect layer data\r\n * @param parsedEffectLayer defines effect layer data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing the effect layer information\r\n * @returns a parsed effect Layer\r\n */\r\n public static Parse(parsedEffectLayer: any, scene: Scene, rootUrl: string): EffectLayer {\r\n const effectLayerType = Tools.Instantiate(parsedEffectLayer.customType);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\r\n return effectLayerType.Parse(parsedEffectLayer, scene, rootUrl);\r\n }\r\n}\r\n"]}
@@ -226,6 +226,8 @@ export class GlowLayer extends EffectLayer {
226
226
  this._postProcesses.map((pp) => {
227
227
  pp.autoClear = false;
228
228
  });
229
+ this._mainTextureCreatedSize.width = this._mainTextureDesiredSize.width;
230
+ this._mainTextureCreatedSize.height = this._mainTextureDesiredSize.height;
229
231
  }
230
232
  /**
231
233
  * Checks for the readiness of the element composing the layer.
@@ -1 +1 @@
1
- {"version":3,"file":"glowLayer.js","sourceRoot":"","sources":["../../../../dev/core/src/Layers/glowLayer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAIhF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAehD,KAAK,CAAC,SAAS,CAAC,kBAAkB,GAAG,UAAU,IAAY;IACvD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QAC7D,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,KAAK,SAAS,CAAC,UAAU,EAAE,CAAC;YAC9G,OAAa,IAAI,CAAC,YAAY,CAAC,KAAK,CAAe,CAAC;QACxD,C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typescript-eslint/no-unused-vars */\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\nimport { Scene } from \"../scene\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Material } from \"../Materials/material\";\r\nimport type { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport { BlurPostProcess } from \"../PostProcesses/blurPostProcess\";\r\nimport type { IThinGlowLayerOptions } from \"./thinGlowLayer\";\r\nimport { EffectLayer } from \"./effectLayer\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { Color4 } from \"core/Maths/math.color\";\r\n\r\nimport \"../Layers/effectLayerSceneComponent\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\nimport { GetExponentOfTwo } from \"../Misc/tools.functions\";\r\nimport { ThinGlowLayer } from \"./thinGlowLayer\";\r\nimport type { ThinBlurPostProcess } from \"core/PostProcesses/thinBlurPostProcess\";\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 the first glow layer of the scene with a given name.\r\n * @param name The name of the glow layer to look for.\r\n * @returns The glow layer if found otherwise null.\r\n */\r\n getGlowLayerByName(name: string): Nullable<GlowLayer>;\r\n }\r\n}\r\n\r\nScene.prototype.getGlowLayerByName = function (name: string): Nullable<GlowLayer> {\r\n for (let index = 0; index < this.effectLayers?.length; index++) {\r\n if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === GlowLayer.EffectName) {\r\n return (<any>this.effectLayers[index]) as GlowLayer;\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Glow layer options. This helps customizing the behaviour\r\n * of the glow layer.\r\n */\r\nexport interface IGlowLayerOptions extends IThinGlowLayerOptions {\r\n /**\r\n * Enable MSAA by choosing the number of samples. Default: 1\r\n */\r\n mainTextureSamples?: number;\r\n\r\n /**\r\n * Whether or not to generate a stencil buffer. Default: false\r\n */\r\n generateStencilBuffer?: boolean;\r\n}\r\n\r\n/**\r\n * The glow layer Helps adding a glow effect around the emissive parts of a mesh.\r\n *\r\n * Once instantiated in a scene, by default, all the emissive meshes will glow.\r\n *\r\n * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/mesh/glowLayer\r\n */\r\nexport class GlowLayer extends EffectLayer {\r\n /**\r\n * Effect Name of the layer.\r\n */\r\n public static get EffectName() {\r\n return ThinGlowLayer.EffectName;\r\n }\r\n\r\n /**\r\n * The default blur kernel size used for the glow.\r\n */\r\n public static DefaultBlurKernelSize = 32;\r\n\r\n /**\r\n * The default texture size ratio used for the glow.\r\n */\r\n public static DefaultTextureRatio = 0.5;\r\n\r\n /**\r\n * Sets the kernel size of the blur.\r\n */\r\n public set blurKernelSize(value: number) {\r\n this._thinEffectLayer.blurKernelSize = value;\r\n }\r\n\r\n /**\r\n * Gets the kernel size of the blur.\r\n */\r\n @serialize()\r\n public get blurKernelSize(): number {\r\n return this._thinEffectLayer.blurKernelSize;\r\n }\r\n\r\n /**\r\n * Sets the glow intensity.\r\n */\r\n public set intensity(value: number) {\r\n this._thinEffectLayer.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the glow intensity.\r\n */\r\n @serialize()\r\n public get intensity(): number {\r\n return this._thinEffectLayer.intensity;\r\n }\r\n\r\n @serialize(\"options\")\r\n protected _options: IGlowLayerOptions;\r\n\r\n protected override readonly _thinEffectLayer: ThinGlowLayer;\r\n private _horizontalBlurPostprocess1: BlurPostProcess;\r\n private _verticalBlurPostprocess1: BlurPostProcess;\r\n private _horizontalBlurPostprocess2: BlurPostProcess;\r\n private _verticalBlurPostprocess2: BlurPostProcess;\r\n private _blurTexture1: RenderTargetTexture;\r\n private _blurTexture2: RenderTargetTexture;\r\n private _postProcesses1: PostProcess[];\r\n private _postProcesses2: PostProcess[];\r\n /**\r\n * Callback used to let the user override the color selection on a per mesh basis\r\n */\r\n public get customEmissiveColorSelector(): (mesh: Mesh, subMesh: SubMesh, material: Material, result: Color4) => void {\r\n return this._thinEffectLayer.customEmissiveColorSelector;\r\n }\r\n\r\n public set customEmissiveColorSelector(value: (mesh: Mesh, subMesh: SubMesh, material: Material, result: Color4) => void) {\r\n this._thinEffectLayer.customEmissiveColorSelector = value;\r\n }\r\n\r\n /**\r\n * Callback used to let the user override the texture selection on a per mesh basis\r\n */\r\n public get customEmissiveTextureSelector(): (mesh: Mesh, subMesh: SubMesh, material: Material) => Texture {\r\n return this._thinEffectLayer.customEmissiveTextureSelector;\r\n }\r\n\r\n public set customEmissiveTextureSelector(value: (mesh: Mesh, subMesh: SubMesh, material: Material) => Texture) {\r\n this._thinEffectLayer.customEmissiveTextureSelector = value;\r\n }\r\n\r\n /**\r\n * Instantiates a new glow 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 IGlowLayerOptions for more information)\r\n */\r\n constructor(name: string, scene?: Scene, options?: Partial<IGlowLayerOptions>) {\r\n super(name, scene, false, new ThinGlowLayer(name, scene, options));\r\n\r\n // Adapt options\r\n this._options = {\r\n mainTextureRatio: GlowLayer.DefaultTextureRatio,\r\n blurKernelSize: 32,\r\n mainTextureFixedSize: undefined,\r\n camera: null,\r\n mainTextureSamples: 1,\r\n renderingGroupId: -1,\r\n ldrMerge: false,\r\n alphaBlendingMode: Constants.ALPHA_ADD,\r\n mainTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n generateStencilBuffer: false,\r\n ...options,\r\n };\r\n\r\n // Initialize the layer\r\n this._init(this._options);\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 GlowLayer.EffectName;\r\n }\r\n\r\n /**\r\n * @internal\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 */\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 glow layer.\r\n */\r\n protected _createTextureAndPostProcesses(): void {\r\n this._thinEffectLayer._renderPassId = this._mainTexture.renderPassId;\r\n\r\n let blurTextureWidth = this._mainTextureDesiredSize.width;\r\n let blurTextureHeight = this._mainTextureDesiredSize.height;\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._blurTexture1 = new RenderTargetTexture(\r\n \"GlowLayerBlurRTT\",\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._blurTexture1.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture1.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture1.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\r\n this._blurTexture1.renderParticles = false;\r\n this._blurTexture1.ignoreCameraViewport = true;\r\n\r\n const blurTextureWidth2 = Math.floor(blurTextureWidth / 2);\r\n const blurTextureHeight2 = Math.floor(blurTextureHeight / 2);\r\n\r\n this._blurTexture2 = new RenderTargetTexture(\r\n \"GlowLayerBlurRTT2\",\r\n {\r\n width: blurTextureWidth2,\r\n height: blurTextureHeight2,\r\n },\r\n this._scene,\r\n false,\r\n true,\r\n textureType\r\n );\r\n this._blurTexture2.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture2.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture2.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\r\n this._blurTexture2.renderParticles = false;\r\n this._blurTexture2.ignoreCameraViewport = true;\r\n\r\n this._textures = [this._blurTexture1, this._blurTexture2];\r\n\r\n this._thinEffectLayer.bindTexturesForCompose = (effect: Effect) => {\r\n effect.setTexture(\"textureSampler\", this._blurTexture1);\r\n effect.setTexture(\"textureSampler2\", this._blurTexture2);\r\n effect.setFloat(\"offset\", this.intensity);\r\n };\r\n\r\n this._thinEffectLayer._createTextureAndPostProcesses();\r\n\r\n const thinBlurPostProcesses1 = this._thinEffectLayer._postProcesses[0] as ThinBlurPostProcess;\r\n this._horizontalBlurPostprocess1 = new BlurPostProcess(\"GlowLayerHBP1\", thinBlurPostProcesses1.direction, thinBlurPostProcesses1.kernel, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n textureType,\r\n effectWrapper: thinBlurPostProcesses1,\r\n });\r\n this._horizontalBlurPostprocess1.width = blurTextureWidth;\r\n this._horizontalBlurPostprocess1.height = blurTextureHeight;\r\n this._horizontalBlurPostprocess1.externalTextureSamplerBinding = true;\r\n this._horizontalBlurPostprocess1.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._mainTexture);\r\n });\r\n\r\n const thinBlurPostProcesses2 = this._thinEffectLayer._postProcesses[1] as ThinBlurPostProcess;\r\n this._verticalBlurPostprocess1 = new BlurPostProcess(\"GlowLayerVBP1\", thinBlurPostProcesses2.direction, thinBlurPostProcesses2.kernel, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n textureType,\r\n effectWrapper: thinBlurPostProcesses2,\r\n });\r\n\r\n const thinBlurPostProcesses3 = this._thinEffectLayer._postProcesses[2] as ThinBlurPostProcess;\r\n this._horizontalBlurPostprocess2 = new BlurPostProcess(\"GlowLayerHBP2\", thinBlurPostProcesses3.direction, thinBlurPostProcesses3.kernel, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n width: blurTextureWidth2,\r\n height: blurTextureHeight2,\r\n textureType,\r\n effectWrapper: thinBlurPostProcesses3,\r\n });\r\n this._horizontalBlurPostprocess2.width = blurTextureWidth2;\r\n this._horizontalBlurPostprocess2.height = blurTextureHeight2;\r\n this._horizontalBlurPostprocess2.externalTextureSamplerBinding = true;\r\n this._horizontalBlurPostprocess2.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._blurTexture1);\r\n });\r\n\r\n const thinBlurPostProcesses4 = this._thinEffectLayer._postProcesses[3] as ThinBlurPostProcess;\r\n this._verticalBlurPostprocess2 = new BlurPostProcess(\"GlowLayerVBP2\", thinBlurPostProcesses4.direction, thinBlurPostProcesses4.kernel, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n width: blurTextureWidth2,\r\n height: blurTextureHeight2,\r\n textureType,\r\n effectWrapper: thinBlurPostProcesses4,\r\n });\r\n\r\n this._postProcesses = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1, this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2];\r\n this._postProcesses1 = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1];\r\n this._postProcesses2 = [this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2];\r\n\r\n this._mainTexture.samples = this._options.mainTextureSamples!;\r\n this._mainTexture.onAfterUnbindObservable.add(() => {\r\n const internalTexture = this._blurTexture1.renderTarget;\r\n if (internalTexture) {\r\n this._scene.postProcessManager.directRender(this._postProcesses1, internalTexture, true);\r\n\r\n const internalTexture2 = this._blurTexture2.renderTarget;\r\n if (internalTexture2) {\r\n this._scene.postProcessManager.directRender(this._postProcesses2, internalTexture2, true);\r\n }\r\n this._engine.unBindFramebuffer(internalTexture2 ?? internalTexture, true);\r\n }\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\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 * @returns whether or not the layer needs stencil enabled during the mesh rendering.\r\n */\r\n public needStencil(): boolean {\r\n return false;\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 * Implementation specific of rendering the generating effect on the main canvas.\r\n * @param effect The effect used to render through\r\n */\r\n protected _internalRender(effect: Effect): void {\r\n this._thinEffectLayer._internalCompose(effect);\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 * 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 * 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 * Add a mesh in the exclusion list to prevent it to impact or being impacted by the glow layer.\r\n * @param mesh The mesh to exclude from the glow layer\r\n */\r\n public addExcludedMesh(mesh: Mesh): void {\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 glow layer.\r\n * @param mesh The mesh to remove\r\n */\r\n public removeExcludedMesh(mesh: Mesh): void {\r\n this._thinEffectLayer.removeExcludedMesh(mesh);\r\n }\r\n\r\n /**\r\n * Add a mesh in the inclusion list to impact or being impacted by the glow layer.\r\n * @param mesh The mesh to include in the glow layer\r\n */\r\n public addIncludedOnlyMesh(mesh: Mesh): void {\r\n this._thinEffectLayer.addIncludedOnlyMesh(mesh);\r\n }\r\n\r\n /**\r\n * Remove a mesh from the Inclusion list to prevent it to impact or being impacted by the glow layer.\r\n * @param mesh The mesh to remove\r\n */\r\n public removeIncludedOnlyMesh(mesh: Mesh): void {\r\n this._thinEffectLayer.removeIncludedOnlyMesh(mesh);\r\n }\r\n\r\n /**\r\n * Determine if a given mesh will be used in the glow layer\r\n * @param mesh The mesh to test\r\n * @returns true if the mesh will be highlighted by the current glow layer\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 * Defines whether the current material of the mesh should be use to render the effect.\r\n * @param mesh defines the current mesh to render\r\n * @returns true if the material of the mesh should be use to render the effect\r\n */\r\n protected override _useMeshMaterial(mesh: AbstractMesh): boolean {\r\n return this._thinEffectLayer._useMeshMaterial(mesh);\r\n }\r\n\r\n /**\r\n * Add a mesh to be rendered through its own material and not with emissive only.\r\n * @param mesh The mesh for which we need to use its material\r\n */\r\n public referenceMeshToUseItsOwnMaterial(mesh: AbstractMesh): void {\r\n this._thinEffectLayer.referenceMeshToUseItsOwnMaterial(mesh);\r\n }\r\n\r\n /**\r\n * Remove a mesh from being rendered through its own material and not with emissive only.\r\n * @param mesh The mesh for which we need to not use its material\r\n */\r\n public unReferenceMeshFromUsingItsOwnMaterial(mesh: AbstractMesh): void {\r\n this._thinEffectLayer.unReferenceMeshFromUsingItsOwnMaterial(mesh, this._mainTexture.renderPassId);\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 \"GlowLayer\";\r\n }\r\n\r\n /**\r\n * Serializes this glow layer\r\n * @returns a serialized glow layer object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.GlowLayer\";\r\n\r\n let index;\r\n\r\n // Included meshes\r\n serializationObject.includedMeshes = [];\r\n\r\n const includedOnlyMeshes = this._thinEffectLayer._includedOnlyMeshes;\r\n if (includedOnlyMeshes.length) {\r\n for (index = 0; index < includedOnlyMeshes.length; index++) {\r\n const mesh = this._scene.getMeshByUniqueId(includedOnlyMeshes[index]);\r\n if (mesh) {\r\n serializationObject.includedMeshes.push(mesh.id);\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.length) {\r\n for (index = 0; index < excludedMeshes.length; index++) {\r\n const mesh = this._scene.getMeshByUniqueId(excludedMeshes[index]);\r\n if (mesh) {\r\n serializationObject.excludedMeshes.push(mesh.id);\r\n }\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Glow Layer from parsed glow layer data\r\n * @param parsedGlowLayer defines glow layer data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing the glow layer information\r\n * @returns a parsed Glow Layer\r\n */\r\n public static override Parse(parsedGlowLayer: any, scene: Scene, rootUrl: string): GlowLayer {\r\n const gl = SerializationHelper.Parse(() => new GlowLayer(parsedGlowLayer.name, scene, parsedGlowLayer.options), parsedGlowLayer, scene, rootUrl);\r\n let index;\r\n\r\n // Excluded meshes\r\n for (index = 0; index < parsedGlowLayer.excludedMeshes.length; index++) {\r\n const mesh = scene.getMeshById(parsedGlowLayer.excludedMeshes[index]);\r\n if (mesh) {\r\n gl.addExcludedMesh(<Mesh>mesh);\r\n }\r\n }\r\n\r\n // Included meshes\r\n for (index = 0; index < parsedGlowLayer.includedMeshes.length; index++) {\r\n const mesh = scene.getMeshById(parsedGlowLayer.includedMeshes[index]);\r\n if (mesh) {\r\n gl.addIncludedOnlyMesh(<Mesh>mesh);\r\n }\r\n }\r\n\r\n return gl;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GlowLayer\", GlowLayer);\r\n"]}
1
+ {"version":3,"file":"glowLayer.js","sourceRoot":"","sources":["../../../../dev/core/src/Layers/glowLayer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAIjC,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAIhF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,M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gBACP,EAAE,CAAC,eAAe,CAAO,IAAI,CAAC,CAAC;YACnC,CAAC;QACL,CAAC;QAED,kBAAkB;QAClB,KAAK,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,eAAe,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;YACrE,MAAM,IAAI,GAAG,KAAK,CAAC,WAAW,CAAC,eAAe,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;YACtE,IAAI,IAAI,EAAE,CAAC;gBACP,EAAE,CAAC,mBAAmB,CAAO,IAAI,CAAC,CAAC;YACvC,CAAC;QACL,CAAC;QAED,OAAO,EAAE,CAAC;IACd,CAAC;;AA5dD;;GAEG;AACW,+BAAqB,GAAG,EAAE,CAAC;AAEzC;;GAEG;AACW,6BAAmB,GAAG,GAAG,CAAC;AAaxC;IADC,SAAS,EAAE;+CAGX;AAaD;IADC,SAAS,EAAE;0CAGX;AAGS;IADT,SAAS,CAAC,SAAS,CAAC;2CACiB;AAsb1C,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\nimport { Scene } from \"../scene\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport type { Material } from \"../Materials/material\";\r\nimport type { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport { BlurPostProcess } from \"../PostProcesses/blurPostProcess\";\r\nimport type { IThinGlowLayerOptions } from \"./thinGlowLayer\";\r\nimport { EffectLayer } from \"./effectLayer\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { Color4 } from \"core/Maths/math.color\";\r\n\r\nimport \"../Layers/effectLayerSceneComponent\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\nimport { GetExponentOfTwo } from \"../Misc/tools.functions\";\r\nimport { ThinGlowLayer } from \"./thinGlowLayer\";\r\nimport type { ThinBlurPostProcess } from \"core/PostProcesses/thinBlurPostProcess\";\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 the first glow layer of the scene with a given name.\r\n * @param name The name of the glow layer to look for.\r\n * @returns The glow layer if found otherwise null.\r\n */\r\n getGlowLayerByName(name: string): Nullable<GlowLayer>;\r\n }\r\n}\r\n\r\nScene.prototype.getGlowLayerByName = function (name: string): Nullable<GlowLayer> {\r\n for (let index = 0; index < this.effectLayers?.length; index++) {\r\n if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === GlowLayer.EffectName) {\r\n return (<any>this.effectLayers[index]) as GlowLayer;\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Glow layer options. This helps customizing the behaviour\r\n * of the glow layer.\r\n */\r\nexport interface IGlowLayerOptions extends IThinGlowLayerOptions {\r\n /**\r\n * Enable MSAA by choosing the number of samples. Default: 1\r\n */\r\n mainTextureSamples?: number;\r\n\r\n /**\r\n * Whether or not to generate a stencil buffer. Default: false\r\n */\r\n generateStencilBuffer?: boolean;\r\n}\r\n\r\n/**\r\n * The glow layer Helps adding a glow effect around the emissive parts of a mesh.\r\n *\r\n * Once instantiated in a scene, by default, all the emissive meshes will glow.\r\n *\r\n * Documentation: https://doc.babylonjs.com/features/featuresDeepDive/mesh/glowLayer\r\n */\r\nexport class GlowLayer extends EffectLayer {\r\n /**\r\n * Effect Name of the layer.\r\n */\r\n public static get EffectName() {\r\n return ThinGlowLayer.EffectName;\r\n }\r\n\r\n /**\r\n * The default blur kernel size used for the glow.\r\n */\r\n public static DefaultBlurKernelSize = 32;\r\n\r\n /**\r\n * The default texture size ratio used for the glow.\r\n */\r\n public static DefaultTextureRatio = 0.5;\r\n\r\n /**\r\n * Sets the kernel size of the blur.\r\n */\r\n public set blurKernelSize(value: number) {\r\n this._thinEffectLayer.blurKernelSize = value;\r\n }\r\n\r\n /**\r\n * Gets the kernel size of the blur.\r\n */\r\n @serialize()\r\n public get blurKernelSize(): number {\r\n return this._thinEffectLayer.blurKernelSize;\r\n }\r\n\r\n /**\r\n * Sets the glow intensity.\r\n */\r\n public set intensity(value: number) {\r\n this._thinEffectLayer.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the glow intensity.\r\n */\r\n @serialize()\r\n public get intensity(): number {\r\n return this._thinEffectLayer.intensity;\r\n }\r\n\r\n @serialize(\"options\")\r\n protected _options: IGlowLayerOptions;\r\n\r\n protected override readonly _thinEffectLayer: ThinGlowLayer;\r\n private _horizontalBlurPostprocess1: BlurPostProcess;\r\n private _verticalBlurPostprocess1: BlurPostProcess;\r\n private _horizontalBlurPostprocess2: BlurPostProcess;\r\n private _verticalBlurPostprocess2: BlurPostProcess;\r\n private _blurTexture1: RenderTargetTexture;\r\n private _blurTexture2: RenderTargetTexture;\r\n private _postProcesses1: PostProcess[];\r\n private _postProcesses2: PostProcess[];\r\n /**\r\n * Callback used to let the user override the color selection on a per mesh basis\r\n */\r\n public get customEmissiveColorSelector(): (mesh: Mesh, subMesh: SubMesh, material: Material, result: Color4) => void {\r\n return this._thinEffectLayer.customEmissiveColorSelector;\r\n }\r\n\r\n public set customEmissiveColorSelector(value: (mesh: Mesh, subMesh: SubMesh, material: Material, result: Color4) => void) {\r\n this._thinEffectLayer.customEmissiveColorSelector = value;\r\n }\r\n\r\n /**\r\n * Callback used to let the user override the texture selection on a per mesh basis\r\n */\r\n public get customEmissiveTextureSelector(): (mesh: Mesh, subMesh: SubMesh, material: Material) => Texture {\r\n return this._thinEffectLayer.customEmissiveTextureSelector;\r\n }\r\n\r\n public set customEmissiveTextureSelector(value: (mesh: Mesh, subMesh: SubMesh, material: Material) => Texture) {\r\n this._thinEffectLayer.customEmissiveTextureSelector = value;\r\n }\r\n\r\n /**\r\n * Instantiates a new glow 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 IGlowLayerOptions for more information)\r\n */\r\n constructor(name: string, scene?: Scene, options?: Partial<IGlowLayerOptions>) {\r\n super(name, scene, false, new ThinGlowLayer(name, scene, options));\r\n\r\n // Adapt options\r\n this._options = {\r\n mainTextureRatio: GlowLayer.DefaultTextureRatio,\r\n blurKernelSize: 32,\r\n mainTextureFixedSize: undefined,\r\n camera: null,\r\n mainTextureSamples: 1,\r\n renderingGroupId: -1,\r\n ldrMerge: false,\r\n alphaBlendingMode: Constants.ALPHA_ADD,\r\n mainTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n generateStencilBuffer: false,\r\n ...options,\r\n };\r\n\r\n // Initialize the layer\r\n this._init(this._options);\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 GlowLayer.EffectName;\r\n }\r\n\r\n /**\r\n * @internal\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 */\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 glow layer.\r\n */\r\n protected _createTextureAndPostProcesses(): void {\r\n this._thinEffectLayer._renderPassId = this._mainTexture.renderPassId;\r\n\r\n let blurTextureWidth = this._mainTextureDesiredSize.width;\r\n let blurTextureHeight = this._mainTextureDesiredSize.height;\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._blurTexture1 = new RenderTargetTexture(\r\n \"GlowLayerBlurRTT\",\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._blurTexture1.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture1.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture1.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\r\n this._blurTexture1.renderParticles = false;\r\n this._blurTexture1.ignoreCameraViewport = true;\r\n\r\n const blurTextureWidth2 = Math.floor(blurTextureWidth / 2);\r\n const blurTextureHeight2 = Math.floor(blurTextureHeight / 2);\r\n\r\n this._blurTexture2 = new RenderTargetTexture(\r\n \"GlowLayerBlurRTT2\",\r\n {\r\n width: blurTextureWidth2,\r\n height: blurTextureHeight2,\r\n },\r\n this._scene,\r\n false,\r\n true,\r\n textureType\r\n );\r\n this._blurTexture2.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture2.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture2.updateSamplingMode(Texture.BILINEAR_SAMPLINGMODE);\r\n this._blurTexture2.renderParticles = false;\r\n this._blurTexture2.ignoreCameraViewport = true;\r\n\r\n this._textures = [this._blurTexture1, this._blurTexture2];\r\n\r\n this._thinEffectLayer.bindTexturesForCompose = (effect: Effect) => {\r\n effect.setTexture(\"textureSampler\", this._blurTexture1);\r\n effect.setTexture(\"textureSampler2\", this._blurTexture2);\r\n effect.setFloat(\"offset\", this.intensity);\r\n };\r\n\r\n this._thinEffectLayer._createTextureAndPostProcesses();\r\n\r\n const thinBlurPostProcesses1 = this._thinEffectLayer._postProcesses[0] as ThinBlurPostProcess;\r\n this._horizontalBlurPostprocess1 = new BlurPostProcess(\"GlowLayerHBP1\", thinBlurPostProcesses1.direction, thinBlurPostProcesses1.kernel, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n textureType,\r\n effectWrapper: thinBlurPostProcesses1,\r\n });\r\n this._horizontalBlurPostprocess1.width = blurTextureWidth;\r\n this._horizontalBlurPostprocess1.height = blurTextureHeight;\r\n this._horizontalBlurPostprocess1.externalTextureSamplerBinding = true;\r\n this._horizontalBlurPostprocess1.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._mainTexture);\r\n });\r\n\r\n const thinBlurPostProcesses2 = this._thinEffectLayer._postProcesses[1] as ThinBlurPostProcess;\r\n this._verticalBlurPostprocess1 = new BlurPostProcess(\"GlowLayerVBP1\", thinBlurPostProcesses2.direction, thinBlurPostProcesses2.kernel, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n textureType,\r\n effectWrapper: thinBlurPostProcesses2,\r\n });\r\n\r\n const thinBlurPostProcesses3 = this._thinEffectLayer._postProcesses[2] as ThinBlurPostProcess;\r\n this._horizontalBlurPostprocess2 = new BlurPostProcess(\"GlowLayerHBP2\", thinBlurPostProcesses3.direction, thinBlurPostProcesses3.kernel, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n width: blurTextureWidth2,\r\n height: blurTextureHeight2,\r\n textureType,\r\n effectWrapper: thinBlurPostProcesses3,\r\n });\r\n this._horizontalBlurPostprocess2.width = blurTextureWidth2;\r\n this._horizontalBlurPostprocess2.height = blurTextureHeight2;\r\n this._horizontalBlurPostprocess2.externalTextureSamplerBinding = true;\r\n this._horizontalBlurPostprocess2.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._blurTexture1);\r\n });\r\n\r\n const thinBlurPostProcesses4 = this._thinEffectLayer._postProcesses[3] as ThinBlurPostProcess;\r\n this._verticalBlurPostprocess2 = new BlurPostProcess(\"GlowLayerVBP2\", thinBlurPostProcesses4.direction, thinBlurPostProcesses4.kernel, {\r\n samplingMode: Texture.BILINEAR_SAMPLINGMODE,\r\n engine: this._scene.getEngine(),\r\n width: blurTextureWidth2,\r\n height: blurTextureHeight2,\r\n textureType,\r\n effectWrapper: thinBlurPostProcesses4,\r\n });\r\n\r\n this._postProcesses = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1, this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2];\r\n this._postProcesses1 = [this._horizontalBlurPostprocess1, this._verticalBlurPostprocess1];\r\n this._postProcesses2 = [this._horizontalBlurPostprocess2, this._verticalBlurPostprocess2];\r\n\r\n this._mainTexture.samples = this._options.mainTextureSamples!;\r\n this._mainTexture.onAfterUnbindObservable.add(() => {\r\n const internalTexture = this._blurTexture1.renderTarget;\r\n if (internalTexture) {\r\n this._scene.postProcessManager.directRender(this._postProcesses1, internalTexture, true);\r\n\r\n const internalTexture2 = this._blurTexture2.renderTarget;\r\n if (internalTexture2) {\r\n this._scene.postProcessManager.directRender(this._postProcesses2, internalTexture2, true);\r\n }\r\n this._engine.unBindFramebuffer(internalTexture2 ?? internalTexture, true);\r\n }\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 * 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 * @returns whether or not the layer needs stencil enabled during the mesh rendering.\r\n */\r\n public needStencil(): boolean {\r\n return false;\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 * Implementation specific of rendering the generating effect on the main canvas.\r\n * @param effect The effect used to render through\r\n */\r\n protected _internalRender(effect: Effect): void {\r\n this._thinEffectLayer._internalCompose(effect);\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 * 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 * 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 * Add a mesh in the exclusion list to prevent it to impact or being impacted by the glow layer.\r\n * @param mesh The mesh to exclude from the glow layer\r\n */\r\n public addExcludedMesh(mesh: Mesh): void {\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 glow layer.\r\n * @param mesh The mesh to remove\r\n */\r\n public removeExcludedMesh(mesh: Mesh): void {\r\n this._thinEffectLayer.removeExcludedMesh(mesh);\r\n }\r\n\r\n /**\r\n * Add a mesh in the inclusion list to impact or being impacted by the glow layer.\r\n * @param mesh The mesh to include in the glow layer\r\n */\r\n public addIncludedOnlyMesh(mesh: Mesh): void {\r\n this._thinEffectLayer.addIncludedOnlyMesh(mesh);\r\n }\r\n\r\n /**\r\n * Remove a mesh from the Inclusion list to prevent it to impact or being impacted by the glow layer.\r\n * @param mesh The mesh to remove\r\n */\r\n public removeIncludedOnlyMesh(mesh: Mesh): void {\r\n this._thinEffectLayer.removeIncludedOnlyMesh(mesh);\r\n }\r\n\r\n /**\r\n * Determine if a given mesh will be used in the glow layer\r\n * @param mesh The mesh to test\r\n * @returns true if the mesh will be highlighted by the current glow layer\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 * Defines whether the current material of the mesh should be use to render the effect.\r\n * @param mesh defines the current mesh to render\r\n * @returns true if the material of the mesh should be use to render the effect\r\n */\r\n protected override _useMeshMaterial(mesh: AbstractMesh): boolean {\r\n return this._thinEffectLayer._useMeshMaterial(mesh);\r\n }\r\n\r\n /**\r\n * Add a mesh to be rendered through its own material and not with emissive only.\r\n * @param mesh The mesh for which we need to use its material\r\n */\r\n public referenceMeshToUseItsOwnMaterial(mesh: AbstractMesh): void {\r\n this._thinEffectLayer.referenceMeshToUseItsOwnMaterial(mesh);\r\n }\r\n\r\n /**\r\n * Remove a mesh from being rendered through its own material and not with emissive only.\r\n * @param mesh The mesh for which we need to not use its material\r\n */\r\n public unReferenceMeshFromUsingItsOwnMaterial(mesh: AbstractMesh): void {\r\n this._thinEffectLayer.unReferenceMeshFromUsingItsOwnMaterial(mesh, this._mainTexture.renderPassId);\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 \"GlowLayer\";\r\n }\r\n\r\n /**\r\n * Serializes this glow layer\r\n * @returns a serialized glow layer object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.GlowLayer\";\r\n\r\n let index;\r\n\r\n // Included meshes\r\n serializationObject.includedMeshes = [];\r\n\r\n const includedOnlyMeshes = this._thinEffectLayer._includedOnlyMeshes;\r\n if (includedOnlyMeshes.length) {\r\n for (index = 0; index < includedOnlyMeshes.length; index++) {\r\n const mesh = this._scene.getMeshByUniqueId(includedOnlyMeshes[index]);\r\n if (mesh) {\r\n serializationObject.includedMeshes.push(mesh.id);\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.length) {\r\n for (index = 0; index < excludedMeshes.length; index++) {\r\n const mesh = this._scene.getMeshByUniqueId(excludedMeshes[index]);\r\n if (mesh) {\r\n serializationObject.excludedMeshes.push(mesh.id);\r\n }\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Glow Layer from parsed glow layer data\r\n * @param parsedGlowLayer defines glow layer data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing the glow layer information\r\n * @returns a parsed Glow Layer\r\n */\r\n public static override Parse(parsedGlowLayer: any, scene: Scene, rootUrl: string): GlowLayer {\r\n const gl = SerializationHelper.Parse(() => new GlowLayer(parsedGlowLayer.name, scene, parsedGlowLayer.options), parsedGlowLayer, scene, rootUrl);\r\n let index;\r\n\r\n // Excluded meshes\r\n for (index = 0; index < parsedGlowLayer.excludedMeshes.length; index++) {\r\n const mesh = scene.getMeshById(parsedGlowLayer.excludedMeshes[index]);\r\n if (mesh) {\r\n gl.addExcludedMesh(<Mesh>mesh);\r\n }\r\n }\r\n\r\n // Included meshes\r\n for (index = 0; index < parsedGlowLayer.includedMeshes.length; index++) {\r\n const mesh = scene.getMeshById(parsedGlowLayer.includedMeshes[index]);\r\n if (mesh) {\r\n gl.addIncludedOnlyMesh(<Mesh>mesh);\r\n }\r\n }\r\n\r\n return gl;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GlowLayer\", GlowLayer);\r\n"]}
@@ -282,6 +282,8 @@ export class HighlightLayer extends EffectLayer {
282
282
  this._postProcesses.map((pp) => {
283
283
  pp.autoClear = false;
284
284
  });
285
+ this._mainTextureCreatedSize.width = this._mainTextureDesiredSize.width;
286
+ this._mainTextureCreatedSize.height = this._mainTextureDesiredSize.height;
285
287
  }
286
288
  /**
287
289
  * @returns whether or not the layer needs stencil enabled during the mesh rendering.
@@ -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,C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C,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;;AAjeD;;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;AAkZvD,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\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;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,OA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;+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"]}