@babylonjs/core 5.38.0 → 5.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/Audio/audioSceneComponent.d.ts +11 -6
  2. package/Audio/audioSceneComponent.js +78 -52
  3. package/Audio/audioSceneComponent.js.map +1 -1
  4. package/Audio/sound.js +6 -4
  5. package/Audio/sound.js.map +1 -1
  6. package/Culling/ray.d.ts +1 -1
  7. package/Culling/ray.js.map +1 -1
  8. package/Engines/Extensions/engine.renderTarget.js +3 -3
  9. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  10. package/Engines/nativeEngine.js +2 -1
  11. package/Engines/nativeEngine.js.map +1 -1
  12. package/Engines/thinEngine.js +2 -2
  13. package/Engines/thinEngine.js.map +1 -1
  14. package/Gizmos/gizmo.d.ts +1 -0
  15. package/Gizmos/gizmo.js +1 -0
  16. package/Gizmos/gizmo.js.map +1 -1
  17. package/Gizmos/positionGizmo.d.ts +4 -0
  18. package/Gizmos/positionGizmo.js +4 -0
  19. package/Gizmos/positionGizmo.js.map +1 -1
  20. package/Gizmos/rotationGizmo.d.ts +4 -0
  21. package/Gizmos/rotationGizmo.js +4 -0
  22. package/Gizmos/rotationGizmo.js.map +1 -1
  23. package/Layers/glowLayer.d.ts +3 -3
  24. package/Layers/glowLayer.js +2 -1
  25. package/Layers/glowLayer.js.map +1 -1
  26. package/Materials/Node/Blocks/index.d.ts +2 -0
  27. package/Materials/Node/Blocks/index.js +2 -0
  28. package/Materials/Node/Blocks/index.js.map +1 -1
  29. package/Materials/Node/Blocks/matrixDeterminantBlock.d.ts +27 -0
  30. package/Materials/Node/Blocks/matrixDeterminantBlock.js +46 -0
  31. package/Materials/Node/Blocks/matrixDeterminantBlock.js.map +1 -0
  32. package/Materials/Node/Blocks/matrixTransposeBlock.d.ts +27 -0
  33. package/Materials/Node/Blocks/matrixTransposeBlock.js +46 -0
  34. package/Materials/Node/Blocks/matrixTransposeBlock.js.map +1 -0
  35. package/Materials/Textures/renderTargetTexture.d.ts +32 -28
  36. package/Materials/Textures/renderTargetTexture.js +13 -9
  37. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  38. package/Materials/materialPluginManager.js +25 -4
  39. package/Materials/materialPluginManager.js.map +1 -1
  40. package/Maths/math.vector.d.ts +101 -9
  41. package/Maths/math.vector.js +101 -9
  42. package/Maths/math.vector.js.map +1 -1
  43. package/Meshes/linesMesh.d.ts +3 -1
  44. package/Meshes/linesMesh.js +8 -2
  45. package/Meshes/linesMesh.js.map +1 -1
  46. package/Meshes/subMesh.js +2 -2
  47. package/Meshes/subMesh.js.map +1 -1
  48. package/Misc/screenshotTools.d.ts +5 -2
  49. package/Misc/screenshotTools.js +7 -3
  50. package/Misc/screenshotTools.js.map +1 -1
  51. package/Particles/solidParticleSystem.d.ts +67 -63
  52. package/Particles/solidParticleSystem.js.map +1 -1
  53. package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +5 -0
  54. package/PostProcesses/volumetricLightScatteringPostProcess.js +9 -1
  55. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  56. package/Rendering/boundingBoxRenderer.js +2 -0
  57. package/Rendering/boundingBoxRenderer.js.map +1 -1
  58. package/Rendering/depthRendererSceneComponent.d.ts +2 -1
  59. package/Rendering/depthRendererSceneComponent.js +2 -2
  60. package/Rendering/depthRendererSceneComponent.js.map +1 -1
  61. package/Shaders/ShadersInclude/pbrBlockFinalColorComposition.js +3 -3
  62. package/Shaders/ShadersInclude/pbrBlockFinalColorComposition.js.map +1 -1
  63. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"glowLayer.js","sourceRoot":"","sources":["../../../../lts/core/generated/Layers/glowLayer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIpE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C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BACN,EAAE,CAAC,mBAAmB,CAAO,IAAI,CAAC,CAAC;aACtC;SACJ;QAED,OAAO,EAAE,CAAC;IACd,CAAC;;AAxlBD;;GAEG;AACoB,oBAAU,GAAG,WAAW,CAAC;AAEhD;;GAEG;AACW,+BAAqB,GAAG,EAAE,CAAC;AAEzC;;GAEG;AACW,6BAAmB,GAAG,GAAG,CAAC;AAuBxC;IADC,SAAS,EAAE;+CAGX;AAaD;IADC,SAAS,EAAE;0CAGX;AAGD;IADC,SAAS,CAAC,SAAS,CAAC;2CACe;AAmiBxC,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { serialize, SerializationHelper } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport { VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Material } from \"../Materials/material\";\r\nimport type { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport { BlurPostProcess } from \"../PostProcesses/blurPostProcess\";\r\nimport { EffectLayer } from \"./effectLayer\";\r\nimport { AbstractScene } from \"../abstractScene\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { PBRMaterial } from \"../Materials/PBR/pbrMaterial\";\r\n\r\nimport \"../Shaders/glowMapMerge.fragment\";\r\nimport \"../Shaders/glowMapMerge.vertex\";\r\nimport \"../Layers/effectLayerSceneComponent\";\r\n\r\ndeclare module \"../abstractScene\" {\r\n export interface AbstractScene {\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 getGlowLayerByName(name: string): Nullable<GlowLayer>;\r\n }\r\n}\r\n\r\nAbstractScene.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 {\r\n /**\r\n * Multiplication factor apply to the canvas size to compute the render target size\r\n * used to generated the glowing 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 resize independent blur. Default: undefined\r\n */\r\n mainTextureFixedSize?: number;\r\n\r\n /**\r\n * How big is the kernel of the blur texture. Default: 32\r\n */\r\n blurKernelSize: 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 * Enable MSAA by choosing the number of samples. Default: 1\r\n */\r\n mainTextureSamples?: number;\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 * Forces the merge step to be done in ldr (clamp values > 1). Default: false\r\n */\r\n ldrMerge?: boolean;\r\n\r\n /**\r\n * Defines the blend mode used by the merge. Default: ALPHA_ADD\r\n */\r\n alphaBlendingMode?: number;\r\n\r\n /**\r\n * The type of the main texture. Default: TEXTURETYPE_UNSIGNED_INT\r\n */\r\n mainTextureType: number;\r\n}\r\n\r\n/**\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 readonly EffectName = \"GlowLayer\";\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 if (value === this._options.blurKernelSize) {\r\n return;\r\n }\r\n\r\n this._options.blurKernelSize = value;\r\n\r\n const effectiveKernel = this._getEffectiveBlurKernelSize();\r\n this._horizontalBlurPostprocess1.kernel = effectiveKernel;\r\n this._verticalBlurPostprocess1.kernel = effectiveKernel;\r\n this._horizontalBlurPostprocess2.kernel = effectiveKernel;\r\n this._verticalBlurPostprocess2.kernel = effectiveKernel;\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._options.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._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._intensity;\r\n }\r\n\r\n @serialize(\"options\")\r\n private _options: IGlowLayerOptions;\r\n\r\n private _intensity: number = 1.0;\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 private _includedOnlyMeshes: number[] = [];\r\n private _excludedMeshes: number[] = [];\r\n private _meshesUsingTheirOwnMaterials: number[] = [];\r\n\r\n /**\r\n * Callback used to let the user override the color selection on a per mesh basis\r\n */\r\n public customEmissiveColorSelector: (mesh: Mesh, subMesh: SubMesh, material: Material, result: Color4) => void;\r\n /**\r\n * Callback used to let the user override the texture selection on a per mesh basis\r\n */\r\n public customEmissiveTextureSelector: (mesh: Mesh, subMesh: SubMesh, material: Material) => Texture;\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);\r\n this.neutralColor = new Color4(0, 0, 0, 1);\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_INT,\r\n ...options,\r\n };\r\n\r\n // Initialize the layer\r\n this._init({\r\n alphaBlendingMode: this._options.alphaBlendingMode,\r\n camera: this._options.camera,\r\n mainTextureFixedSize: this._options.mainTextureFixedSize,\r\n mainTextureRatio: this._options.mainTextureRatio,\r\n renderingGroupId: this._options.renderingGroupId,\r\n mainTextureType: this._options.mainTextureType,\r\n });\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 * 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 let defines = \"#define EMISSIVE \\n\";\r\n if (this._options.ldrMerge) {\r\n defines += \"#define LDR \\n\";\r\n }\r\n\r\n // Effect\r\n return this._engine.createEffect(\"glowMapMerge\", [VertexBuffer.PositionKind], [\"offset\"], [\"textureSampler\", \"textureSampler2\"], defines);\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 let blurTextureWidth = this._mainTextureDesiredSize.width;\r\n let blurTextureHeight = this._mainTextureDesiredSize.height;\r\n blurTextureWidth = this._engine.needPOTTextures ? Engine.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;\r\n blurTextureHeight = this._engine.needPOTTextures ? Engine.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_INT;\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 const effectiveKernel = this._getEffectiveBlurKernelSize();\r\n this._horizontalBlurPostprocess1 = new BlurPostProcess(\r\n \"GlowLayerHBP1\",\r\n new Vector2(1.0, 0),\r\n effectiveKernel,\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\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 this._verticalBlurPostprocess1 = new BlurPostProcess(\r\n \"GlowLayerVBP1\",\r\n new Vector2(0, 1.0),\r\n effectiveKernel,\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\r\n );\r\n\r\n this._horizontalBlurPostprocess2 = new BlurPostProcess(\r\n \"GlowLayerHBP2\",\r\n new Vector2(1.0, 0),\r\n effectiveKernel,\r\n {\r\n width: blurTextureWidth2,\r\n height: blurTextureHeight2,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\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 this._verticalBlurPostprocess2 = new BlurPostProcess(\r\n \"GlowLayerVBP2\",\r\n new Vector2(0, 1.0),\r\n effectiveKernel,\r\n {\r\n width: blurTextureWidth2,\r\n height: blurTextureHeight2,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\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 * @returns The blur kernel size used by the glow.\r\n * Note: The value passed in the options is divided by 2 for back compatibility.\r\n */\r\n private _getEffectiveBlurKernelSize() {\r\n return this._options.blurKernelSize / 2;\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 const material = subMesh.getMaterial();\r\n const mesh = subMesh.getRenderingMesh();\r\n\r\n if (!material || !mesh) {\r\n return false;\r\n }\r\n\r\n const emissiveTexture = (<any>material).emissiveTexture;\r\n return super._isReady(subMesh, useInstances, emissiveTexture);\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 _canRenderMesh(mesh: AbstractMesh, material: Material): boolean {\r\n return true;\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 // Texture\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 // Cache\r\n const engine = this._engine;\r\n const previousStencilBuffer = engine.getStencilBuffer();\r\n\r\n // Draw order\r\n engine.setStencilBuffer(false);\r\n\r\n engine.drawElementsType(Material.TriangleFillMode, 0, 6);\r\n\r\n // Draw order\r\n engine.setStencilBuffer(previousStencilBuffer);\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 let textureLevel = 1.0;\r\n\r\n if (this.customEmissiveTextureSelector) {\r\n this._emissiveTextureAndColor.texture = this.customEmissiveTextureSelector(mesh, subMesh, material);\r\n } else {\r\n if (material) {\r\n this._emissiveTextureAndColor.texture = (<any>material).emissiveTexture;\r\n if (this._emissiveTextureAndColor.texture) {\r\n textureLevel = this._emissiveTextureAndColor.texture.level;\r\n }\r\n } else {\r\n this._emissiveTextureAndColor.texture = null;\r\n }\r\n }\r\n\r\n if (this.customEmissiveColorSelector) {\r\n this.customEmissiveColorSelector(mesh, subMesh, material, this._emissiveTextureAndColor.color);\r\n } else {\r\n if ((<any>material).emissiveColor) {\r\n const emissiveIntensity = (<PBRMaterial>material).emissiveIntensity ?? 1;\r\n textureLevel *= emissiveIntensity;\r\n this._emissiveTextureAndColor.color.set(\r\n (<any>material).emissiveColor.r * textureLevel,\r\n (<any>material).emissiveColor.g * textureLevel,\r\n (<any>material).emissiveColor.b * textureLevel,\r\n material.alpha\r\n );\r\n } else {\r\n this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);\r\n }\r\n }\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 _shouldRenderMesh(mesh: Mesh): boolean {\r\n return this.hasMesh(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 _addCustomEffectDefines(defines: string[]): void {\r\n defines.push(\"#define GLOW\");\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 if (this._excludedMeshes.indexOf(mesh.uniqueId) === -1) {\r\n this._excludedMeshes.push(mesh.uniqueId);\r\n }\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 const index = this._excludedMeshes.indexOf(mesh.uniqueId);\r\n if (index !== -1) {\r\n this._excludedMeshes.splice(index, 1);\r\n }\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 if (this._includedOnlyMeshes.indexOf(mesh.uniqueId) === -1) {\r\n this._includedOnlyMeshes.push(mesh.uniqueId);\r\n }\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 const index = this._includedOnlyMeshes.indexOf(mesh.uniqueId);\r\n if (index !== -1) {\r\n this._includedOnlyMeshes.splice(index, 1);\r\n }\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 hasMesh(mesh: AbstractMesh): boolean {\r\n if (!super.hasMesh(mesh)) {\r\n return false;\r\n }\r\n\r\n // Included Mesh\r\n if (this._includedOnlyMeshes.length) {\r\n return this._includedOnlyMeshes.indexOf(mesh.uniqueId) !== -1;\r\n }\r\n\r\n // Excluded Mesh\r\n if (this._excludedMeshes.length) {\r\n return this._excludedMeshes.indexOf(mesh.uniqueId) === -1;\r\n }\r\n\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 */\r\n protected _useMeshMaterial(mesh: AbstractMesh): boolean {\r\n if (this._meshesUsingTheirOwnMaterials.length == 0) {\r\n return false;\r\n }\r\n return this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId) > -1;\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 mesh.resetDrawCache(this._mainTexture.renderPassId);\r\n\r\n this._meshesUsingTheirOwnMaterials.push(mesh.uniqueId);\r\n\r\n mesh.onDisposeObservable.add(() => {\r\n this._disposeMesh(mesh as Mesh);\r\n });\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 let index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);\r\n while (index >= 0) {\r\n this._meshesUsingTheirOwnMaterials.splice(index, 1);\r\n index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);\r\n }\r\n mesh.resetDrawCache(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.removeIncludedOnlyMesh(mesh);\r\n this.removeExcludedMesh(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 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 if (this._includedOnlyMeshes.length) {\r\n for (index = 0; index < this._includedOnlyMeshes.length; index++) {\r\n const mesh = this._scene.getMeshByUniqueId(this._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 if (this._excludedMeshes.length) {\r\n for (index = 0; index < this._excludedMeshes.length; index++) {\r\n const mesh = this._scene.getMeshByUniqueId(this._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 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":["../../../../lts/core/generated/Layers/glowLayer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIpE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAIjD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB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CACe;AAmiBxC,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { serialize, SerializationHelper } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport { VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Material } from \"../Materials/material\";\r\nimport type { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport { BlurPostProcess } from \"../PostProcesses/blurPostProcess\";\r\nimport { EffectLayer } from \"./effectLayer\";\r\nimport { AbstractScene } from \"../abstractScene\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { Color4 } from \"../Maths/math.color\";\r\nimport type { PBRMaterial } from \"../Materials/PBR/pbrMaterial\";\r\n\r\nimport \"../Shaders/glowMapMerge.fragment\";\r\nimport \"../Shaders/glowMapMerge.vertex\";\r\nimport \"../Layers/effectLayerSceneComponent\";\r\n\r\ndeclare module \"../abstractScene\" {\r\n export interface AbstractScene {\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\nAbstractScene.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 {\r\n /**\r\n * Multiplication factor apply to the canvas size to compute the render target size\r\n * used to generated the glowing 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 resize independent blur. Default: undefined\r\n */\r\n mainTextureFixedSize?: number;\r\n\r\n /**\r\n * How big is the kernel of the blur texture. Default: 32\r\n */\r\n blurKernelSize: 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 * Enable MSAA by choosing the number of samples. Default: 1\r\n */\r\n mainTextureSamples?: number;\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 * Forces the merge step to be done in ldr (clamp values > 1). Default: false\r\n */\r\n ldrMerge?: boolean;\r\n\r\n /**\r\n * Defines the blend mode used by the merge. Default: ALPHA_ADD\r\n */\r\n alphaBlendingMode?: number;\r\n\r\n /**\r\n * The type of the main texture. Default: TEXTURETYPE_UNSIGNED_INT\r\n */\r\n mainTextureType: number;\r\n}\r\n\r\n/**\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 readonly EffectName = \"GlowLayer\";\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 if (value === this._options.blurKernelSize) {\r\n return;\r\n }\r\n\r\n this._options.blurKernelSize = value;\r\n\r\n const effectiveKernel = this._getEffectiveBlurKernelSize();\r\n this._horizontalBlurPostprocess1.kernel = effectiveKernel;\r\n this._verticalBlurPostprocess1.kernel = effectiveKernel;\r\n this._horizontalBlurPostprocess2.kernel = effectiveKernel;\r\n this._verticalBlurPostprocess2.kernel = effectiveKernel;\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._options.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._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._intensity;\r\n }\r\n\r\n @serialize(\"options\")\r\n private _options: IGlowLayerOptions;\r\n\r\n private _intensity: number = 1.0;\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 private _includedOnlyMeshes: number[] = [];\r\n private _excludedMeshes: number[] = [];\r\n private _meshesUsingTheirOwnMaterials: number[] = [];\r\n\r\n /**\r\n * Callback used to let the user override the color selection on a per mesh basis\r\n */\r\n public customEmissiveColorSelector: (mesh: Mesh, subMesh: SubMesh, material: Material, result: Color4) => void;\r\n /**\r\n * Callback used to let the user override the texture selection on a per mesh basis\r\n */\r\n public customEmissiveTextureSelector: (mesh: Mesh, subMesh: SubMesh, material: Material) => Texture;\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);\r\n this.neutralColor = new Color4(0, 0, 0, 1);\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_INT,\r\n ...options,\r\n };\r\n\r\n // Initialize the layer\r\n this._init({\r\n alphaBlendingMode: this._options.alphaBlendingMode,\r\n camera: this._options.camera,\r\n mainTextureFixedSize: this._options.mainTextureFixedSize,\r\n mainTextureRatio: this._options.mainTextureRatio,\r\n renderingGroupId: this._options.renderingGroupId,\r\n mainTextureType: this._options.mainTextureType,\r\n });\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 * 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 let defines = \"#define EMISSIVE \\n\";\r\n if (this._options.ldrMerge) {\r\n defines += \"#define LDR \\n\";\r\n }\r\n\r\n // Effect\r\n return this._engine.createEffect(\"glowMapMerge\", [VertexBuffer.PositionKind], [\"offset\"], [\"textureSampler\", \"textureSampler2\"], defines);\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 let blurTextureWidth = this._mainTextureDesiredSize.width;\r\n let blurTextureHeight = this._mainTextureDesiredSize.height;\r\n blurTextureWidth = this._engine.needPOTTextures ? Engine.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;\r\n blurTextureHeight = this._engine.needPOTTextures ? Engine.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_INT;\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 const effectiveKernel = this._getEffectiveBlurKernelSize();\r\n this._horizontalBlurPostprocess1 = new BlurPostProcess(\r\n \"GlowLayerHBP1\",\r\n new Vector2(1.0, 0),\r\n effectiveKernel,\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\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 this._verticalBlurPostprocess1 = new BlurPostProcess(\r\n \"GlowLayerVBP1\",\r\n new Vector2(0, 1.0),\r\n effectiveKernel,\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\r\n );\r\n\r\n this._horizontalBlurPostprocess2 = new BlurPostProcess(\r\n \"GlowLayerHBP2\",\r\n new Vector2(1.0, 0),\r\n effectiveKernel,\r\n {\r\n width: blurTextureWidth2,\r\n height: blurTextureHeight2,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\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 this._verticalBlurPostprocess2 = new BlurPostProcess(\r\n \"GlowLayerVBP2\",\r\n new Vector2(0, 1.0),\r\n effectiveKernel,\r\n {\r\n width: blurTextureWidth2,\r\n height: blurTextureHeight2,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\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 * @returns The blur kernel size used by the glow.\r\n * Note: The value passed in the options is divided by 2 for back compatibility.\r\n */\r\n private _getEffectiveBlurKernelSize() {\r\n return this._options.blurKernelSize / 2;\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 const material = subMesh.getMaterial();\r\n const mesh = subMesh.getRenderingMesh();\r\n\r\n if (!material || !mesh) {\r\n return false;\r\n }\r\n\r\n const emissiveTexture = (<any>material).emissiveTexture;\r\n return super._isReady(subMesh, useInstances, emissiveTexture);\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 _canRenderMesh(mesh: AbstractMesh, material: Material): boolean {\r\n return true;\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 // Texture\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 // Cache\r\n const engine = this._engine;\r\n const previousStencilBuffer = engine.getStencilBuffer();\r\n\r\n // Draw order\r\n engine.setStencilBuffer(false);\r\n\r\n engine.drawElementsType(Material.TriangleFillMode, 0, 6);\r\n\r\n // Draw order\r\n engine.setStencilBuffer(previousStencilBuffer);\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 let textureLevel = 1.0;\r\n\r\n if (this.customEmissiveTextureSelector) {\r\n this._emissiveTextureAndColor.texture = this.customEmissiveTextureSelector(mesh, subMesh, material);\r\n } else {\r\n if (material) {\r\n this._emissiveTextureAndColor.texture = (<any>material).emissiveTexture;\r\n if (this._emissiveTextureAndColor.texture) {\r\n textureLevel = this._emissiveTextureAndColor.texture.level;\r\n }\r\n } else {\r\n this._emissiveTextureAndColor.texture = null;\r\n }\r\n }\r\n\r\n if (this.customEmissiveColorSelector) {\r\n this.customEmissiveColorSelector(mesh, subMesh, material, this._emissiveTextureAndColor.color);\r\n } else {\r\n if ((<any>material).emissiveColor) {\r\n const emissiveIntensity = (<PBRMaterial>material).emissiveIntensity ?? 1;\r\n textureLevel *= emissiveIntensity;\r\n this._emissiveTextureAndColor.color.set(\r\n (<any>material).emissiveColor.r * textureLevel,\r\n (<any>material).emissiveColor.g * textureLevel,\r\n (<any>material).emissiveColor.b * textureLevel,\r\n material.alpha\r\n );\r\n } else {\r\n this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);\r\n }\r\n }\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 _shouldRenderMesh(mesh: Mesh): boolean {\r\n return this.hasMesh(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 _addCustomEffectDefines(defines: string[]): void {\r\n defines.push(\"#define GLOW\");\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 if (this._excludedMeshes.indexOf(mesh.uniqueId) === -1) {\r\n this._excludedMeshes.push(mesh.uniqueId);\r\n }\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 const index = this._excludedMeshes.indexOf(mesh.uniqueId);\r\n if (index !== -1) {\r\n this._excludedMeshes.splice(index, 1);\r\n }\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 if (this._includedOnlyMeshes.indexOf(mesh.uniqueId) === -1) {\r\n this._includedOnlyMeshes.push(mesh.uniqueId);\r\n }\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 const index = this._includedOnlyMeshes.indexOf(mesh.uniqueId);\r\n if (index !== -1) {\r\n this._includedOnlyMeshes.splice(index, 1);\r\n }\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 hasMesh(mesh: AbstractMesh): boolean {\r\n if (!super.hasMesh(mesh)) {\r\n return false;\r\n }\r\n\r\n // Included Mesh\r\n if (this._includedOnlyMeshes.length) {\r\n return this._includedOnlyMeshes.indexOf(mesh.uniqueId) !== -1;\r\n }\r\n\r\n // Excluded Mesh\r\n if (this._excludedMeshes.length) {\r\n return this._excludedMeshes.indexOf(mesh.uniqueId) === -1;\r\n }\r\n\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 */\r\n protected _useMeshMaterial(mesh: AbstractMesh): boolean {\r\n if (this._meshesUsingTheirOwnMaterials.length == 0) {\r\n return false;\r\n }\r\n return this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId) > -1;\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 mesh.resetDrawCache(this._mainTexture.renderPassId);\r\n\r\n this._meshesUsingTheirOwnMaterials.push(mesh.uniqueId);\r\n\r\n mesh.onDisposeObservable.add(() => {\r\n this._disposeMesh(mesh as Mesh);\r\n });\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 let index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);\r\n while (index >= 0) {\r\n this._meshesUsingTheirOwnMaterials.splice(index, 1);\r\n index = this._meshesUsingTheirOwnMaterials.indexOf(mesh.uniqueId);\r\n }\r\n mesh.resetDrawCache(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.removeIncludedOnlyMesh(mesh);\r\n this.removeExcludedMesh(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 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 if (this._includedOnlyMeshes.length) {\r\n for (index = 0; index < this._includedOnlyMeshes.length; index++) {\r\n const mesh = this._scene.getMeshByUniqueId(this._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 if (this._excludedMeshes.length) {\r\n for (index = 0; index < this._excludedMeshes.length; index++) {\r\n const mesh = this._scene.getMeshByUniqueId(this._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 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"]}
