@babylonjs/core 8.8.5 → 8.9.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.
- package/Animations/animatable.core.js +2 -2
- package/Animations/animatable.core.js.map +1 -1
- package/Cameras/targetCamera.d.ts +0 -4
- package/Cameras/targetCamera.js +0 -28
- package/Cameras/targetCamera.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +22 -15
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
- package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.d.ts +1 -0
- package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js +8 -0
- package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +5 -2
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +5 -0
- package/Engines/constants.js +5 -0
- package/Engines/constants.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js +1 -1
- package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.d.ts +2 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +5 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.d.ts +3 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +26 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/Helpers/environmentHelper.js +3 -3
- package/Helpers/environmentHelper.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +1 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/PBR/pbrBRDFConfiguration.d.ts +30 -0
- package/Materials/PBR/pbrBRDFConfiguration.js +45 -0
- package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +0 -10
- package/Materials/PBR/pbrBaseMaterial.js +0 -13
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +0 -16
- package/Materials/PBR/pbrMaterial.decalMap.js +0 -5
- package/Materials/PBR/pbrMaterial.decalMap.js.map +1 -1
- package/Materials/PBR/pbrMaterial.js +1 -30
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +3 -1
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/effectRenderer.d.ts +1 -0
- package/Materials/effectRenderer.js +3 -1
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +7 -8
- package/Materials/shaderMaterial.js +21 -15
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.decalMap.js +0 -5
- package/Materials/standardMaterial.decalMap.js.map +1 -1
- package/Materials/standardMaterial.js +1 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.vector.d.ts +23 -17
- package/Maths/math.vector.js +144 -115
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Node/nodeGeometry.d.ts +1 -1
- package/Meshes/Node/nodeGeometry.js +1 -1
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/instancedMesh.js +12 -2
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +2 -2
- package/Meshes/mesh.js.map +1 -1
- package/Offline/database.d.ts +1 -1
- package/Offline/database.js +5 -5
- package/Offline/database.js.map +1 -1
- package/Rendering/depthPeelingRenderer.d.ts +1 -1
- package/Rendering/depthPeelingRenderer.js +1 -1
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.d.ts +1 -1
- package/Rendering/edgesRenderer.js +2 -2
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.d.ts +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +2 -2
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +2 -2
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/prePassEffectConfiguration.d.ts +5 -0
- package/Rendering/prePassEffectConfiguration.js.map +1 -1
- package/Rendering/prePassRenderer.js +3 -0
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.d.ts +6 -1
- package/Rendering/subSurfaceConfiguration.js +6 -1
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +15 -14
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js +3 -0
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflection.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +6 -2
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/pbr.fragment.js +2 -1
- package/Shaders/pbr.fragment.js.map +1 -1
- package/Shaders/pbr.vertex.d.ts +1 -0
- package/Shaders/pbr.vertex.js +5 -2
- package/Shaders/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +3 -0
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +7 -2
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +2 -1
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.vertex.d.ts +1 -0
- package/ShadersWGSL/pbr.vertex.js +5 -2
- package/ShadersWGSL/pbr.vertex.js.map +1 -1
- package/assetContainer.js +13 -13
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/sceneComponent.d.ts +1 -1
- package/sceneComponent.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeRenderGraph.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Node/nodeRenderGraph.ts"],"names":[],"mappings":";AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE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AAC,UAAU,GAAG,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC;;AA9vBc,iCAAiB,GAAW,CAAC,AAAZ,CAAa;AAI7C,gDAAgD;AAClC,yBAAS,GAAG,GAAG,KAAK,CAAC,cAAc,KAAK,MAAM,CAAC,OAAO,6CAA6C,AAA1F,CAA2F;AAElH,sCAAsC;AACxB,0BAAU,GAAG,SAAS,CAAC,UAAU,AAAvB,CAAwB;AAqDzC;IADN,SAAS,EAAE;6CACQ;AAMb;IADN,SAAS,CAAC,SAAS,CAAC;gDACE","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nimport type {\r\n Observer,\r\n Nullable,\r\n NodeRenderGraphBlock,\r\n NodeRenderGraphTeleportOutBlock,\r\n NodeRenderGraphTeleportInBlock,\r\n AbstractEngine,\r\n INodeRenderGraphCreateOptions,\r\n INodeRenderGraphEditorOptions,\r\n Scene,\r\n WritableObject,\r\n IShadowLight,\r\n} from \"core/index\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport { NodeRenderGraphOutputBlock } from \"./Blocks/outputBlock\";\r\nimport { FrameGraph } from \"../frameGraph\";\r\nimport { GetClass } from \"../../Misc/typeStore\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { WebRequest } from \"../../Misc/webRequest\";\r\nimport { NodeRenderGraphInputBlock } from \"./Blocks/inputBlock\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport { Engine } from \"../../Engines/engine\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"./Types/nodeRenderGraphTypes\";\r\nimport { NodeRenderGraphClearBlock } from \"./Blocks/Textures/clearBlock\";\r\nimport { NodeRenderGraphObjectRendererBlock } from \"./Blocks/Rendering/objectRendererBlock\";\r\nimport { NodeRenderGraphBuildState } from \"./nodeRenderGraphBuildState\";\r\n\r\n// declare NODERENDERGRAPHEDITOR namespace for compilation issue\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare let NODERENDERGRAPHEDITOR: any;\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Defines a node render graph\r\n */\r\nexport class NodeRenderGraph {\r\n private static _BuildIdGenerator: number = 0;\r\n\r\n private _buildId: number = NodeRenderGraph._BuildIdGenerator++;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${Engine.Version}/NodeRenderGraph/babylon.nodeRenderGraph.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private BJSNODERENDERGRAPHEDITOR = this._getGlobalNodeRenderGraphEditor();\r\n\r\n /** @returns the inspector from bundle or global */\r\n private _getGlobalNodeRenderGraphEditor(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof NODERENDERGRAPHEDITOR !== \"undefined\") {\r\n return NODERENDERGRAPHEDITOR;\r\n }\r\n\r\n // In case of module let's check the global emitted from the editor entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.NodeRenderGraphEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://nrge.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeRenderGraphBlock[] = [];\r\n\r\n /**\r\n * Observable raised when the node render graph is built\r\n */\r\n public onBuildObservable = new Observable<NodeRenderGraph>();\r\n\r\n /**\r\n * Observable raised when an error is detected\r\n */\r\n public onBuildErrorObservable = new Observable<string>();\r\n\r\n /** Gets or sets the RenderGraphOutputBlock used to gather the final node render graph data */\r\n public outputBlock: Nullable<NodeRenderGraphOutputBlock> = null;\r\n\r\n /**\r\n * Snippet ID if the graph was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * The name of the node render graph\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the graph\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n private readonly _engine: AbstractEngine;\r\n private readonly _scene: Scene;\r\n private readonly _resizeObserver: Nullable<Observer<AbstractEngine>> = null;\r\n private readonly _frameGraph: FrameGraph;\r\n private readonly _options: INodeRenderGraphCreateOptions;\r\n\r\n /**\r\n * Gets the frame graph used by this node render graph\r\n */\r\n public get frameGraph() {\r\n return this._frameGraph;\r\n }\r\n\r\n /**\r\n * Gets the scene used by this node render graph\r\n * @returns the scene used by this node render graph\r\n */\r\n public getScene() {\r\n return this._scene;\r\n }\r\n\r\n /**\r\n * Creates a new node render graph\r\n * @param name defines the name of the node render graph\r\n * @param scene defines the scene to use to execute the graph\r\n * @param options defines the options to use when creating the graph\r\n */\r\n public constructor(name: string, scene: Scene, options?: INodeRenderGraphCreateOptions) {\r\n this.name = name;\r\n this._scene = scene;\r\n this._engine = scene.getEngine();\r\n\r\n options = {\r\n debugTextures: false,\r\n autoConfigure: false,\r\n verbose: false,\r\n rebuildGraphOnEngineResize: true,\r\n autoFillExternalInputs: true,\r\n ...options,\r\n };\r\n\r\n this._options = options;\r\n\r\n this._frameGraph = new FrameGraph(this._scene, options.debugTextures, this);\r\n this._frameGraph.name = name;\r\n\r\n if (options.rebuildGraphOnEngineResize) {\r\n this._resizeObserver = this._engine.onResizeObservable.add(() => {\r\n this.build();\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Gets the current class name (\"NodeRenderGraph\")\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeRenderGraph\";\r\n }\r\n\r\n /**\r\n * Gets a block by its name\r\n * @param name defines the name of the block to retrieve\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByName<T extends NodeRenderGraphBlock>(name: string): Nullable<T> {\r\n let result: Nullable<T> = null;\r\n for (const block of this.attachedBlocks) {\r\n if (block.name === name) {\r\n if (!result) {\r\n result = block as T;\r\n } else {\r\n Tools.Warn(\"More than one block was found with the name `\" + name + \"`\");\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByPredicate<T extends NodeRenderGraphBlock>(predicate: (block: NodeRenderGraphBlock) => boolean): Nullable<T> {\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n return block as T;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Get all blocks that match a predicate\r\n * @param predicate defines the predicate used to find the good candidate(s)\r\n * @returns the list of blocks found\r\n */\r\n public getBlocksByPredicate<T extends NodeRenderGraphBlock>(predicate: (block: NodeRenderGraphBlock) => boolean): T[] {\r\n const blocks: T[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n blocks.push(block as T);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public getInputBlocks() {\r\n const blocks: NodeRenderGraphInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as NodeRenderGraphInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Launch the node render graph editor\r\n * @param config Define the configuration of the editor\r\n * @returns a promise fulfilled when the node editor is visible\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public async edit(config?: INodeRenderGraphEditorOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this.BJSNODERENDERGRAPHEDITOR = this.BJSNODERENDERGRAPHEDITOR || this._getGlobalNodeRenderGraphEditor();\r\n if (typeof this.BJSNODERENDERGRAPHEDITOR == \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : NodeRenderGraph.EditorURL;\r\n\r\n // Load editor and add it to the DOM\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this.BJSNODERENDERGRAPHEDITOR = this.BJSNODERENDERGRAPHEDITOR || this._getGlobalNodeRenderGraphEditor();\r\n this._createNodeEditor(config?.nodeRenderGraphEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n // Otherwise creates the editor\r\n this._createNodeEditor(config?.nodeRenderGraphEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates the node editor window.\r\n * @param additionalConfig Additional configuration for the FGE\r\n */\r\n private _createNodeEditor(additionalConfig?: any) {\r\n const nodeEditorConfig: any = {\r\n nodeRenderGraph: this,\r\n ...additionalConfig,\r\n };\r\n this.BJSNODERENDERGRAPHEDITOR.NodeRenderGraphEditor.Show(nodeEditorConfig);\r\n }\r\n\r\n /**\r\n * Build the final list of blocks that will be executed by the \"execute\" method\r\n */\r\n public build() {\r\n if (!this.outputBlock) {\r\n throw new Error(\"You must define the outputBlock property before building the node render graph\");\r\n }\r\n\r\n this._initializeBlock(this.outputBlock);\r\n\r\n this._frameGraph.clear();\r\n\r\n const state = new NodeRenderGraphBuildState();\r\n\r\n state.buildId = this._buildId;\r\n state.verbose = this._options.verbose!;\r\n\r\n if (this._options.autoFillExternalInputs) {\r\n this._autoFillExternalInputs();\r\n }\r\n\r\n try {\r\n this.outputBlock.build(state);\r\n\r\n this._frameGraph.build();\r\n } finally {\r\n this._buildId = NodeRenderGraph._BuildIdGenerator++;\r\n\r\n if (state.emitErrors(this.onBuildErrorObservable)) {\r\n this.onBuildObservable.notifyObservers(this);\r\n }\r\n }\r\n }\r\n\r\n private _autoFillExternalInputs() {\r\n const allInputs = this.getInputBlocks();\r\n\r\n const shadowLights: IShadowLight[] = [];\r\n for (const light of this._scene.lights) {\r\n if ((light as IShadowLight).setShadowProjectionMatrix !== undefined) {\r\n shadowLights.push(light as IShadowLight);\r\n }\r\n }\r\n\r\n let cameraIndex = 0;\r\n let lightIndex = 0;\r\n for (const input of allInputs) {\r\n if (!input.isExternal) {\r\n continue;\r\n }\r\n if (!input.isAnAncestorOfType(\"NodeRenderGraphOutputBlock\")) {\r\n continue;\r\n }\r\n if ((input.type & NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer) !== 0) {\r\n // nothing to do\r\n } else if (input.isCamera()) {\r\n const camera = this._scene.cameras[cameraIndex++] || this._scene.cameras[0];\r\n if (!this._scene.cameraToUseForPointers) {\r\n this._scene.cameraToUseForPointers = camera;\r\n }\r\n\r\n input.value = camera;\r\n } else if (input.isObjectList()) {\r\n input.value = { meshes: this._scene.meshes, particleSystems: this._scene.particleSystems };\r\n } else if (input.isShadowLight()) {\r\n if (lightIndex < shadowLights.length) {\r\n input.value = shadowLights[lightIndex++];\r\n lightIndex = lightIndex % shadowLights.length;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Returns a promise that resolves when the node render graph is ready to be executed\r\n * This method must be called after the graph has been built (NodeRenderGraph.build called)!\r\n * @param timeStep Time step in ms between retries (default is 16)\r\n * @param maxTimeout Maximum time in ms to wait for the graph to be ready (default is 30000)\r\n * @returns The promise that resolves when the graph is ready\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public whenReadyAsync(timeStep = 16, maxTimeout = 30000): Promise<void> {\r\n return this._frameGraph.whenReadyAsync(timeStep, maxTimeout);\r\n }\r\n\r\n /**\r\n * Execute the graph (the graph must have been built before!)\r\n */\r\n public execute() {\r\n this._frameGraph.execute();\r\n }\r\n\r\n private _initializeBlock(node: NodeRenderGraphBlock) {\r\n node.initialize();\r\n if (this._options.autoConfigure) {\r\n node.autoConfigure();\r\n }\r\n\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph\r\n */\r\n public clear() {\r\n this.outputBlock = null;\r\n this.attachedBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Remove a block from the current graph\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeRenderGraphBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block === this.outputBlock) {\r\n this.outputBlock = null;\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the graph\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeRenderGraphBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType: typeof NodeRenderGraphBlock = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const additionalConstructionParameters = parsedBlock.additionalConstructionParameters;\r\n const block: NodeRenderGraphBlock = additionalConstructionParameters\r\n ? new blockType(\"\", this._frameGraph, this._scene, ...additionalConstructionParameters)\r\n : new blockType(\"\", this._frameGraph, this._scene);\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as NodeRenderGraphTeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as NodeRenderGraphTeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // Outputs\r\n if (source.outputNodeId) {\r\n this.outputBlock = map[source.outputNodeId] as NodeRenderGraphOutputBlock;\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: number[] = [];\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeRenderGraphBlock, source: any, map: { [key: number]: NodeRenderGraphBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Generate a string containing the code declaration required to create an equivalent of this node render graph\r\n * @returns a string\r\n */\r\n public generateCode() {\r\n let alreadyDumped: NodeRenderGraphBlock[] = [];\r\n const blocks: NodeRenderGraphBlock[] = [];\r\n const uniqueNames: string[] = [\"const\", \"var\", \"let\"];\r\n // Gets active blocks\r\n if (this.outputBlock) {\r\n this._gatherBlocks(this.outputBlock, blocks);\r\n }\r\n\r\n // Generate\r\n const options = JSON.stringify(this._options);\r\n let codeString = `let nodeRenderGraph = new BABYLON.NodeRenderGraph(\"${this.name || \"render graph\"}\", scene, ${options});\\n`;\r\n for (const node of blocks) {\r\n if (node.isInput && alreadyDumped.indexOf(node) === -1) {\r\n codeString += node._dumpCode(uniqueNames, alreadyDumped) + \"\\n\";\r\n }\r\n }\r\n\r\n if (this.outputBlock) {\r\n // Connections\r\n alreadyDumped = [];\r\n codeString += \"// Connections\\n\";\r\n codeString += this.outputBlock._dumpCodeForOutputConnections(alreadyDumped);\r\n\r\n // Output nodes\r\n codeString += \"// Output nodes\\n\";\r\n codeString += `nodeRenderGraph.outputBlock = ${this.outputBlock._codeVariableName};\\n`;\r\n codeString += `nodeRenderGraph.build();\\n`;\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n private _gatherBlocks(rootNode: NodeRenderGraphBlock, list: NodeRenderGraphBlock[]) {\r\n if (list.indexOf(rootNode) !== -1) {\r\n return;\r\n }\r\n list.push(rootNode);\r\n\r\n for (const input of rootNode.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== rootNode) {\r\n this._gatherBlocks(block, list);\r\n }\r\n }\r\n }\r\n\r\n // Teleportation\r\n if (rootNode.isTeleportOut) {\r\n const block = rootNode as NodeRenderGraphTeleportOutBlock;\r\n if (block.entryPoint) {\r\n this._gatherBlocks(block.entryPoint, list);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and set it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Source textures\r\n const colorTexture = new NodeRenderGraphInputBlock(\"Color Texture\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n colorTexture.creationOptions.options.samples = 4;\r\n\r\n const depthTexture = new NodeRenderGraphInputBlock(\"Depth Texture\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\r\n depthTexture.creationOptions.options.samples = 4;\r\n\r\n // Clear texture\r\n const clear = new NodeRenderGraphClearBlock(\"Clear\", this._frameGraph, this._scene);\r\n clear.clearDepth = true;\r\n clear.clearStencil = true;\r\n\r\n colorTexture.output.connectTo(clear.target);\r\n depthTexture.output.connectTo(clear.depth);\r\n\r\n // Render objects\r\n const camera = new NodeRenderGraphInputBlock(\"Camera\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n const objectList = new NodeRenderGraphInputBlock(\"Object List\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n\r\n const mainRendering = new NodeRenderGraphObjectRendererBlock(\"Main Rendering\", this._frameGraph, this._scene);\r\n\r\n camera.output.connectTo(mainRendering.camera);\r\n objectList.output.connectTo(mainRendering.objects);\r\n clear.output.connectTo(mainRendering.target);\r\n clear.outputDepth.connectTo(mainRendering.depth);\r\n\r\n // Final output\r\n const output = new NodeRenderGraphOutputBlock(\"Output\", this._frameGraph, this._scene);\r\n mainRendering.output.connectTo(output.texture);\r\n\r\n this.outputBlock = output;\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current node render graph.\r\n * @param name defines the name to use for the new node render graph\r\n * @returns the new node render graph\r\n */\r\n public clone(name: string): NodeRenderGraph {\r\n const serializationObject = this.serialize();\r\n\r\n const clone = SerializationHelper.Clone(() => new NodeRenderGraph(name, this._scene), this);\r\n clone.name = name;\r\n\r\n clone.parseSerializedObject(serializationObject);\r\n clone._buildId = this._buildId;\r\n clone.build();\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serializes this node render graph in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole node render graph will be saved)\r\n * @returns the serialized node render graph object\r\n */\r\n public serialize(selectedBlocks?: NodeRenderGraphBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeRenderGraphBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeRenderGraph\";\r\n if (this.outputBlock) {\r\n serializationObject.outputNodeId = this.outputBlock.uniqueId;\r\n }\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Disposes the ressources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this._frameGraph.dispose();\r\n (this._frameGraph as WritableObject<FrameGraph>) = undefined as any;\r\n\r\n this._engine.onResizeObservable.remove(this._resizeObserver);\r\n (this._resizeObserver as WritableObject<Nullable<Observer<AbstractEngine>>>) = null;\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildObservable.clear();\r\n this.onBuildErrorObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node render graph set to default basic configuration\r\n * @param name defines the name of the node render graph\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render graph\r\n * @returns a new NodeRenderGraph\r\n */\r\n public static CreateDefault(name: string, scene: Scene, nodeRenderGraphOptions?: INodeRenderGraphCreateOptions): NodeRenderGraph {\r\n const renderGraph = new NodeRenderGraph(name, scene, nodeRenderGraphOptions);\r\n\r\n renderGraph.setToDefault();\r\n renderGraph.build();\r\n\r\n return renderGraph;\r\n }\r\n\r\n /**\r\n * Creates a node render graph from parsed graph data\r\n * @param source defines the JSON representation of the node render graph\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render\r\n * @param skipBuild defines whether to skip building the node render graph (default is true)\r\n * @returns a new node render graph\r\n */\r\n public static Parse(source: any, scene: Scene, nodeRenderGraphOptions?: INodeRenderGraphCreateOptions, skipBuild: boolean = true): NodeRenderGraph {\r\n const renderGraph = SerializationHelper.Parse(() => new NodeRenderGraph(source.name, scene, nodeRenderGraphOptions), source, null);\r\n\r\n renderGraph.parseSerializedObject(source);\r\n if (!skipBuild) {\r\n renderGraph.build();\r\n }\r\n\r\n return renderGraph;\r\n }\r\n\r\n /**\r\n * Creates a node render graph from a snippet saved by the node render graph editor\r\n * @param snippetId defines the snippet to load\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render graph\r\n * @param nodeRenderGraph defines a node render graph to update (instead of creating a new one)\r\n * @param skipBuild defines whether to skip building the node render graph (default is true)\r\n * @returns a promise that will resolve to the new node render graph\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(\r\n snippetId: string,\r\n scene: Scene,\r\n nodeRenderGraphOptions?: INodeRenderGraphCreateOptions,\r\n nodeRenderGraph?: NodeRenderGraph,\r\n skipBuild: boolean = true\r\n ): Promise<NodeRenderGraph> {\r\n if (snippetId === \"_BLANK\") {\r\n return Promise.resolve(NodeRenderGraph.CreateDefault(\"blank\", scene, nodeRenderGraphOptions));\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeRenderGraph);\r\n\r\n if (!nodeRenderGraph) {\r\n nodeRenderGraph = SerializationHelper.Parse(() => new NodeRenderGraph(snippetId, scene, nodeRenderGraphOptions), serializationObject, null);\r\n }\r\n\r\n nodeRenderGraph.parseSerializedObject(serializationObject);\r\n nodeRenderGraph.snippetId = snippetId;\r\n\r\n try {\r\n if (!skipBuild) {\r\n nodeRenderGraph.build();\r\n }\r\n resolve(nodeRenderGraph);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"nodeRenderGraph.js","sourceRoot":"","sources":["../../../../../dev/core/src/FrameGraph/Node/nodeRenderGraph.ts"],"names":[],"mappings":";AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,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MAAM,CAAC,OAAO,6CAA6C,AAA1F,CAA2F;AAElH,sCAAsC;AACxB,0BAAU,GAAG,SAAS,CAAC,UAAU,AAAvB,CAAwB;AAqDzC;IADN,SAAS,EAAE;6CACQ;AAMb;IADN,SAAS,CAAC,SAAS,CAAC;gDACE","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nimport type {\r\n Observer,\r\n Nullable,\r\n NodeRenderGraphBlock,\r\n NodeRenderGraphTeleportOutBlock,\r\n NodeRenderGraphTeleportInBlock,\r\n AbstractEngine,\r\n INodeRenderGraphCreateOptions,\r\n INodeRenderGraphEditorOptions,\r\n Scene,\r\n WritableObject,\r\n IShadowLight,\r\n} from \"core/index\";\r\nimport { Observable } from \"../../Misc/observable\";\r\nimport { NodeRenderGraphOutputBlock } from \"./Blocks/outputBlock\";\r\nimport { FrameGraph } from \"../frameGraph\";\r\nimport { GetClass } from \"../../Misc/typeStore\";\r\nimport { serialize } from \"../../Misc/decorators\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport { WebRequest } from \"../../Misc/webRequest\";\r\nimport { NodeRenderGraphInputBlock } from \"./Blocks/inputBlock\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport { Engine } from \"../../Engines/engine\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"./Types/nodeRenderGraphTypes\";\r\nimport { NodeRenderGraphClearBlock } from \"./Blocks/Textures/clearBlock\";\r\nimport { NodeRenderGraphObjectRendererBlock } from \"./Blocks/Rendering/objectRendererBlock\";\r\nimport { NodeRenderGraphBuildState } from \"./nodeRenderGraphBuildState\";\r\n\r\n// declare NODERENDERGRAPHEDITOR namespace for compilation issue\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare let NODERENDERGRAPHEDITOR: any;\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\ndeclare let BABYLON: any;\r\n\r\n/**\r\n * Defines a node render graph\r\n */\r\nexport class NodeRenderGraph {\r\n private static _BuildIdGenerator: number = 0;\r\n\r\n private _buildId: number = NodeRenderGraph._BuildIdGenerator++;\r\n\r\n /** Define the Url to load node editor script */\r\n public static EditorURL = `${Tools._DefaultCdnUrl}/v${Engine.Version}/NodeRenderGraph/babylon.nodeRenderGraph.js`;\r\n\r\n /** Define the Url to load snippets */\r\n public static SnippetUrl = Constants.SnippetUrl;\r\n\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n private BJSNODERENDERGRAPHEDITOR = this._getGlobalNodeRenderGraphEditor();\r\n\r\n /** @returns the inspector from bundle or global */\r\n private _getGlobalNodeRenderGraphEditor(): any {\r\n // UMD Global name detection from Webpack Bundle UMD Name.\r\n if (typeof NODERENDERGRAPHEDITOR !== \"undefined\") {\r\n return NODERENDERGRAPHEDITOR;\r\n }\r\n\r\n // In case of module let's check the global emitted from the editor entry point.\r\n if (typeof BABYLON !== \"undefined\" && typeof BABYLON.NodeRenderGraphEditor !== \"undefined\") {\r\n return BABYLON;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Gets or sets data used by visual editor\r\n * @see https://nrge.babylonjs.com\r\n */\r\n public editorData: any = null;\r\n\r\n /**\r\n * Gets an array of blocks that needs to be serialized even if they are not yet connected\r\n */\r\n public attachedBlocks: NodeRenderGraphBlock[] = [];\r\n\r\n /**\r\n * Observable raised when the node render graph is built\r\n */\r\n public onBuildObservable = new Observable<NodeRenderGraph>();\r\n\r\n /**\r\n * Observable raised when an error is detected\r\n */\r\n public onBuildErrorObservable = new Observable<string>();\r\n\r\n /** Gets or sets the RenderGraphOutputBlock used to gather the final node render graph data */\r\n public outputBlock: Nullable<NodeRenderGraphOutputBlock> = null;\r\n\r\n /**\r\n * Snippet ID if the graph was created from the snippet server\r\n */\r\n public snippetId: string;\r\n\r\n /**\r\n * The name of the node render graph\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * A free comment about the graph\r\n */\r\n @serialize(\"comment\")\r\n public comment: string;\r\n\r\n private readonly _engine: AbstractEngine;\r\n private readonly _scene: Scene;\r\n private readonly _resizeObserver: Nullable<Observer<AbstractEngine>> = null;\r\n private readonly _frameGraph: FrameGraph;\r\n private readonly _options: INodeRenderGraphCreateOptions;\r\n\r\n /**\r\n * Gets the frame graph used by this node render graph\r\n */\r\n public get frameGraph() {\r\n return this._frameGraph;\r\n }\r\n\r\n /**\r\n * Gets the scene used by this node render graph\r\n * @returns the scene used by this node render graph\r\n */\r\n public getScene() {\r\n return this._scene;\r\n }\r\n\r\n /**\r\n * Creates a new node render graph\r\n * @param name defines the name of the node render graph\r\n * @param scene defines the scene to use to execute the graph\r\n * @param options defines the options to use when creating the graph\r\n */\r\n public constructor(name: string, scene: Scene, options?: INodeRenderGraphCreateOptions) {\r\n this.name = name;\r\n this._scene = scene;\r\n this._engine = scene.getEngine();\r\n\r\n options = {\r\n debugTextures: false,\r\n autoConfigure: false,\r\n verbose: false,\r\n rebuildGraphOnEngineResize: true,\r\n autoFillExternalInputs: true,\r\n ...options,\r\n };\r\n\r\n this._options = options;\r\n\r\n this._frameGraph = new FrameGraph(this._scene, options.debugTextures, this);\r\n this._frameGraph.name = name;\r\n\r\n if (options.rebuildGraphOnEngineResize) {\r\n this._resizeObserver = this._engine.onResizeObservable.add(() => {\r\n this.build();\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Gets the current class name (\"NodeRenderGraph\")\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"NodeRenderGraph\";\r\n }\r\n\r\n /**\r\n * Gets a block by its name\r\n * @param name defines the name of the block to retrieve\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByName<T extends NodeRenderGraphBlock>(name: string): Nullable<T> {\r\n let result: Nullable<T> = null;\r\n for (const block of this.attachedBlocks) {\r\n if (block.name === name) {\r\n if (!result) {\r\n result = block as T;\r\n } else {\r\n Tools.Warn(\"More than one block was found with the name `\" + name + \"`\");\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Get a block using a predicate\r\n * @param predicate defines the predicate used to find the good candidate\r\n * @returns the required block or null if not found\r\n */\r\n public getBlockByPredicate<T extends NodeRenderGraphBlock>(predicate: (block: NodeRenderGraphBlock) => boolean): Nullable<T> {\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n return block as T;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Get all blocks that match a predicate\r\n * @param predicate defines the predicate used to find the good candidate(s)\r\n * @returns the list of blocks found\r\n */\r\n public getBlocksByPredicate<T extends NodeRenderGraphBlock>(predicate: (block: NodeRenderGraphBlock) => boolean): T[] {\r\n const blocks: T[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (predicate(block)) {\r\n blocks.push(block as T);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Gets the list of input blocks attached to this material\r\n * @returns an array of InputBlocks\r\n */\r\n public getInputBlocks() {\r\n const blocks: NodeRenderGraphInputBlock[] = [];\r\n for (const block of this.attachedBlocks) {\r\n if (block.isInput) {\r\n blocks.push(block as NodeRenderGraphInputBlock);\r\n }\r\n }\r\n\r\n return blocks;\r\n }\r\n\r\n /**\r\n * Launch the node render graph editor\r\n * @param config Define the configuration of the editor\r\n * @returns a promise fulfilled when the node editor is visible\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public async edit(config?: INodeRenderGraphEditorOptions): Promise<void> {\r\n return await new Promise((resolve) => {\r\n this.BJSNODERENDERGRAPHEDITOR = this.BJSNODERENDERGRAPHEDITOR || this._getGlobalNodeRenderGraphEditor();\r\n if (typeof this.BJSNODERENDERGRAPHEDITOR == \"undefined\") {\r\n const editorUrl = config && config.editorURL ? config.editorURL : NodeRenderGraph.EditorURL;\r\n\r\n // Load editor and add it to the DOM\r\n Tools.LoadBabylonScript(editorUrl, () => {\r\n this.BJSNODERENDERGRAPHEDITOR = this.BJSNODERENDERGRAPHEDITOR || this._getGlobalNodeRenderGraphEditor();\r\n this._createNodeEditor(config?.nodeRenderGraphEditorConfig);\r\n resolve();\r\n });\r\n } else {\r\n // Otherwise creates the editor\r\n this._createNodeEditor(config?.nodeRenderGraphEditorConfig);\r\n resolve();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates the node editor window.\r\n * @param additionalConfig Additional configuration for the FGE\r\n */\r\n private _createNodeEditor(additionalConfig?: any) {\r\n const nodeEditorConfig: any = {\r\n nodeRenderGraph: this,\r\n ...additionalConfig,\r\n };\r\n this.BJSNODERENDERGRAPHEDITOR.NodeRenderGraphEditor.Show(nodeEditorConfig);\r\n }\r\n\r\n /**\r\n * Build the final list of blocks that will be executed by the \"execute\" method\r\n */\r\n public build() {\r\n if (!this.outputBlock) {\r\n throw new Error(\"You must define the outputBlock property before building the node render graph\");\r\n }\r\n\r\n this._initializeBlock(this.outputBlock);\r\n\r\n this._frameGraph.clear();\r\n\r\n const state = new NodeRenderGraphBuildState();\r\n\r\n state.buildId = this._buildId;\r\n state.verbose = this._options.verbose!;\r\n\r\n if (this._options.autoFillExternalInputs) {\r\n this._autoFillExternalInputs();\r\n }\r\n\r\n try {\r\n this.outputBlock.build(state);\r\n\r\n this._frameGraph.build();\r\n } finally {\r\n this._buildId = NodeRenderGraph._BuildIdGenerator++;\r\n\r\n if (state.emitErrors(this.onBuildErrorObservable)) {\r\n this.onBuildObservable.notifyObservers(this);\r\n }\r\n }\r\n }\r\n\r\n private _autoFillExternalInputs() {\r\n const allInputs = this.getInputBlocks();\r\n\r\n const shadowLights: IShadowLight[] = [];\r\n for (const light of this._scene.lights) {\r\n if ((light as IShadowLight).setShadowProjectionMatrix !== undefined) {\r\n shadowLights.push(light as IShadowLight);\r\n }\r\n }\r\n\r\n let cameraIndex = 0;\r\n let lightIndex = 0;\r\n for (const input of allInputs) {\r\n if (!input.isExternal) {\r\n continue;\r\n }\r\n if (!input.isAnAncestorOfType(\"NodeRenderGraphOutputBlock\")) {\r\n continue;\r\n }\r\n if ((input.type & NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer) !== 0) {\r\n // nothing to do\r\n } else if (input.isCamera()) {\r\n const camera = this._scene.cameras[cameraIndex++] || this._scene.cameras[0];\r\n if (!this._scene.cameraToUseForPointers) {\r\n this._scene.cameraToUseForPointers = camera;\r\n }\r\n\r\n input.value = camera;\r\n } else if (input.isObjectList()) {\r\n input.value = { meshes: this._scene.meshes, particleSystems: this._scene.particleSystems };\r\n } else if (input.isShadowLight()) {\r\n if (lightIndex < shadowLights.length) {\r\n input.value = shadowLights[lightIndex++];\r\n lightIndex = lightIndex % shadowLights.length;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Returns a promise that resolves when the node render graph is ready to be executed\r\n * This method must be called after the graph has been built (NodeRenderGraph.build called)!\r\n * @param timeStep Time step in ms between retries (default is 16)\r\n * @param maxTimeout Maximum time in ms to wait for the graph to be ready (default is 30000)\r\n * @returns The promise that resolves when the graph is ready\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public whenReadyAsync(timeStep = 16, maxTimeout = 30000): Promise<void> {\r\n return this._frameGraph.whenReadyAsync(timeStep, maxTimeout);\r\n }\r\n\r\n /**\r\n * Execute the graph (the graph must have been built before!)\r\n */\r\n public execute() {\r\n this._frameGraph.execute();\r\n }\r\n\r\n private _initializeBlock(node: NodeRenderGraphBlock) {\r\n node.initialize();\r\n if (this._options.autoConfigure) {\r\n node.autoConfigure();\r\n }\r\n\r\n if (this.attachedBlocks.indexOf(node) === -1) {\r\n this.attachedBlocks.push(node);\r\n }\r\n\r\n for (const input of node.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== node) {\r\n this._initializeBlock(block);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph\r\n */\r\n public clear() {\r\n this.outputBlock = null;\r\n this.attachedBlocks.length = 0;\r\n }\r\n\r\n /**\r\n * Remove a block from the current graph\r\n * @param block defines the block to remove\r\n */\r\n public removeBlock(block: NodeRenderGraphBlock) {\r\n const attachedBlockIndex = this.attachedBlocks.indexOf(block);\r\n if (attachedBlockIndex > -1) {\r\n this.attachedBlocks.splice(attachedBlockIndex, 1);\r\n }\r\n\r\n if (block === this.outputBlock) {\r\n this.outputBlock = null;\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and load a new one from a serialization object\r\n * @param source defines the JSON representation of the graph\r\n * @param merge defines whether or not the source must be merged or replace the current content\r\n */\r\n public parseSerializedObject(source: any, merge = false) {\r\n if (!merge) {\r\n this.clear();\r\n }\r\n\r\n const map: { [key: number]: NodeRenderGraphBlock } = {};\r\n\r\n // Create blocks\r\n for (const parsedBlock of source.blocks) {\r\n const blockType: typeof NodeRenderGraphBlock = GetClass(parsedBlock.customType);\r\n if (blockType) {\r\n const additionalConstructionParameters = parsedBlock.additionalConstructionParameters;\r\n const block: NodeRenderGraphBlock = additionalConstructionParameters\r\n ? new blockType(\"\", this._frameGraph, this._scene, ...additionalConstructionParameters)\r\n : new blockType(\"\", this._frameGraph, this._scene);\r\n block._deserialize(parsedBlock);\r\n map[parsedBlock.id] = block;\r\n\r\n this.attachedBlocks.push(block);\r\n }\r\n }\r\n\r\n // Reconnect teleportation\r\n for (const block of this.attachedBlocks) {\r\n if (block.isTeleportOut) {\r\n const teleportOut = block as NodeRenderGraphTeleportOutBlock;\r\n const id = teleportOut._tempEntryPointUniqueId;\r\n if (id) {\r\n const source = map[id] as NodeRenderGraphTeleportInBlock;\r\n if (source) {\r\n source.attachToEndpoint(teleportOut);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Connections - Starts with input blocks only (except if in \"merge\" mode where we scan all blocks)\r\n for (let blockIndex = 0; blockIndex < source.blocks.length; blockIndex++) {\r\n const parsedBlock = source.blocks[blockIndex];\r\n const block = map[parsedBlock.id];\r\n\r\n if (!block) {\r\n continue;\r\n }\r\n\r\n if (block.inputs.length && parsedBlock.inputs.some((i: any) => i.targetConnectionName) && !merge) {\r\n continue;\r\n }\r\n this._restoreConnections(block, source, map);\r\n }\r\n\r\n // Outputs\r\n if (source.outputNodeId) {\r\n this.outputBlock = map[source.outputNodeId] as NodeRenderGraphOutputBlock;\r\n }\r\n\r\n // UI related info\r\n if (source.locations || (source.editorData && source.editorData.locations)) {\r\n const locations: {\r\n blockId: number;\r\n x: number;\r\n y: number;\r\n isCollapsed: boolean;\r\n }[] = source.locations || source.editorData.locations;\r\n\r\n for (const location of locations) {\r\n if (map[location.blockId]) {\r\n location.blockId = map[location.blockId].uniqueId;\r\n }\r\n }\r\n\r\n if (merge && this.editorData && this.editorData.locations) {\r\n locations.concat(this.editorData.locations);\r\n }\r\n\r\n if (source.locations) {\r\n this.editorData = {\r\n locations: locations,\r\n };\r\n } else {\r\n this.editorData = source.editorData;\r\n this.editorData.locations = locations;\r\n }\r\n\r\n const blockMap: number[] = [];\r\n\r\n for (const key in map) {\r\n blockMap[key] = map[key].uniqueId;\r\n }\r\n\r\n this.editorData.map = blockMap;\r\n }\r\n\r\n this.comment = source.comment;\r\n }\r\n\r\n private _restoreConnections(block: NodeRenderGraphBlock, source: any, map: { [key: number]: NodeRenderGraphBlock }) {\r\n for (const outputPoint of block.outputs) {\r\n for (const candidate of source.blocks) {\r\n const target = map[candidate.id];\r\n\r\n if (!target) {\r\n continue;\r\n }\r\n\r\n for (const input of candidate.inputs) {\r\n if (map[input.targetBlockId] === block && input.targetConnectionName === outputPoint.name) {\r\n const inputPoint = target.getInputByName(input.inputName);\r\n if (!inputPoint || inputPoint.isConnected) {\r\n continue;\r\n }\r\n\r\n outputPoint.connectTo(inputPoint, true);\r\n this._restoreConnections(target, source, map);\r\n continue;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Generate a string containing the code declaration required to create an equivalent of this node render graph\r\n * @returns a string\r\n */\r\n public generateCode() {\r\n let alreadyDumped: NodeRenderGraphBlock[] = [];\r\n const blocks: NodeRenderGraphBlock[] = [];\r\n const uniqueNames: string[] = [\"const\", \"var\", \"let\"];\r\n // Gets active blocks\r\n if (this.outputBlock) {\r\n this._gatherBlocks(this.outputBlock, blocks);\r\n }\r\n\r\n // Generate\r\n const options = JSON.stringify(this._options);\r\n let codeString = `let nodeRenderGraph = new BABYLON.NodeRenderGraph(\"${this.name || \"render graph\"}\", scene, ${options});\\n`;\r\n for (const node of blocks) {\r\n if (node.isInput && alreadyDumped.indexOf(node) === -1) {\r\n codeString += node._dumpCode(uniqueNames, alreadyDumped) + \"\\n\";\r\n }\r\n }\r\n\r\n if (this.outputBlock) {\r\n // Connections\r\n alreadyDumped = [];\r\n codeString += \"// Connections\\n\";\r\n codeString += this.outputBlock._dumpCodeForOutputConnections(alreadyDumped);\r\n\r\n // Output nodes\r\n codeString += \"// Output nodes\\n\";\r\n codeString += `nodeRenderGraph.outputBlock = ${this.outputBlock._codeVariableName};\\n`;\r\n codeString += `nodeRenderGraph.build();\\n`;\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n private _gatherBlocks(rootNode: NodeRenderGraphBlock, list: NodeRenderGraphBlock[]) {\r\n if (list.indexOf(rootNode) !== -1) {\r\n return;\r\n }\r\n list.push(rootNode);\r\n\r\n for (const input of rootNode.inputs) {\r\n const connectedPoint = input.connectedPoint;\r\n if (connectedPoint) {\r\n const block = connectedPoint.ownerBlock;\r\n if (block !== rootNode) {\r\n this._gatherBlocks(block, list);\r\n }\r\n }\r\n }\r\n\r\n // Teleportation\r\n if (rootNode.isTeleportOut) {\r\n const block = rootNode as NodeRenderGraphTeleportOutBlock;\r\n if (block.entryPoint) {\r\n this._gatherBlocks(block.entryPoint, list);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Clear the current graph and set it to a default state\r\n */\r\n public setToDefault() {\r\n this.clear();\r\n\r\n this.editorData = null;\r\n\r\n // Source textures\r\n const colorTexture = new NodeRenderGraphInputBlock(\"Color Texture\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n colorTexture.creationOptions.options.samples = 4;\r\n\r\n const depthTexture = new NodeRenderGraphInputBlock(\"Depth Texture\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);\r\n depthTexture.creationOptions.options.samples = 4;\r\n\r\n // Clear texture\r\n const clear = new NodeRenderGraphClearBlock(\"Clear\", this._frameGraph, this._scene);\r\n clear.clearDepth = true;\r\n clear.clearStencil = true;\r\n\r\n colorTexture.output.connectTo(clear.target);\r\n depthTexture.output.connectTo(clear.depth);\r\n\r\n // Render objects\r\n const camera = new NodeRenderGraphInputBlock(\"Camera\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n const objectList = new NodeRenderGraphInputBlock(\"Object List\", this._frameGraph, this._scene, NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n\r\n const mainRendering = new NodeRenderGraphObjectRendererBlock(\"Main Rendering\", this._frameGraph, this._scene);\r\n\r\n camera.output.connectTo(mainRendering.camera);\r\n objectList.output.connectTo(mainRendering.objects);\r\n clear.output.connectTo(mainRendering.target);\r\n clear.outputDepth.connectTo(mainRendering.depth);\r\n\r\n // Final output\r\n const output = new NodeRenderGraphOutputBlock(\"Output\", this._frameGraph, this._scene);\r\n mainRendering.output.connectTo(output.texture);\r\n\r\n this.outputBlock = output;\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current node render graph.\r\n * @param name defines the name to use for the new node render graph\r\n * @returns the new node render graph\r\n */\r\n public clone(name: string): NodeRenderGraph {\r\n const serializationObject = this.serialize();\r\n\r\n const clone = SerializationHelper.Clone(() => new NodeRenderGraph(name, this._scene), this);\r\n clone.name = name;\r\n\r\n clone.parseSerializedObject(serializationObject);\r\n clone._buildId = this._buildId;\r\n clone.build();\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serializes this node render graph in a JSON representation\r\n * @param selectedBlocks defines the list of blocks to save (if null the whole node render graph will be saved)\r\n * @returns the serialized node render graph object\r\n */\r\n public serialize(selectedBlocks?: NodeRenderGraphBlock[]): any {\r\n const serializationObject = selectedBlocks ? {} : SerializationHelper.Serialize(this);\r\n serializationObject.editorData = JSON.parse(JSON.stringify(this.editorData)); // Copy\r\n\r\n let blocks: NodeRenderGraphBlock[] = [];\r\n\r\n if (selectedBlocks) {\r\n blocks = selectedBlocks;\r\n } else {\r\n serializationObject.customType = \"BABYLON.NodeRenderGraph\";\r\n if (this.outputBlock) {\r\n serializationObject.outputNodeId = this.outputBlock.uniqueId;\r\n }\r\n }\r\n\r\n // Blocks\r\n serializationObject.blocks = [];\r\n\r\n for (const block of blocks) {\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n\r\n if (!selectedBlocks) {\r\n for (const block of this.attachedBlocks) {\r\n if (blocks.indexOf(block) !== -1) {\r\n continue;\r\n }\r\n serializationObject.blocks.push(block.serialize());\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Disposes the resources\r\n */\r\n public dispose(): void {\r\n for (const block of this.attachedBlocks) {\r\n block.dispose();\r\n }\r\n\r\n this._frameGraph.dispose();\r\n (this._frameGraph as WritableObject<FrameGraph>) = undefined as any;\r\n\r\n this._engine.onResizeObservable.remove(this._resizeObserver);\r\n (this._resizeObserver as WritableObject<Nullable<Observer<AbstractEngine>>>) = null;\r\n\r\n this.attachedBlocks.length = 0;\r\n this.onBuildObservable.clear();\r\n this.onBuildErrorObservable.clear();\r\n }\r\n\r\n /**\r\n * Creates a new node render graph set to default basic configuration\r\n * @param name defines the name of the node render graph\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render graph\r\n * @returns a new NodeRenderGraph\r\n */\r\n public static CreateDefault(name: string, scene: Scene, nodeRenderGraphOptions?: INodeRenderGraphCreateOptions): NodeRenderGraph {\r\n const renderGraph = new NodeRenderGraph(name, scene, nodeRenderGraphOptions);\r\n\r\n renderGraph.setToDefault();\r\n renderGraph.build();\r\n\r\n return renderGraph;\r\n }\r\n\r\n /**\r\n * Creates a node render graph from parsed graph data\r\n * @param source defines the JSON representation of the node render graph\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render\r\n * @param skipBuild defines whether to skip building the node render graph (default is true)\r\n * @returns a new node render graph\r\n */\r\n public static Parse(source: any, scene: Scene, nodeRenderGraphOptions?: INodeRenderGraphCreateOptions, skipBuild: boolean = true): NodeRenderGraph {\r\n const renderGraph = SerializationHelper.Parse(() => new NodeRenderGraph(source.name, scene, nodeRenderGraphOptions), source, null);\r\n\r\n renderGraph.parseSerializedObject(source);\r\n if (!skipBuild) {\r\n renderGraph.build();\r\n }\r\n\r\n return renderGraph;\r\n }\r\n\r\n /**\r\n * Creates a node render graph from a snippet saved by the node render graph editor\r\n * @param snippetId defines the snippet to load\r\n * @param scene defines the scene to use\r\n * @param nodeRenderGraphOptions defines options to use when creating the node render graph\r\n * @param nodeRenderGraph defines a node render graph to update (instead of creating a new one)\r\n * @param skipBuild defines whether to skip building the node render graph (default is true)\r\n * @returns a promise that will resolve to the new node render graph\r\n */\r\n // eslint-disable-next-line @typescript-eslint/promise-function-async, no-restricted-syntax\r\n public static ParseFromSnippetAsync(\r\n snippetId: string,\r\n scene: Scene,\r\n nodeRenderGraphOptions?: INodeRenderGraphCreateOptions,\r\n nodeRenderGraph?: NodeRenderGraph,\r\n skipBuild: boolean = true\r\n ): Promise<NodeRenderGraph> {\r\n if (snippetId === \"_BLANK\") {\r\n return Promise.resolve(NodeRenderGraph.CreateDefault(\"blank\", scene, nodeRenderGraphOptions));\r\n }\r\n\r\n return new Promise((resolve, reject) => {\r\n const request = new WebRequest();\r\n request.addEventListener(\"readystatechange\", () => {\r\n if (request.readyState == 4) {\r\n if (request.status == 200) {\r\n const snippet = JSON.parse(JSON.parse(request.responseText).jsonPayload);\r\n const serializationObject = JSON.parse(snippet.nodeRenderGraph);\r\n\r\n if (!nodeRenderGraph) {\r\n nodeRenderGraph = SerializationHelper.Parse(() => new NodeRenderGraph(snippetId, scene, nodeRenderGraphOptions), serializationObject, null);\r\n }\r\n\r\n nodeRenderGraph.parseSerializedObject(serializationObject);\r\n nodeRenderGraph.snippetId = snippetId;\r\n\r\n try {\r\n if (!skipBuild) {\r\n nodeRenderGraph.build();\r\n }\r\n resolve(nodeRenderGraph);\r\n } catch (err) {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(err);\r\n }\r\n } else {\r\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\r\n reject(\"Unable to load the snippet \" + snippetId);\r\n }\r\n }\r\n });\r\n\r\n request.open(\"GET\", this.SnippetUrl + \"/\" + snippetId.replace(/#/g, \"/\"));\r\n request.send();\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -269,9 +269,9 @@ export class EnvironmentHelper {
|
|
|
269
269
|
groundSize = this._scene.activeCamera.upperRadiusLimit * 2;
|
|
270
270
|
skyboxSize = groundSize;
|
|
271
271
|
}
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
groundSize =
|
|
272
|
+
const sceneDiagonalLength = sceneDiagonal.length();
|
|
273
|
+
if (sceneDiagonalLength > groundSize) {
|
|
274
|
+
groundSize = sceneDiagonalLength * 2;
|
|
275
275
|
skyboxSize = groundSize;
|
|
276
276
|
}
|
|
277
277
|
// 10 % bigger.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environmentHelper.js","sourceRoot":"","sources":["../../../../dev/core/src/Helpers/environmentHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,WAAW,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AQ,CAAC,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAChJ,IAAI,CAAC,cAAc,CAAC,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;QAC1D,IAAI,CAAC,cAAc,CAAC,UAAU,GAAG,KAAK,CAAC;QACvC,IAAI,CAAC,eAAe,CAAC,iBAAiB,GAAG,IAAI,CAAC,cAAc,CAAC;IACjE,CAAC;IAMD;;OAEG;IACI,OAAO;QACV,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;;AAzgBD;;GAEG;AACY,sCAAoB,GAAG,qEAAqE,AAAxE,CAAyE;AAE5G;;GAEG;AACY,sCAAoB,GAAG,qEAAqE,AAAxE,CAAyE;AAE5G;;GAEG;AACY,2CAAyB,GAAG,wEAAwE,AAA3E,CAA4E","sourcesContent":["import { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport { ArcRotateCamera } from \"../Cameras/arcRotateCamera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../Meshes/mesh\";\r\nimport { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { MirrorTexture } from \"../Materials/Textures/mirrorTexture\";\r\nimport { CubeTexture } from \"../Materials/Textures/cubeTexture\";\r\nimport { BackgroundMaterial } from \"../Materials/Background/backgroundMaterial\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { CreatePlane } from \"../Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"../Meshes/Builders/boxBuilder\";\r\nimport { Plane } from \"../Maths/math.plane\";\r\nimport { Tools } from \"core/Misc/tools\";\r\n\r\n/**\r\n * Represents the different options available during the creation of\r\n * a Environment helper.\r\n *\r\n * This can control the default ground, skybox and image processing setup of your scene.\r\n */\r\nexport interface IEnvironmentHelperOptions {\r\n /**\r\n * Specifies whether or not to create a ground.\r\n * True by default.\r\n */\r\n createGround: boolean;\r\n /**\r\n * Specifies the ground size.\r\n * 15 by default.\r\n */\r\n groundSize: number;\r\n /**\r\n * The texture used on the ground for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n groundTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the ground texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n groundColor: Color3;\r\n /**\r\n * Specifies the ground opacity.\r\n * 1 by default.\r\n */\r\n groundOpacity: number;\r\n /**\r\n * Enables the ground to receive shadows.\r\n * True by default.\r\n */\r\n enableGroundShadow: boolean;\r\n /**\r\n * Helps preventing the shadow to be fully black on the ground.\r\n * 0.5 by default.\r\n */\r\n groundShadowLevel: number;\r\n /**\r\n * Creates a mirror texture attach to the ground.\r\n * false by default.\r\n */\r\n enableGroundMirror: boolean;\r\n /**\r\n * Specifies the ground mirror size ratio.\r\n * 0.3 by default as the default kernel is 64.\r\n */\r\n groundMirrorSizeRatio: number;\r\n /**\r\n * Specifies the ground mirror blur kernel size.\r\n * 64 by default.\r\n */\r\n groundMirrorBlurKernel: number;\r\n /**\r\n * Specifies the ground mirror visibility amount.\r\n * 1 by default\r\n */\r\n groundMirrorAmount: number;\r\n /**\r\n * Specifies the ground mirror reflectance weight.\r\n * This uses the standard weight of the background material to setup the fresnel effect\r\n * of the mirror.\r\n * 1 by default.\r\n */\r\n groundMirrorFresnelWeight: number;\r\n /**\r\n * Specifies the ground mirror Falloff distance.\r\n * This can helps reducing the size of the reflection.\r\n * 0 by Default.\r\n */\r\n groundMirrorFallOffDistance: number;\r\n /**\r\n * Specifies the ground mirror texture type.\r\n * Unsigned Int by Default.\r\n */\r\n groundMirrorTextureType: number;\r\n /**\r\n * Specifies a bias applied to the ground vertical position to prevent z-fighting with\r\n * the shown objects.\r\n */\r\n groundYBias: number;\r\n\r\n /**\r\n * Specifies whether or not to create a skybox.\r\n * True by default.\r\n */\r\n createSkybox: boolean;\r\n /**\r\n * Specifies the skybox size.\r\n * 20 by default.\r\n */\r\n skyboxSize: number;\r\n /**\r\n * The texture used on the skybox for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n skyboxTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the skybox texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n skyboxColor: Color3;\r\n\r\n /**\r\n * The background rotation around the Y axis of the scene.\r\n * This helps aligning the key lights of your scene with the background.\r\n * 0 by default.\r\n */\r\n backgroundYRotation: number;\r\n\r\n /**\r\n * Compute automatically the size of the elements to best fit with the scene.\r\n */\r\n sizeAuto: boolean;\r\n\r\n /**\r\n * Default position of the rootMesh if autoSize is not true.\r\n */\r\n rootPosition: Vector3;\r\n\r\n /**\r\n * Sets up the image processing in the scene.\r\n * true by default.\r\n */\r\n setupImageProcessing: boolean;\r\n\r\n /**\r\n * The texture used as your environment texture in the scene.\r\n * Comes from the BabylonJS CDN by default and in use if setupImageProcessing is true.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n environmentTexture: string | BaseTexture;\r\n\r\n /**\r\n * The value of the exposure to apply to the scene.\r\n * 0.6 by default if setupImageProcessing is true.\r\n */\r\n cameraExposure: number;\r\n\r\n /**\r\n * The value of the contrast to apply to the scene.\r\n * 1.6 by default if setupImageProcessing is true.\r\n */\r\n cameraContrast: number;\r\n\r\n /**\r\n * Specifies whether or not tonemapping should be enabled in the scene.\r\n * true by default if setupImageProcessing is true.\r\n */\r\n toneMappingEnabled: boolean;\r\n}\r\n\r\ninterface ISceneSize {\r\n groundSize: number;\r\n skyboxSize: number;\r\n rootPosition: Vector3;\r\n}\r\n\r\n/**\r\n * The EnvironmentHelper class can be used to add a fully featured non-expensive background to your scene.\r\n * It includes by default a skybox and a ground relying on the BackgroundMaterial.\r\n * It also helps with the default setup of your ImageProcessingConfiguration.\r\n */\r\nexport class EnvironmentHelper {\r\n /**\r\n * Default ground texture URL.\r\n */\r\n private static _GroundTextureCDNUrl = \"https://assets.babylonjs.com/core/environments/backgroundGround.png\";\r\n\r\n /**\r\n * Default skybox texture URL.\r\n */\r\n private static _SkyboxTextureCDNUrl = \"https://assets.babylonjs.com/core/environments/backgroundSkybox.dds\";\r\n\r\n /**\r\n * Default environment texture URL.\r\n */\r\n private static _EnvironmentTextureCDNUrl = \"https://assets.babylonjs.com/core/environments/environmentSpecular.env\";\r\n\r\n /**\r\n * Creates the default options for the helper.\r\n * @param scene The scene the environment helper belongs to.\r\n * @returns default options for the helper.\r\n */\r\n private static _GetDefaultOptions(scene: Scene): IEnvironmentHelperOptions {\r\n return {\r\n createGround: true,\r\n groundSize: 15,\r\n groundTexture: Tools.GetAssetUrl(this._GroundTextureCDNUrl),\r\n groundColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n groundOpacity: 0.9,\r\n enableGroundShadow: true,\r\n groundShadowLevel: 0.5,\r\n\r\n enableGroundMirror: false,\r\n groundMirrorSizeRatio: 0.3,\r\n groundMirrorBlurKernel: 64,\r\n groundMirrorAmount: 1,\r\n groundMirrorFresnelWeight: 1,\r\n groundMirrorFallOffDistance: 0,\r\n groundMirrorTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n\r\n groundYBias: 0.00001,\r\n\r\n createSkybox: true,\r\n skyboxSize: 20,\r\n skyboxTexture: Tools.GetAssetUrl(this._SkyboxTextureCDNUrl),\r\n skyboxColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n\r\n backgroundYRotation: 0,\r\n sizeAuto: true,\r\n rootPosition: Vector3.Zero(),\r\n\r\n setupImageProcessing: true,\r\n environmentTexture: Tools.GetAssetUrl(this._EnvironmentTextureCDNUrl),\r\n cameraExposure: 0.8,\r\n cameraContrast: 1.2,\r\n toneMappingEnabled: true,\r\n };\r\n }\r\n\r\n private _rootMesh: Mesh;\r\n /**\r\n * Gets the root mesh created by the helper.\r\n */\r\n public get rootMesh(): Mesh {\r\n return this._rootMesh;\r\n }\r\n\r\n private _skybox: Nullable<Mesh>;\r\n /**\r\n * Gets the skybox created by the helper.\r\n */\r\n public get skybox(): Nullable<Mesh> {\r\n return this._skybox;\r\n }\r\n\r\n private _skyboxTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the skybox texture created by the helper.\r\n */\r\n public get skyboxTexture(): Nullable<BaseTexture> {\r\n return this._skyboxTexture;\r\n }\r\n\r\n private _skyboxMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the skybox material created by the helper.\r\n */\r\n public get skyboxMaterial(): Nullable<BackgroundMaterial> {\r\n return this._skyboxMaterial;\r\n }\r\n\r\n private _ground: Nullable<Mesh>;\r\n /**\r\n * Gets the ground mesh created by the helper.\r\n */\r\n public get ground(): Nullable<Mesh> {\r\n return this._ground;\r\n }\r\n\r\n private _groundTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the ground texture created by the helper.\r\n */\r\n public get groundTexture(): Nullable<BaseTexture> {\r\n return this._groundTexture;\r\n }\r\n\r\n private _groundMirror: Nullable<MirrorTexture>;\r\n /**\r\n * Gets the ground mirror created by the helper.\r\n */\r\n public get groundMirror(): Nullable<MirrorTexture> {\r\n return this._groundMirror;\r\n }\r\n\r\n /**\r\n * Gets the ground mirror render list to helps pushing the meshes\r\n * you wish in the ground reflection.\r\n */\r\n public get groundMirrorRenderList(): Nullable<AbstractMesh[]> {\r\n if (this._groundMirror) {\r\n return this._groundMirror.renderList;\r\n }\r\n return null;\r\n }\r\n\r\n private _groundMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the ground material created by the helper.\r\n */\r\n public get groundMaterial(): Nullable<BackgroundMaterial> {\r\n return this._groundMaterial;\r\n }\r\n\r\n /**\r\n * Stores the creation options.\r\n */\r\n private readonly _scene: Scene;\r\n private _options: IEnvironmentHelperOptions;\r\n\r\n /**\r\n * This observable will be notified with any error during the creation of the environment,\r\n * mainly texture creation errors.\r\n */\r\n public onErrorObservable: Observable<{ message?: string; exception?: any }>;\r\n\r\n /**\r\n * constructor\r\n * @param options Defines the options we want to customize the helper\r\n * @param scene The scene to add the material to\r\n */\r\n constructor(options: Partial<IEnvironmentHelperOptions>, scene: Scene) {\r\n this._options = {\r\n ...EnvironmentHelper._GetDefaultOptions(scene),\r\n ...options,\r\n };\r\n this._scene = scene;\r\n this.onErrorObservable = new Observable();\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Updates the environment according to the new options\r\n * @param options options to configure the helper (IEnvironmentHelperOptions)\r\n */\r\n public updateOptions(options: Partial<IEnvironmentHelperOptions>) {\r\n const newOptions = {\r\n ...this._options,\r\n ...options,\r\n };\r\n\r\n if (this._ground && !newOptions.createGround) {\r\n this._ground.dispose();\r\n this._ground = null;\r\n }\r\n\r\n if (this._groundMaterial && !newOptions.createGround) {\r\n this._groundMaterial.dispose();\r\n this._groundMaterial = null;\r\n }\r\n\r\n if (this._groundTexture) {\r\n if (this._options.groundTexture != newOptions.groundTexture) {\r\n this._groundTexture.dispose();\r\n this._groundTexture = null;\r\n }\r\n }\r\n\r\n if (this._skybox && !newOptions.createSkybox) {\r\n this._skybox.dispose();\r\n this._skybox = null;\r\n }\r\n\r\n if (this._skyboxMaterial && !newOptions.createSkybox) {\r\n this._skyboxMaterial.dispose();\r\n this._skyboxMaterial = null;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n if (this._options.skyboxTexture != newOptions.skyboxTexture) {\r\n this._skyboxTexture.dispose();\r\n this._skyboxTexture = null;\r\n }\r\n }\r\n\r\n if (this._groundMirror && !newOptions.enableGroundMirror) {\r\n this._groundMirror.dispose();\r\n this._groundMirror = null;\r\n }\r\n\r\n if (this._scene.environmentTexture) {\r\n if (this._options.environmentTexture != newOptions.environmentTexture) {\r\n this._scene.environmentTexture.dispose();\r\n }\r\n }\r\n\r\n this._options = newOptions;\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Sets the primary color of all the available elements.\r\n * @param color the main color to affect to the ground and the background\r\n */\r\n public setMainColor(color: Color3): void {\r\n if (this.groundMaterial) {\r\n this.groundMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.skyboxMaterial) {\r\n this.skyboxMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.groundMirror) {\r\n this.groundMirror.clearColor = new Color4(color.r, color.g, color.b, 1.0);\r\n }\r\n }\r\n\r\n /**\r\n * Setup the image processing according to the specified options.\r\n */\r\n private _setupImageProcessing(): void {\r\n if (this._options.setupImageProcessing) {\r\n this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast;\r\n this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure;\r\n this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled;\r\n this._setupEnvironmentTexture();\r\n }\r\n }\r\n\r\n /**\r\n * Setup the environment texture according to the specified options.\r\n */\r\n private _setupEnvironmentTexture(): void {\r\n if (this._scene.environmentTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.environmentTexture instanceof BaseTexture) {\r\n this._scene.environmentTexture = this._options.environmentTexture;\r\n return;\r\n }\r\n\r\n const environmentTexture = CubeTexture.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);\r\n this._scene.environmentTexture = environmentTexture;\r\n }\r\n\r\n /**\r\n * Setup the background according to the specified options.\r\n */\r\n private _setupBackground(): void {\r\n if (!this._rootMesh) {\r\n this._rootMesh = new Mesh(\"BackgroundHelper\", this._scene);\r\n }\r\n this._rootMesh.rotation.y = this._options.backgroundYRotation;\r\n\r\n const sceneSize = this._getSceneSize();\r\n if (this._options.createGround) {\r\n this._setupGround(sceneSize);\r\n this._setupGroundMaterial();\r\n this._setupGroundDiffuseTexture();\r\n\r\n if (this._options.enableGroundMirror) {\r\n this._setupGroundMirrorTexture(sceneSize);\r\n }\r\n this._setupMirrorInGroundMaterial();\r\n }\r\n\r\n if (this._options.createSkybox) {\r\n this._setupSkybox(sceneSize);\r\n this._setupSkyboxMaterial();\r\n this._setupSkyboxReflectionTexture();\r\n }\r\n\r\n this._rootMesh.position.x = sceneSize.rootPosition.x;\r\n this._rootMesh.position.z = sceneSize.rootPosition.z;\r\n this._rootMesh.position.y = sceneSize.rootPosition.y;\r\n }\r\n\r\n /**\r\n * Get the scene sizes according to the setup.\r\n * @returns the different ground and skybox sizes.\r\n */\r\n private _getSceneSize(): ISceneSize {\r\n let groundSize = this._options.groundSize;\r\n let skyboxSize = this._options.skyboxSize;\r\n let rootPosition = this._options.rootPosition;\r\n if (!this._scene.meshes || this._scene.meshes.length === 1) {\r\n // 1 only means the root of the helper.\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n const sceneExtends = this._scene.getWorldExtends((mesh) => {\r\n return mesh !== this._ground && mesh !== this._rootMesh && mesh !== this._skybox;\r\n });\r\n const sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);\r\n\r\n if (this._options.sizeAuto) {\r\n if (this._scene.activeCamera instanceof ArcRotateCamera && this._scene.activeCamera.upperRadiusLimit) {\r\n groundSize = this._scene.activeCamera.upperRadiusLimit * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n const sceneDiagonalLenght = sceneDiagonal.length();\r\n if (sceneDiagonalLenght > groundSize) {\r\n groundSize = sceneDiagonalLenght * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n // 10 % bigger.\r\n groundSize *= 1.1;\r\n skyboxSize *= 1.5;\r\n rootPosition = sceneExtends.min.add(sceneDiagonal.scale(0.5));\r\n rootPosition.y = sceneExtends.min.y - this._options.groundYBias;\r\n }\r\n\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n /**\r\n * Setup the ground according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGround(sceneSize: ISceneSize): void {\r\n if (!this._ground || this._ground.isDisposed()) {\r\n this._ground = CreatePlane(\"BackgroundPlane\", { size: sceneSize.groundSize }, this._scene);\r\n this._ground.rotation.x = Math.PI / 2; // Face up by default.\r\n this._ground.isPickable = false;\r\n this._ground.parent = this._rootMesh;\r\n this._ground.onDisposeObservable.add(() => {\r\n this._ground = null;\r\n });\r\n }\r\n\r\n this._ground.receiveShadows = this._options.enableGroundShadow;\r\n }\r\n\r\n /**\r\n * Setup the ground material according to the specified options.\r\n */\r\n private _setupGroundMaterial(): void {\r\n if (!this._groundMaterial) {\r\n this._groundMaterial = new BackgroundMaterial(\"BackgroundPlaneMaterial\", this._scene);\r\n }\r\n this._groundMaterial.alpha = this._options.groundOpacity;\r\n this._groundMaterial.alphaMode = Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;\r\n this._groundMaterial.shadowLevel = this._options.groundShadowLevel;\r\n this._groundMaterial.primaryColor = this._options.groundColor;\r\n this._groundMaterial.useRGBColor = false;\r\n this._groundMaterial.enableNoise = true;\r\n\r\n if (this._ground) {\r\n this._ground.material = this._groundMaterial;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the ground diffuse texture according to the specified options.\r\n */\r\n private _setupGroundDiffuseTexture(): void {\r\n if (!this._groundMaterial) {\r\n return;\r\n }\r\n\r\n if (this._groundTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.groundTexture instanceof BaseTexture) {\r\n this._groundMaterial.diffuseTexture = this._options.groundTexture;\r\n return;\r\n }\r\n\r\n this._groundTexture = new Texture(this._options.groundTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._groundTexture.gammaSpace = false;\r\n this._groundTexture.hasAlpha = true;\r\n this._groundMaterial.diffuseTexture = this._groundTexture;\r\n }\r\n\r\n /**\r\n * Setup the ground mirror texture according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGroundMirrorTexture(sceneSize: ISceneSize): void {\r\n const wrapping = Texture.CLAMP_ADDRESSMODE;\r\n if (!this._groundMirror) {\r\n this._groundMirror = new MirrorTexture(\r\n \"BackgroundPlaneMirrorTexture\",\r\n { ratio: this._options.groundMirrorSizeRatio },\r\n this._scene,\r\n false,\r\n this._options.groundMirrorTextureType,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n true\r\n );\r\n this._groundMirror.mirrorPlane = new Plane(0, -1, 0, sceneSize.rootPosition.y);\r\n this._groundMirror.anisotropicFilteringLevel = 1;\r\n this._groundMirror.wrapU = wrapping;\r\n this._groundMirror.wrapV = wrapping;\r\n\r\n if (this._groundMirror.renderList) {\r\n for (let i = 0; i < this._scene.meshes.length; i++) {\r\n const mesh = this._scene.meshes[i];\r\n if (mesh !== this._ground && mesh !== this._skybox && mesh !== this._rootMesh) {\r\n this._groundMirror.renderList.push(mesh);\r\n }\r\n }\r\n }\r\n }\r\n\r\n const gammaGround = this._options.groundColor.toGammaSpace(this._scene.getEngine().useExactSrgbConversions);\r\n this._groundMirror.clearColor = new Color4(gammaGround.r, gammaGround.g, gammaGround.b, 1);\r\n this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;\r\n }\r\n\r\n /**\r\n * Setup the ground to receive the mirror texture.\r\n */\r\n private _setupMirrorInGroundMaterial(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.reflectionTexture = this._groundMirror;\r\n this._groundMaterial.reflectionFresnel = true;\r\n this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount;\r\n this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight;\r\n this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the skybox according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupSkybox(sceneSize: ISceneSize): void {\r\n if (!this._skybox || this._skybox.isDisposed()) {\r\n this._skybox = CreateBox(\"BackgroundSkybox\", { size: sceneSize.skyboxSize, sideOrientation: Mesh.BACKSIDE }, this._scene);\r\n this._skybox.isPickable = false;\r\n this._skybox.onDisposeObservable.add(() => {\r\n this._skybox = null;\r\n });\r\n }\r\n this._skybox.parent = this._rootMesh;\r\n }\r\n\r\n /**\r\n * Setup the skybox material according to the specified options.\r\n */\r\n private _setupSkyboxMaterial(): void {\r\n if (!this._skybox) {\r\n return;\r\n }\r\n\r\n if (!this._skyboxMaterial) {\r\n this._skyboxMaterial = new BackgroundMaterial(\"BackgroundSkyboxMaterial\", this._scene);\r\n }\r\n this._skyboxMaterial.useRGBColor = false;\r\n this._skyboxMaterial.primaryColor = this._options.skyboxColor;\r\n this._skyboxMaterial.enableNoise = true;\r\n\r\n this._skybox.material = this._skyboxMaterial;\r\n }\r\n\r\n /**\r\n * Setup the skybox reflection texture according to the specified options.\r\n */\r\n private _setupSkyboxReflectionTexture(): void {\r\n if (!this._skyboxMaterial) {\r\n return;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.skyboxTexture instanceof BaseTexture) {\r\n this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture;\r\n return;\r\n }\r\n\r\n this._skyboxTexture = new CubeTexture(this._options.skyboxTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._skyboxTexture.coordinatesMode = Texture.SKYBOX_MODE;\r\n this._skyboxTexture.gammaSpace = false;\r\n this._skyboxMaterial.reflectionTexture = this._skyboxTexture;\r\n }\r\n\r\n private _errorHandler = (message?: string, exception?: any) => {\r\n this.onErrorObservable.notifyObservers({ message: message, exception: exception });\r\n };\r\n\r\n /**\r\n * Dispose all the elements created by the Helper.\r\n */\r\n public dispose(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.dispose(true, true);\r\n }\r\n if (this._skyboxMaterial) {\r\n this._skyboxMaterial.dispose(true, true);\r\n }\r\n this._rootMesh.dispose(false);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"environmentHelper.js","sourceRoot":"","sources":["../../../../dev/core/src/Helpers/environmentHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,yBAAwB;AAyKxC;;;;GAIG;AACH,MAAM,OAAO,iBAAiB;IAgB1B;;;;OAIG;IACK,MAAM,CAAC,kBAAkB,CAAC,KAAY;QAC1C,OAAO;YACH,YAAY,EAAE,IAAI;Y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AI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;;AAzgBD;;GAEG;AACY,sCAAoB,GAAG,qEAAqE,AAAxE,CAAyE;AAE5G;;GAEG;AACY,sCAAoB,GAAG,qEAAqE,AAAxE,CAAyE;AAE5G;;GAEG;AACY,2CAAyB,GAAG,wEAAwE,AAA3E,CAA4E","sourcesContent":["import { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport { ArcRotateCamera } from \"../Cameras/arcRotateCamera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector3 } from \"../Maths/math.vector\";\r\nimport { Color3, Color4 } from \"../Maths/math.color\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { Mesh } from \"../Meshes/mesh\";\r\nimport { BaseTexture } from \"../Materials/Textures/baseTexture\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { MirrorTexture } from \"../Materials/Textures/mirrorTexture\";\r\nimport { CubeTexture } from \"../Materials/Textures/cubeTexture\";\r\nimport { BackgroundMaterial } from \"../Materials/Background/backgroundMaterial\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport { CreatePlane } from \"../Meshes/Builders/planeBuilder\";\r\nimport { CreateBox } from \"../Meshes/Builders/boxBuilder\";\r\nimport { Plane } from \"../Maths/math.plane\";\r\nimport { Tools } from \"core/Misc/tools\";\r\n\r\n/**\r\n * Represents the different options available during the creation of\r\n * a Environment helper.\r\n *\r\n * This can control the default ground, skybox and image processing setup of your scene.\r\n */\r\nexport interface IEnvironmentHelperOptions {\r\n /**\r\n * Specifies whether or not to create a ground.\r\n * True by default.\r\n */\r\n createGround: boolean;\r\n /**\r\n * Specifies the ground size.\r\n * 15 by default.\r\n */\r\n groundSize: number;\r\n /**\r\n * The texture used on the ground for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n groundTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the ground texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n groundColor: Color3;\r\n /**\r\n * Specifies the ground opacity.\r\n * 1 by default.\r\n */\r\n groundOpacity: number;\r\n /**\r\n * Enables the ground to receive shadows.\r\n * True by default.\r\n */\r\n enableGroundShadow: boolean;\r\n /**\r\n * Helps preventing the shadow to be fully black on the ground.\r\n * 0.5 by default.\r\n */\r\n groundShadowLevel: number;\r\n /**\r\n * Creates a mirror texture attach to the ground.\r\n * false by default.\r\n */\r\n enableGroundMirror: boolean;\r\n /**\r\n * Specifies the ground mirror size ratio.\r\n * 0.3 by default as the default kernel is 64.\r\n */\r\n groundMirrorSizeRatio: number;\r\n /**\r\n * Specifies the ground mirror blur kernel size.\r\n * 64 by default.\r\n */\r\n groundMirrorBlurKernel: number;\r\n /**\r\n * Specifies the ground mirror visibility amount.\r\n * 1 by default\r\n */\r\n groundMirrorAmount: number;\r\n /**\r\n * Specifies the ground mirror reflectance weight.\r\n * This uses the standard weight of the background material to setup the fresnel effect\r\n * of the mirror.\r\n * 1 by default.\r\n */\r\n groundMirrorFresnelWeight: number;\r\n /**\r\n * Specifies the ground mirror Falloff distance.\r\n * This can helps reducing the size of the reflection.\r\n * 0 by Default.\r\n */\r\n groundMirrorFallOffDistance: number;\r\n /**\r\n * Specifies the ground mirror texture type.\r\n * Unsigned Int by Default.\r\n */\r\n groundMirrorTextureType: number;\r\n /**\r\n * Specifies a bias applied to the ground vertical position to prevent z-fighting with\r\n * the shown objects.\r\n */\r\n groundYBias: number;\r\n\r\n /**\r\n * Specifies whether or not to create a skybox.\r\n * True by default.\r\n */\r\n createSkybox: boolean;\r\n /**\r\n * Specifies the skybox size.\r\n * 20 by default.\r\n */\r\n skyboxSize: number;\r\n /**\r\n * The texture used on the skybox for the main color.\r\n * Comes from the BabylonJS CDN by default.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n skyboxTexture: string | BaseTexture;\r\n /**\r\n * The color mixed in the skybox texture by default.\r\n * BabylonJS clearColor by default.\r\n */\r\n skyboxColor: Color3;\r\n\r\n /**\r\n * The background rotation around the Y axis of the scene.\r\n * This helps aligning the key lights of your scene with the background.\r\n * 0 by default.\r\n */\r\n backgroundYRotation: number;\r\n\r\n /**\r\n * Compute automatically the size of the elements to best fit with the scene.\r\n */\r\n sizeAuto: boolean;\r\n\r\n /**\r\n * Default position of the rootMesh if autoSize is not true.\r\n */\r\n rootPosition: Vector3;\r\n\r\n /**\r\n * Sets up the image processing in the scene.\r\n * true by default.\r\n */\r\n setupImageProcessing: boolean;\r\n\r\n /**\r\n * The texture used as your environment texture in the scene.\r\n * Comes from the BabylonJS CDN by default and in use if setupImageProcessing is true.\r\n *\r\n * Remarks: Can be either a texture or a url.\r\n */\r\n environmentTexture: string | BaseTexture;\r\n\r\n /**\r\n * The value of the exposure to apply to the scene.\r\n * 0.6 by default if setupImageProcessing is true.\r\n */\r\n cameraExposure: number;\r\n\r\n /**\r\n * The value of the contrast to apply to the scene.\r\n * 1.6 by default if setupImageProcessing is true.\r\n */\r\n cameraContrast: number;\r\n\r\n /**\r\n * Specifies whether or not tonemapping should be enabled in the scene.\r\n * true by default if setupImageProcessing is true.\r\n */\r\n toneMappingEnabled: boolean;\r\n}\r\n\r\ninterface ISceneSize {\r\n groundSize: number;\r\n skyboxSize: number;\r\n rootPosition: Vector3;\r\n}\r\n\r\n/**\r\n * The EnvironmentHelper class can be used to add a fully featured non-expensive background to your scene.\r\n * It includes by default a skybox and a ground relying on the BackgroundMaterial.\r\n * It also helps with the default setup of your ImageProcessingConfiguration.\r\n */\r\nexport class EnvironmentHelper {\r\n /**\r\n * Default ground texture URL.\r\n */\r\n private static _GroundTextureCDNUrl = \"https://assets.babylonjs.com/core/environments/backgroundGround.png\";\r\n\r\n /**\r\n * Default skybox texture URL.\r\n */\r\n private static _SkyboxTextureCDNUrl = \"https://assets.babylonjs.com/core/environments/backgroundSkybox.dds\";\r\n\r\n /**\r\n * Default environment texture URL.\r\n */\r\n private static _EnvironmentTextureCDNUrl = \"https://assets.babylonjs.com/core/environments/environmentSpecular.env\";\r\n\r\n /**\r\n * Creates the default options for the helper.\r\n * @param scene The scene the environment helper belongs to.\r\n * @returns default options for the helper.\r\n */\r\n private static _GetDefaultOptions(scene: Scene): IEnvironmentHelperOptions {\r\n return {\r\n createGround: true,\r\n groundSize: 15,\r\n groundTexture: Tools.GetAssetUrl(this._GroundTextureCDNUrl),\r\n groundColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n groundOpacity: 0.9,\r\n enableGroundShadow: true,\r\n groundShadowLevel: 0.5,\r\n\r\n enableGroundMirror: false,\r\n groundMirrorSizeRatio: 0.3,\r\n groundMirrorBlurKernel: 64,\r\n groundMirrorAmount: 1,\r\n groundMirrorFresnelWeight: 1,\r\n groundMirrorFallOffDistance: 0,\r\n groundMirrorTextureType: Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n\r\n groundYBias: 0.00001,\r\n\r\n createSkybox: true,\r\n skyboxSize: 20,\r\n skyboxTexture: Tools.GetAssetUrl(this._SkyboxTextureCDNUrl),\r\n skyboxColor: new Color3(0.2, 0.2, 0.3).toLinearSpace(scene.getEngine().useExactSrgbConversions).scale(3),\r\n\r\n backgroundYRotation: 0,\r\n sizeAuto: true,\r\n rootPosition: Vector3.Zero(),\r\n\r\n setupImageProcessing: true,\r\n environmentTexture: Tools.GetAssetUrl(this._EnvironmentTextureCDNUrl),\r\n cameraExposure: 0.8,\r\n cameraContrast: 1.2,\r\n toneMappingEnabled: true,\r\n };\r\n }\r\n\r\n private _rootMesh: Mesh;\r\n /**\r\n * Gets the root mesh created by the helper.\r\n */\r\n public get rootMesh(): Mesh {\r\n return this._rootMesh;\r\n }\r\n\r\n private _skybox: Nullable<Mesh>;\r\n /**\r\n * Gets the skybox created by the helper.\r\n */\r\n public get skybox(): Nullable<Mesh> {\r\n return this._skybox;\r\n }\r\n\r\n private _skyboxTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the skybox texture created by the helper.\r\n */\r\n public get skyboxTexture(): Nullable<BaseTexture> {\r\n return this._skyboxTexture;\r\n }\r\n\r\n private _skyboxMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the skybox material created by the helper.\r\n */\r\n public get skyboxMaterial(): Nullable<BackgroundMaterial> {\r\n return this._skyboxMaterial;\r\n }\r\n\r\n private _ground: Nullable<Mesh>;\r\n /**\r\n * Gets the ground mesh created by the helper.\r\n */\r\n public get ground(): Nullable<Mesh> {\r\n return this._ground;\r\n }\r\n\r\n private _groundTexture: Nullable<BaseTexture>;\r\n /**\r\n * Gets the ground texture created by the helper.\r\n */\r\n public get groundTexture(): Nullable<BaseTexture> {\r\n return this._groundTexture;\r\n }\r\n\r\n private _groundMirror: Nullable<MirrorTexture>;\r\n /**\r\n * Gets the ground mirror created by the helper.\r\n */\r\n public get groundMirror(): Nullable<MirrorTexture> {\r\n return this._groundMirror;\r\n }\r\n\r\n /**\r\n * Gets the ground mirror render list to helps pushing the meshes\r\n * you wish in the ground reflection.\r\n */\r\n public get groundMirrorRenderList(): Nullable<AbstractMesh[]> {\r\n if (this._groundMirror) {\r\n return this._groundMirror.renderList;\r\n }\r\n return null;\r\n }\r\n\r\n private _groundMaterial: Nullable<BackgroundMaterial>;\r\n /**\r\n * Gets the ground material created by the helper.\r\n */\r\n public get groundMaterial(): Nullable<BackgroundMaterial> {\r\n return this._groundMaterial;\r\n }\r\n\r\n /**\r\n * Stores the creation options.\r\n */\r\n private readonly _scene: Scene;\r\n private _options: IEnvironmentHelperOptions;\r\n\r\n /**\r\n * This observable will be notified with any error during the creation of the environment,\r\n * mainly texture creation errors.\r\n */\r\n public onErrorObservable: Observable<{ message?: string; exception?: any }>;\r\n\r\n /**\r\n * constructor\r\n * @param options Defines the options we want to customize the helper\r\n * @param scene The scene to add the material to\r\n */\r\n constructor(options: Partial<IEnvironmentHelperOptions>, scene: Scene) {\r\n this._options = {\r\n ...EnvironmentHelper._GetDefaultOptions(scene),\r\n ...options,\r\n };\r\n this._scene = scene;\r\n this.onErrorObservable = new Observable();\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Updates the environment according to the new options\r\n * @param options options to configure the helper (IEnvironmentHelperOptions)\r\n */\r\n public updateOptions(options: Partial<IEnvironmentHelperOptions>) {\r\n const newOptions = {\r\n ...this._options,\r\n ...options,\r\n };\r\n\r\n if (this._ground && !newOptions.createGround) {\r\n this._ground.dispose();\r\n this._ground = null;\r\n }\r\n\r\n if (this._groundMaterial && !newOptions.createGround) {\r\n this._groundMaterial.dispose();\r\n this._groundMaterial = null;\r\n }\r\n\r\n if (this._groundTexture) {\r\n if (this._options.groundTexture != newOptions.groundTexture) {\r\n this._groundTexture.dispose();\r\n this._groundTexture = null;\r\n }\r\n }\r\n\r\n if (this._skybox && !newOptions.createSkybox) {\r\n this._skybox.dispose();\r\n this._skybox = null;\r\n }\r\n\r\n if (this._skyboxMaterial && !newOptions.createSkybox) {\r\n this._skyboxMaterial.dispose();\r\n this._skyboxMaterial = null;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n if (this._options.skyboxTexture != newOptions.skyboxTexture) {\r\n this._skyboxTexture.dispose();\r\n this._skyboxTexture = null;\r\n }\r\n }\r\n\r\n if (this._groundMirror && !newOptions.enableGroundMirror) {\r\n this._groundMirror.dispose();\r\n this._groundMirror = null;\r\n }\r\n\r\n if (this._scene.environmentTexture) {\r\n if (this._options.environmentTexture != newOptions.environmentTexture) {\r\n this._scene.environmentTexture.dispose();\r\n }\r\n }\r\n\r\n this._options = newOptions;\r\n\r\n this._setupBackground();\r\n this._setupImageProcessing();\r\n }\r\n\r\n /**\r\n * Sets the primary color of all the available elements.\r\n * @param color the main color to affect to the ground and the background\r\n */\r\n public setMainColor(color: Color3): void {\r\n if (this.groundMaterial) {\r\n this.groundMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.skyboxMaterial) {\r\n this.skyboxMaterial.primaryColor = color;\r\n }\r\n\r\n if (this.groundMirror) {\r\n this.groundMirror.clearColor = new Color4(color.r, color.g, color.b, 1.0);\r\n }\r\n }\r\n\r\n /**\r\n * Setup the image processing according to the specified options.\r\n */\r\n private _setupImageProcessing(): void {\r\n if (this._options.setupImageProcessing) {\r\n this._scene.imageProcessingConfiguration.contrast = this._options.cameraContrast;\r\n this._scene.imageProcessingConfiguration.exposure = this._options.cameraExposure;\r\n this._scene.imageProcessingConfiguration.toneMappingEnabled = this._options.toneMappingEnabled;\r\n this._setupEnvironmentTexture();\r\n }\r\n }\r\n\r\n /**\r\n * Setup the environment texture according to the specified options.\r\n */\r\n private _setupEnvironmentTexture(): void {\r\n if (this._scene.environmentTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.environmentTexture instanceof BaseTexture) {\r\n this._scene.environmentTexture = this._options.environmentTexture;\r\n return;\r\n }\r\n\r\n const environmentTexture = CubeTexture.CreateFromPrefilteredData(this._options.environmentTexture, this._scene);\r\n this._scene.environmentTexture = environmentTexture;\r\n }\r\n\r\n /**\r\n * Setup the background according to the specified options.\r\n */\r\n private _setupBackground(): void {\r\n if (!this._rootMesh) {\r\n this._rootMesh = new Mesh(\"BackgroundHelper\", this._scene);\r\n }\r\n this._rootMesh.rotation.y = this._options.backgroundYRotation;\r\n\r\n const sceneSize = this._getSceneSize();\r\n if (this._options.createGround) {\r\n this._setupGround(sceneSize);\r\n this._setupGroundMaterial();\r\n this._setupGroundDiffuseTexture();\r\n\r\n if (this._options.enableGroundMirror) {\r\n this._setupGroundMirrorTexture(sceneSize);\r\n }\r\n this._setupMirrorInGroundMaterial();\r\n }\r\n\r\n if (this._options.createSkybox) {\r\n this._setupSkybox(sceneSize);\r\n this._setupSkyboxMaterial();\r\n this._setupSkyboxReflectionTexture();\r\n }\r\n\r\n this._rootMesh.position.x = sceneSize.rootPosition.x;\r\n this._rootMesh.position.z = sceneSize.rootPosition.z;\r\n this._rootMesh.position.y = sceneSize.rootPosition.y;\r\n }\r\n\r\n /**\r\n * Get the scene sizes according to the setup.\r\n * @returns the different ground and skybox sizes.\r\n */\r\n private _getSceneSize(): ISceneSize {\r\n let groundSize = this._options.groundSize;\r\n let skyboxSize = this._options.skyboxSize;\r\n let rootPosition = this._options.rootPosition;\r\n if (!this._scene.meshes || this._scene.meshes.length === 1) {\r\n // 1 only means the root of the helper.\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n const sceneExtends = this._scene.getWorldExtends((mesh) => {\r\n return mesh !== this._ground && mesh !== this._rootMesh && mesh !== this._skybox;\r\n });\r\n const sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);\r\n\r\n if (this._options.sizeAuto) {\r\n if (this._scene.activeCamera instanceof ArcRotateCamera && this._scene.activeCamera.upperRadiusLimit) {\r\n groundSize = this._scene.activeCamera.upperRadiusLimit * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n const sceneDiagonalLength = sceneDiagonal.length();\r\n if (sceneDiagonalLength > groundSize) {\r\n groundSize = sceneDiagonalLength * 2;\r\n skyboxSize = groundSize;\r\n }\r\n\r\n // 10 % bigger.\r\n groundSize *= 1.1;\r\n skyboxSize *= 1.5;\r\n rootPosition = sceneExtends.min.add(sceneDiagonal.scale(0.5));\r\n rootPosition.y = sceneExtends.min.y - this._options.groundYBias;\r\n }\r\n\r\n return { groundSize, skyboxSize, rootPosition };\r\n }\r\n\r\n /**\r\n * Setup the ground according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGround(sceneSize: ISceneSize): void {\r\n if (!this._ground || this._ground.isDisposed()) {\r\n this._ground = CreatePlane(\"BackgroundPlane\", { size: sceneSize.groundSize }, this._scene);\r\n this._ground.rotation.x = Math.PI / 2; // Face up by default.\r\n this._ground.isPickable = false;\r\n this._ground.parent = this._rootMesh;\r\n this._ground.onDisposeObservable.add(() => {\r\n this._ground = null;\r\n });\r\n }\r\n\r\n this._ground.receiveShadows = this._options.enableGroundShadow;\r\n }\r\n\r\n /**\r\n * Setup the ground material according to the specified options.\r\n */\r\n private _setupGroundMaterial(): void {\r\n if (!this._groundMaterial) {\r\n this._groundMaterial = new BackgroundMaterial(\"BackgroundPlaneMaterial\", this._scene);\r\n }\r\n this._groundMaterial.alpha = this._options.groundOpacity;\r\n this._groundMaterial.alphaMode = Constants.ALPHA_PREMULTIPLIED_PORTERDUFF;\r\n this._groundMaterial.shadowLevel = this._options.groundShadowLevel;\r\n this._groundMaterial.primaryColor = this._options.groundColor;\r\n this._groundMaterial.useRGBColor = false;\r\n this._groundMaterial.enableNoise = true;\r\n\r\n if (this._ground) {\r\n this._ground.material = this._groundMaterial;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the ground diffuse texture according to the specified options.\r\n */\r\n private _setupGroundDiffuseTexture(): void {\r\n if (!this._groundMaterial) {\r\n return;\r\n }\r\n\r\n if (this._groundTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.groundTexture instanceof BaseTexture) {\r\n this._groundMaterial.diffuseTexture = this._options.groundTexture;\r\n return;\r\n }\r\n\r\n this._groundTexture = new Texture(this._options.groundTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._groundTexture.gammaSpace = false;\r\n this._groundTexture.hasAlpha = true;\r\n this._groundMaterial.diffuseTexture = this._groundTexture;\r\n }\r\n\r\n /**\r\n * Setup the ground mirror texture according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupGroundMirrorTexture(sceneSize: ISceneSize): void {\r\n const wrapping = Texture.CLAMP_ADDRESSMODE;\r\n if (!this._groundMirror) {\r\n this._groundMirror = new MirrorTexture(\r\n \"BackgroundPlaneMirrorTexture\",\r\n { ratio: this._options.groundMirrorSizeRatio },\r\n this._scene,\r\n false,\r\n this._options.groundMirrorTextureType,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n true\r\n );\r\n this._groundMirror.mirrorPlane = new Plane(0, -1, 0, sceneSize.rootPosition.y);\r\n this._groundMirror.anisotropicFilteringLevel = 1;\r\n this._groundMirror.wrapU = wrapping;\r\n this._groundMirror.wrapV = wrapping;\r\n\r\n if (this._groundMirror.renderList) {\r\n for (let i = 0; i < this._scene.meshes.length; i++) {\r\n const mesh = this._scene.meshes[i];\r\n if (mesh !== this._ground && mesh !== this._skybox && mesh !== this._rootMesh) {\r\n this._groundMirror.renderList.push(mesh);\r\n }\r\n }\r\n }\r\n }\r\n\r\n const gammaGround = this._options.groundColor.toGammaSpace(this._scene.getEngine().useExactSrgbConversions);\r\n this._groundMirror.clearColor = new Color4(gammaGround.r, gammaGround.g, gammaGround.b, 1);\r\n this._groundMirror.adaptiveBlurKernel = this._options.groundMirrorBlurKernel;\r\n }\r\n\r\n /**\r\n * Setup the ground to receive the mirror texture.\r\n */\r\n private _setupMirrorInGroundMaterial(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.reflectionTexture = this._groundMirror;\r\n this._groundMaterial.reflectionFresnel = true;\r\n this._groundMaterial.reflectionAmount = this._options.groundMirrorAmount;\r\n this._groundMaterial.reflectionStandardFresnelWeight = this._options.groundMirrorFresnelWeight;\r\n this._groundMaterial.reflectionFalloffDistance = this._options.groundMirrorFallOffDistance;\r\n }\r\n }\r\n\r\n /**\r\n * Setup the skybox according to the specified options.\r\n * @param sceneSize\r\n */\r\n private _setupSkybox(sceneSize: ISceneSize): void {\r\n if (!this._skybox || this._skybox.isDisposed()) {\r\n this._skybox = CreateBox(\"BackgroundSkybox\", { size: sceneSize.skyboxSize, sideOrientation: Mesh.BACKSIDE }, this._scene);\r\n this._skybox.isPickable = false;\r\n this._skybox.onDisposeObservable.add(() => {\r\n this._skybox = null;\r\n });\r\n }\r\n this._skybox.parent = this._rootMesh;\r\n }\r\n\r\n /**\r\n * Setup the skybox material according to the specified options.\r\n */\r\n private _setupSkyboxMaterial(): void {\r\n if (!this._skybox) {\r\n return;\r\n }\r\n\r\n if (!this._skyboxMaterial) {\r\n this._skyboxMaterial = new BackgroundMaterial(\"BackgroundSkyboxMaterial\", this._scene);\r\n }\r\n this._skyboxMaterial.useRGBColor = false;\r\n this._skyboxMaterial.primaryColor = this._options.skyboxColor;\r\n this._skyboxMaterial.enableNoise = true;\r\n\r\n this._skybox.material = this._skyboxMaterial;\r\n }\r\n\r\n /**\r\n * Setup the skybox reflection texture according to the specified options.\r\n */\r\n private _setupSkyboxReflectionTexture(): void {\r\n if (!this._skyboxMaterial) {\r\n return;\r\n }\r\n\r\n if (this._skyboxTexture) {\r\n return;\r\n }\r\n\r\n if (this._options.skyboxTexture instanceof BaseTexture) {\r\n this._skyboxMaterial.reflectionTexture = this._options.skyboxTexture;\r\n return;\r\n }\r\n\r\n this._skyboxTexture = new CubeTexture(this._options.skyboxTexture, this._scene, undefined, undefined, undefined, undefined, this._errorHandler);\r\n this._skyboxTexture.coordinatesMode = Texture.SKYBOX_MODE;\r\n this._skyboxTexture.gammaSpace = false;\r\n this._skyboxMaterial.reflectionTexture = this._skyboxTexture;\r\n }\r\n\r\n private _errorHandler = (message?: string, exception?: any) => {\r\n this.onErrorObservable.notifyObservers({ message: message, exception: exception });\r\n };\r\n\r\n /**\r\n * Dispose all the elements created by the Helper.\r\n */\r\n public dispose(): void {\r\n if (this._groundMaterial) {\r\n this._groundMaterial.dispose(true, true);\r\n }\r\n if (this._skyboxMaterial) {\r\n this._skyboxMaterial.dispose(true, true);\r\n }\r\n this._rootMesh.dispose(false);\r\n }\r\n}\r\n"]}
|
|
@@ -1212,6 +1212,7 @@ __decorate([
|
|
|
1212
1212
|
{ label: "Lambert", value: 2 },
|
|
1213
1213
|
{ label: "Burley", value: 1 },
|
|
1214
1214
|
{ label: "Oren-Nayar", value: 0 },
|
|
1215
|
+
{ label: "Legacy", value: 3 },
|
|
1215
1216
|
],
|
|
1216
1217
|
})
|
|
1217
1218
|
], PBRMetallicRoughnessBlock.prototype, "baseDiffuseModel", void 0);
|