@@ -56,3 +56,5 @@ export * from "./voronoiNoiseBlock";
56
56
  export * from "./elbowBlock";
57
57
  export * from "./triPlanarBlock";
58
58
  export * from "./biPlanarBlock";
59
+ export * from "./matrixDeterminantBlock";
60
+ export * from "./matrixTransposeBlock";
@@ -57,4 +57,6 @@ export * from "./voronoiNoiseBlock.js";
57
57
  export * from "./elbowBlock.js";
58
58
  export * from "./triPlanarBlock.js";
59
59
  export * from "./biPlanarBlock.js";
60
+ export * from "./matrixDeterminantBlock.js";
61
+ export * from "./matrixTransposeBlock.js";
60
62
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Node/Blocks/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./Vertex/index\";\r\nexport * from \"./Fragment/index\";\r\nexport * from \"./Dual/index\";\r\nexport * from \"./Input/index\";\r\nexport * from \"./multiplyBlock\";\r\nexport * from \"./addBlock\";\r\nexport * from \"./scaleBlock\";\r\nexport * from \"./clampBlock\";\r\nexport * from \"./crossBlock\";\r\nexport * from \"./customBlock\";\r\nexport * from \"./dotBlock\";\r\nexport * from \"./transformBlock\";\r\nexport * from \"./remapBlock\";\r\nexport * from \"./normalizeBlock\";\r\nexport * from \"./trigonometryBlock\";\r\nexport * from \"./colorMergerBlock\";\r\nexport * from \"./vectorMergerBlock\";\r\nexport * from \"./colorSplitterBlock\";\r\nexport * from \"./vectorSplitterBlock\";\r\nexport * from \"./lerpBlock\";\r\nexport * from \"./divideBlock\";\r\nexport * from \"./subtractBlock\";\r\nexport * from \"./stepBlock\";\r\nexport * from \"./oneMinusBlock\";\r\nexport * from \"./viewDirectionBlock\";\r\nexport * from \"./fresnelBlock\";\r\nexport * from \"./maxBlock\";\r\nexport * from \"./minBlock\";\r\nexport * from \"./distanceBlock\";\r\nexport * from \"./lengthBlock\";\r\nexport * from \"./negateBlock\";\r\nexport * from \"./powBlock\";\r\nexport * from \"./randomNumberBlock\";\r\nexport * from \"./arcTan2Block\";\r\nexport * from \"./smoothStepBlock\";\r\nexport * from \"./reciprocalBlock\";\r\nexport * from \"./replaceColorBlock\";\r\nexport * from \"./posterizeBlock\";\r\nexport * from \"./waveBlock\";\r\nexport * from \"./gradientBlock\";\r\nexport * from \"./nLerpBlock\";\r\nexport * from \"./worleyNoise3DBlock\";\r\nexport * from \"./simplexPerlin3DBlock\";\r\nexport * from \"./normalBlendBlock\";\r\nexport * from \"./rotate2dBlock\";\r\nexport * from \"./reflectBlock\";\r\nexport * from \"./refractBlock\";\r\nexport * from \"./desaturateBlock\";\r\nexport * from \"./PBR/index\";\r\nexport * from \"./Particle/index\";\r\nexport * from \"./modBlock\";\r\nexport * from \"./matrixBuilderBlock\";\r\nexport * from \"./conditionalBlock\";\r\nexport * from \"./cloudBlock\";\r\nexport * from \"./voronoiNoiseBlock\";\r\nexport * from \"./elbowBlock\";\r\nexport * from \"./triPlanarBlock\";\r\nexport * from \"./biPlanarBlock\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Node/Blocks/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./Vertex/index\";\r\nexport * from \"./Fragment/index\";\r\nexport * from \"./Dual/index\";\r\nexport * from \"./Input/index\";\r\nexport * from \"./multiplyBlock\";\r\nexport * from \"./addBlock\";\r\nexport * from \"./scaleBlock\";\r\nexport * from \"./clampBlock\";\r\nexport * from \"./crossBlock\";\r\nexport * from \"./customBlock\";\r\nexport * from \"./dotBlock\";\r\nexport * from \"./transformBlock\";\r\nexport * from \"./remapBlock\";\r\nexport * from \"./normalizeBlock\";\r\nexport * from \"./trigonometryBlock\";\r\nexport * from \"./colorMergerBlock\";\r\nexport * from \"./vectorMergerBlock\";\r\nexport * from \"./colorSplitterBlock\";\r\nexport * from \"./vectorSplitterBlock\";\r\nexport * from \"./lerpBlock\";\r\nexport * from \"./divideBlock\";\r\nexport * from \"./subtractBlock\";\r\nexport * from \"./stepBlock\";\r\nexport * from \"./oneMinusBlock\";\r\nexport * from \"./viewDirectionBlock\";\r\nexport * from \"./fresnelBlock\";\r\nexport * from \"./maxBlock\";\r\nexport * from \"./minBlock\";\r\nexport * from \"./distanceBlock\";\r\nexport * from \"./lengthBlock\";\r\nexport * from \"./negateBlock\";\r\nexport * from \"./powBlock\";\r\nexport * from \"./randomNumberBlock\";\r\nexport * from \"./arcTan2Block\";\r\nexport * from \"./smoothStepBlock\";\r\nexport * from \"./reciprocalBlock\";\r\nexport * from \"./replaceColorBlock\";\r\nexport * from \"./posterizeBlock\";\r\nexport * from \"./waveBlock\";\r\nexport * from \"./gradientBlock\";\r\nexport * from \"./nLerpBlock\";\r\nexport * from \"./worleyNoise3DBlock\";\r\nexport * from \"./simplexPerlin3DBlock\";\r\nexport * from \"./normalBlendBlock\";\r\nexport * from \"./rotate2dBlock\";\r\nexport * from \"./reflectBlock\";\r\nexport * from \"./refractBlock\";\r\nexport * from \"./desaturateBlock\";\r\nexport * from \"./PBR/index\";\r\nexport * from \"./Particle/index\";\r\nexport * from \"./modBlock\";\r\nexport * from \"./matrixBuilderBlock\";\r\nexport * from \"./conditionalBlock\";\r\nexport * from \"./cloudBlock\";\r\nexport * from \"./voronoiNoiseBlock\";\r\nexport * from \"./elbowBlock\";\r\nexport * from \"./triPlanarBlock\";\r\nexport * from \"./biPlanarBlock\";\r\nexport * from \"./matrixDeterminantBlock\";\r\nexport * from \"./matrixTransposeBlock\";\r\n"]}
@@ -0,0 +1,27 @@
1
+ import { NodeMaterialBlock } from "../nodeMaterialBlock";
2
+ import type { NodeMaterialBuildState } from "../nodeMaterialBuildState";
3
+ import type { NodeMaterialConnectionPoint } from "../nodeMaterialBlockConnectionPoint";
4
+ /**
5
+ * Block used to compute the determinant of a matrix
6
+ */
7
+ export declare class MatrixDeterminantBlock extends NodeMaterialBlock {
8
+ /**
9
+ * Creates a new MatrixDeterminantBlock
10
+ * @param name defines the block name
11
+ */
12
+ constructor(name: string);
13
+ /**
14
+ * Gets the current class name
15
+ * @returns the class name
16
+ */
17
+ getClassName(): string;
18
+ /**
19
+ * Gets the input matrix
20
+ */
21
+ get input(): NodeMaterialConnectionPoint;
22
+ /**
23
+ * Gets the output component
24
+ */
25
+ get output(): NodeMaterialConnectionPoint;
26
+ protected _buildBlock(state: NodeMaterialBuildState): this;
27
+ }
@@ -0,0 +1,46 @@
1
+ import { NodeMaterialBlock } from "../nodeMaterialBlock.js";
2
+ import { NodeMaterialBlockConnectionPointTypes } from "../Enums/nodeMaterialBlockConnectionPointTypes.js";
3
+ import { NodeMaterialBlockTargets } from "../Enums/nodeMaterialBlockTargets.js";
4
+ import { RegisterClass } from "../../../Misc/typeStore.js";
5
+ /**
6
+ * Block used to compute the determinant of a matrix
7
+ */
8
+ export class MatrixDeterminantBlock extends NodeMaterialBlock {
9
+ /**
10
+ * Creates a new MatrixDeterminantBlock
11
+ * @param name defines the block name
12
+ */
13
+ constructor(name) {
14
+ super(name, NodeMaterialBlockTargets.Neutral);
15
+ this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Matrix);
16
+ this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Float);
17
+ }
18
+ /**
19
+ * Gets the current class name
20
+ * @returns the class name
21
+ */
22
+ getClassName() {
23
+ return "MatrixDeterminantBlock";
24
+ }
25
+ /**
26
+ * Gets the input matrix
27
+ */
28
+ get input() {
29
+ return this._inputs[0];
30
+ }
31
+ /**
32
+ * Gets the output component
33
+ */
34
+ get output() {
35
+ return this._outputs[0];
36
+ }
37
+ _buildBlock(state) {
38
+ super._buildBlock(state);
39
+ const output = this.output;
40
+ const input = this.input;
41
+ state.compilationString += this._declareOutput(output, state) + `${output.associatedVariableName} = determinant(${input.associatedVariableName});\r\n`;
42
+ return this;
43
+ }
44
+ }
45
+ RegisterClass("BABYLON.MatrixDeterminantBlock", MatrixDeterminantBlock);
46
+ //# sourceMappingURL=matrixDeterminantBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrixDeterminantBlock.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Node/Blocks/matrixDeterminantBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,iBAAiB;IACzD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,MAAM,CAAC,CAAC;QAC1E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;IAC/E,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,wBAAwB,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAEzB,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,sBAAsB,kBAAkB,KAAK,CAAC,sBAAsB,QAAQ,CAAC;QAEvJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,gCAAgC,EAAE,sBAAsB,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to compute the determinant of a matrix\r\n */\r\nexport class MatrixDeterminantBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new MatrixDeterminantBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MatrixDeterminantBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input matrix\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this.output;\r\n const input = this.input;\r\n\r\n state.compilationString += this._declareOutput(output, state) + `${output.associatedVariableName} = determinant(${input.associatedVariableName});\\r\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MatrixDeterminantBlock\", MatrixDeterminantBlock);\r\n"]}
@@ -0,0 +1,27 @@
1
+ import { NodeMaterialBlock } from "../nodeMaterialBlock";
2
+ import type { NodeMaterialBuildState } from "../nodeMaterialBuildState";
3
+ import type { NodeMaterialConnectionPoint } from "../nodeMaterialBlockConnectionPoint";
4
+ /**
5
+ * Block used to transpose a matrix
6
+ */
7
+ export declare class MatrixTransposeBlock extends NodeMaterialBlock {
8
+ /**
9
+ * Creates a new MatrixTransposeBlock
10
+ * @param name defines the block name
11
+ */
12
+ constructor(name: string);
13
+ /**
14
+ * Gets the current class name
15
+ * @returns the class name
16
+ */
17
+ getClassName(): string;
18
+ /**
19
+ * Gets the input matrix
20
+ */
21
+ get input(): NodeMaterialConnectionPoint;
22
+ /**
23
+ * Gets the output component
24
+ */
25
+ get output(): NodeMaterialConnectionPoint;
26
+ protected _buildBlock(state: NodeMaterialBuildState): this;
27
+ }
@@ -0,0 +1,46 @@
1
+ import { NodeMaterialBlock } from "../nodeMaterialBlock.js";
2
+ import { NodeMaterialBlockConnectionPointTypes } from "../Enums/nodeMaterialBlockConnectionPointTypes.js";
3
+ import { NodeMaterialBlockTargets } from "../Enums/nodeMaterialBlockTargets.js";
4
+ import { RegisterClass } from "../../../Misc/typeStore.js";
5
+ /**
6
+ * Block used to transpose a matrix
7
+ */
8
+ export class MatrixTransposeBlock extends NodeMaterialBlock {
9
+ /**
10
+ * Creates a new MatrixTransposeBlock
11
+ * @param name defines the block name
12
+ */
13
+ constructor(name) {
14
+ super(name, NodeMaterialBlockTargets.Neutral);
15
+ this.registerInput("input", NodeMaterialBlockConnectionPointTypes.Matrix);
16
+ this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.Matrix);
17
+ }
18
+ /**
19
+ * Gets the current class name
20
+ * @returns the class name
21
+ */
22
+ getClassName() {
23
+ return "MatrixTransposeBlock";
24
+ }
25
+ /**
26
+ * Gets the input matrix
27
+ */
28
+ get input() {
29
+ return this._inputs[0];
30
+ }
31
+ /**
32
+ * Gets the output component
33
+ */
34
+ get output() {
35
+ return this._outputs[0];
36
+ }
37
+ _buildBlock(state) {
38
+ super._buildBlock(state);
39
+ const output = this.output;
40
+ const input = this.input;
41
+ state.compilationString += this._declareOutput(output, state) + `${output.associatedVariableName} = transpose(${input.associatedVariableName});\r\n`;
42
+ return this;
43
+ }
44
+ }
45
+ RegisterClass("BABYLON.MatrixTransposeBlock", MatrixTransposeBlock);
46
+ //# sourceMappingURL=matrixTransposeBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrixTransposeBlock.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Node/Blocks/matrixTransposeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,iBAAiB;IACvD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,MAAM,CAAC,CAAC;QAC1E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,MAAM,CAAC,CAAC;IAChF,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,sBAAsB,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAEzB,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,sBAAsB,gBAAgB,KAAK,CAAC,sBAAsB,QAAQ,CAAC;QAErJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,8BAA8B,EAAE,oBAAoB,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\n\r\n/**\r\n * Block used to transpose a matrix\r\n */\r\nexport class MatrixTransposeBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new MatrixTransposeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MatrixTransposeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input matrix\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this.output;\r\n const input = this.input;\r\n\r\n state.compilationString += this._declareOutput(output, state) + `${output.associatedVariableName} = transpose(${input.associatedVariableName});\\r\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MatrixTransposeBlock\", MatrixTransposeBlock);\r\n"]}
@@ -21,35 +21,35 @@ declare type Material = import("../material").Material;
21
21
  * Options for the RenderTargetTexture constructor
22
22
  */
23
23
  export interface RenderTargetTextureOptions {
24
- /** True if mip maps need to be generated after render */
24
+ /** True (default: false) if mipmaps need to be generated after render */
25
25
  generateMipMaps?: boolean;
26
- /** True to not change the aspect ratio of the scene in the RTT */
26
+ /** True (default) to not change the aspect ratio of the scene in the RTT */
27
27
  doNotChangeAspectRatio?: boolean;
28
- /** The type of the buffer in the RTT (int, half float, float...) */
28
+ /** The type of the buffer in the RTT (byte (default), half float, float...) */
29
29
  type?: number;
30
- /** True if a cube texture needs to be created */
30
+ /** True (default: false) if a cube texture needs to be created */
31
31
  isCube?: boolean;
32
- /** The sampling mode to be usedwith the render target (Linear, Nearest...) */
32
+ /** The sampling mode to be used with the render target (Trilinear (default), Linear, Nearest...) */
33
33
  samplingMode?: number;
34
- /** True to generate a depth buffer */
34
+ /** True (default) to generate a depth buffer */
35
35
  generateDepthBuffer?: boolean;
36
- /** True to generate a stencil buffer */
36
+ /** True (default: false) to generate a stencil buffer */
37
37
  generateStencilBuffer?: boolean;
38
- /** True if multiple textures need to be created (Draw Buffers) */
38
+ /** True (default: false) if multiple textures need to be created (Draw Buffers) */
39
39
  isMulti?: boolean;
40
- /** The internal format of the buffer in the RTT (RED, RG, RGB, RGBA, ALPHA...) */
40
+ /** The internal format of the buffer in the RTT (RED, RG, RGB, RGBA (default), ALPHA...) */
41
41
  format?: number;
42
- /** if the texture allocation should be delayed (default: false) */
42
+ /** True (default: false) if the texture allocation should be delayed */
43
43
  delayAllocation?: boolean;
44
- /** sample count to use when creating the RTT */
44
+ /** Sample count to use when creating the RTT */
45
45
  samples?: number;
46
46
  /** specific flags to use when creating the texture (e.g., Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures) */
47
47
  creationFlags?: number;
48
- /** True to indicate that no color target should be created. (e.g., if you only want to write to the depth buffer) */
48
+ /** True (default: false) to indicate that no color target should be created. (e.g., if you only want to write to the depth buffer) */
49
49
  noColorAttachment?: boolean;
50
50
  /** Specifies the internal texture to use directly instead of creating one (ignores `noColorAttachment` flag when set) **/
51
51
  colorAttachment?: InternalTexture;
52
- /** True to create a SRGB texture */
52
+ /** True (default: false) to create a SRGB texture */
53
53
  useSRGBBuffer?: boolean;
54
54
  }
55
55
  /**
@@ -102,6 +102,10 @@ export declare class RenderTargetTexture extends Texture implements IRenderTarge
102
102
  * Define if sprites should be rendered in your texture.
103
103
  */
104
104
  renderSprites: boolean;
105
+ /**
106
+ * Force checking the layerMask property even if a custom list of meshes is provided (ie. if renderList is not undefined)
107
+ */
108
+ forceLayerMaskCheck: boolean;
105
109
  /**
106
110
  * Define the camera used to render the texture.
107
111
  */
@@ -264,7 +268,7 @@ export declare class RenderTargetTexture extends Texture implements IRenderTarge
264
268
  * or used a shadow, depth texture...
265
269
  * @param name The friendly name of the texture
266
270
  * @param size The size of the RTT (number if square, or {width: number, height:number} or {ratio:} to define a ratio from the main scene)
267
- * @param scene The scene the RTT belongs to. The latest created scene will be used if not precised.
271
+ * @param scene The scene the RTT belongs to. Default is the last created scene.
268
272
  * @param options The options for creating the render target texture.
269
273
  */
270
274
  constructor(name: string, size: number | {
@@ -279,21 +283,21 @@ export declare class RenderTargetTexture extends Texture implements IRenderTarge
279
283
  * or used a shadow, depth texture...
280
284
  * @param name The friendly name of the texture
281
285
  * @param size The size of the RTT (number if square, or {width: number, height:number} or {ratio:} to define a ratio from the main scene)
282
- * @param scene The scene the RTT belongs to. The latest created scene will be used if not precised.
283
- * @param generateMipMaps True if mip maps need to be generated after render.
284
- * @param doNotChangeAspectRatio True to not change the aspect ratio of the scene in the RTT
285
- * @param type The type of the buffer in the RTT (int, half float, float...)
286
- * @param isCube True if a cube texture needs to be created
287
- * @param samplingMode The sampling mode to be usedwith the render target (Linear, Nearest...)
288
- * @param generateDepthBuffer True to generate a depth buffer
289
- * @param generateStencilBuffer True to generate a stencil buffer
290
- * @param isMulti True if multiple textures need to be created (Draw Buffers)
291
- * @param format The internal format of the buffer in the RTT (RED, RG, RGB, RGBA, ALPHA...)
292
- * @param delayAllocation if the texture allocation should be delayed (default: false)
293
- * @param samples sample count to use when creating the RTT
286
+ * @param scene The scene the RTT belongs to. Default is the last created scene
287
+ * @param generateMipMaps True (default: false) if mipmaps need to be generated after render
288
+ * @param doNotChangeAspectRatio True (default) to not change the aspect ratio of the scene in the RTT
289
+ * @param type The type of the buffer in the RTT (byte (default), half float, float...)
290
+ * @param isCube True (default: false) if a cube texture needs to be created
291
+ * @param samplingMode The sampling mode to be used with the render target (Trilinear (default), Linear, Nearest...)
292
+ * @param generateDepthBuffer True (default) to generate a depth buffer
293
+ * @param generateStencilBuffer True (default: false) to generate a stencil buffer
294
+ * @param isMulti True (default: false) if multiple textures need to be created (Draw Buffers)
295
+ * @param format The internal format of the buffer in the RTT (RED, RG, RGB, RGBA (default), ALPHA...)
296
+ * @param delayAllocation True (default: false) if the texture allocation should be delayed
297
+ * @param samples Sample count to use when creating the RTT
294
298
  * @param creationFlags specific flags to use when creating the texture (e.g., Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures)
295
- * @param noColorAttachment True to indicate that no color target should be created. (e.g., if you only want to write to the depth buffer)
296
- * @param useSRGBBuffer True to create a SRGB texture
299
+ * @param noColorAttachment True (default: false) to indicate that no color target should be created. (e.g., if you only want to write to the depth buffer)
300
+ * @param useSRGBBuffer True (default: false) to create a SRGB texture
297
301
  */
298
302
  constructor(name: string, size: number | {
299
303
  width: number;
@@ -17,19 +17,19 @@ import { DumpTools } from "../../Misc/dumpTools.js";
17
17
  export class RenderTargetTexture extends Texture {
18
18
  /** @internal */
19
19
  constructor(name, size, scene, generateMipMaps = false, doNotChangeAspectRatio = true, type = 0, isCube = false, samplingMode = Texture.TRILINEAR_SAMPLINGMODE, generateDepthBuffer = true, generateStencilBuffer = false, isMulti = false, format = 5, delayAllocation = false, samples, creationFlags, noColorAttachment = false, useSRGBBuffer = false) {
20
- var _a, _b, _c, _d;
20
+ var _a, _b, _c, _d, _e, _f;
21
21
  let colorAttachment = undefined;
22
22
  if (typeof generateMipMaps === "object") {
23
23
  const options = generateMipMaps;
24
24
  generateMipMaps = !!options.generateMipMaps;
25
- doNotChangeAspectRatio = !!options.doNotChangeAspectRatio;
26
- type = (_a = options.type) !== null && _a !== void 0 ? _a : 0;
25
+ doNotChangeAspectRatio = (_a = options.doNotChangeAspectRatio) !== null && _a !== void 0 ? _a : true;
26
+ type = (_b = options.type) !== null && _b !== void 0 ? _b : 0;
27
27
  isCube = !!options.isCube;
28
- samplingMode = (_b = options.samplingMode) !== null && _b !== void 0 ? _b : Texture.TRILINEAR_SAMPLINGMODE;
29
- generateDepthBuffer = !!options.generateDepthBuffer;
28
+ samplingMode = (_c = options.samplingMode) !== null && _c !== void 0 ? _c : Texture.TRILINEAR_SAMPLINGMODE;
29
+ generateDepthBuffer = (_d = options.generateDepthBuffer) !== null && _d !== void 0 ? _d : true;
30
30
  generateStencilBuffer = !!options.generateStencilBuffer;
31
31
  isMulti = !!options.isMulti;
32
- format = (_c = options.format) !== null && _c !== void 0 ? _c : 5;
32
+ format = (_e = options.format) !== null && _e !== void 0 ? _e : 5;
33
33
  delayAllocation = !!options.delayAllocation;
34
34
  samples = options.samples;
35
35
  creationFlags = options.creationFlags;
@@ -56,6 +56,10 @@ export class RenderTargetTexture extends Texture {
56
56
  * Define if sprites should be rendered in your texture.
57
57
  */
58
58
  this.renderSprites = false;
59
+ /**
60
+ * Force checking the layerMask property even if a custom list of meshes is provided (ie. if renderList is not undefined)
61
+ */
62
+ this.forceLayerMaskCheck = false;
59
63
  /**
60
64
  * Define if the camera viewport should be respected while rendering the texture or if the render should be done to the entire texture.
61
65
  */
@@ -126,7 +130,7 @@ export class RenderTargetTexture extends Texture {
126
130
  this._renderTargetOptions = {
127
131
  generateMipMaps: generateMipMaps,
128
132
  type: type,
129
- format: (_d = this._format) !== null && _d !== void 0 ? _d : undefined,
133
+ format: (_f = this._format) !== null && _f !== void 0 ? _f : undefined,
130
134
  samplingMode: this.samplingMode,
131
135
  generateDepthBuffer: generateDepthBuffer,
132
136
  generateStencilBuffer: generateStencilBuffer,
@@ -826,14 +830,14 @@ export class RenderTargetTexture extends Texture {
826
830
  // No custom render list provided, we prepare the rendering for the default list, but check
827
831
  // first if we did not already performed the preparation before so as to avoid re-doing it several times
828
832
  if (!this._defaultRenderListPrepared) {
829
- this._prepareRenderingManager(defaultRenderList, defaultRenderListLength, camera, !this.renderList);
833
+ this._prepareRenderingManager(defaultRenderList, defaultRenderListLength, camera, !this.renderList || this.forceLayerMaskCheck);
830
834
  this._defaultRenderListPrepared = true;
831
835
  }
832
836
  currentRenderList = defaultRenderList;
833
837
  }
834
838
  else {
835
839
  // Prepare the rendering for the custom render list provided
836
- this._prepareRenderingManager(currentRenderList, currentRenderList.length, camera, false);
840
+ this._prepareRenderingManager(currentRenderList, currentRenderList.length, camera, this.forceLayerMaskCheck);
837
841
  }
838
842
  // Before clear
839
843
  for (const step of scene._beforeRenderTargetClearStage) {