@babylonjs/core 8.8.0 → 8.8.2
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/Actions/actionManager.js +2 -0
- package/Actions/actionManager.js.map +1 -1
- package/Animations/animatable.core.js +1 -1
- package/Animations/animatable.core.js.map +1 -1
- package/Animations/animation.js +4 -2
- package/Animations/animation.js.map +1 -1
- package/Audio/audioEngine.d.ts +1 -1
- package/Audio/audioEngine.js +20 -10
- package/Audio/audioEngine.js.map +1 -1
- package/Audio/audioSceneComponent.js +2 -0
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.js +2 -0
- package/Audio/sound.js.map +1 -1
- package/AudioV2/abstractAudio/audioEngineV2.js +8 -1
- package/AudioV2/abstractAudio/audioEngineV2.js.map +1 -1
- package/AudioV2/abstractAudio/streamingSound.js +3 -1
- package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +6 -2
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js +3 -0
- package/AudioV2/abstractAudio/subProperties/audioAnalyzer.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js +1 -0
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
- package/AudioV2/webAudio/webAudioEngine.js +5 -1
- package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
- package/AudioV2/webAudio/webAudioStaticSound.js +2 -0
- package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
- package/AudioV2/webAudio/webAudioStreamingSound.js +3 -0
- package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
- package/AudioV2/webAudio/webAudioUnmuteUI.js +1 -0
- package/AudioV2/webAudio/webAudioUnmuteUI.js.map +1 -1
- package/BakedVertexAnimation/vertexAnimationBaker.d.ts +1 -0
- package/BakedVertexAnimation/vertexAnimationBaker.js +3 -1
- package/BakedVertexAnimation/vertexAnimationBaker.js.map +1 -1
- package/Buffers/buffer.nonFloatVertexBuffers.js +1 -0
- package/Buffers/buffer.nonFloatVertexBuffers.js.map +1 -1
- package/Buffers/storageBuffer.js +1 -1
- package/Buffers/storageBuffer.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js +2 -0
- package/Cameras/Inputs/arcRotateCameraVRDeviceOrientationInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraDeviceOrientationInput.js +6 -1
- package/Cameras/Inputs/freeCameraDeviceOrientationInput.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.js +2 -0
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Collisions/gpuPicker.js +9 -6
- package/Collisions/gpuPicker.js.map +1 -1
- package/Compute/computeShader.js +1 -1
- package/Compute/computeShader.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.js +3 -3
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Culling/Helper/computeShaderBoundingHelper.js +3 -1
- package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
- package/Culling/Helper/transformFeedbackBoundingHelper.js +3 -0
- package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
- package/Debug/debugLayer.js +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +1 -0
- package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.js +1 -0
- package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.readTexture.js +1 -0
- package/Engines/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +1 -0
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.readTexture.js +1 -0
- package/Engines/WebGPU/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.videoTexture.js +2 -0
- package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +3 -1
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -0
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuQuerySet.js +15 -9
- package/Engines/WebGPU/webgpuQuerySet.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +1 -0
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/WebGPU/webgpuTimestampQuery.js +4 -2
- package/Engines/WebGPU/webgpuTimestampQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuTintWASM.js +1 -0
- package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
- package/Engines/abstractEngine.js +5 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +23 -0
- package/Engines/constants.js +23 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.common.js +7 -1
- package/Engines/engine.common.js.map +1 -1
- package/Engines/engine.js +5 -3
- package/Engines/engine.js.map +1 -1
- package/Engines/engineFactory.js +1 -1
- package/Engines/engineFactory.js.map +1 -1
- package/Engines/nativeEngine.js +19 -11
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +1 -0
- package/Engines/thinEngine.js +22 -18
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +30 -11
- package/Engines/webgpuEngine.js.map +1 -1
- package/FlowGraph/flowGraphParser.js +2 -2
- package/FlowGraph/flowGraphParser.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +5 -1
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.js +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
- package/FrameGraph/frameGraph.js +1 -1
- package/FrameGraph/frameGraph.js.map +1 -1
- package/Helpers/sceneHelpers.js +1 -3
- package/Helpers/sceneHelpers.js.map +1 -1
- package/Helpers/videoDome.js +1 -0
- package/Helpers/videoDome.js.map +1 -1
- package/Layers/thinEffectLayer.js +1 -0
- package/Layers/thinEffectLayer.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +1 -0
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +3 -2
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/areaLight.js +2 -0
- package/Lights/areaLight.js.map +1 -1
- package/Loading/sceneLoader.js +56 -22
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +15 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +34 -7
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +1 -0
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +1 -0
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +1 -0
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +1 -0
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +1 -0
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +1 -0
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/shadowMapBlock.js +1 -0
- package/Materials/Node/Blocks/Fragment/shadowMapBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +9 -11
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +6 -2
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/bonesBlock.js +1 -0
- package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +1 -0
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +11 -3
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +1 -0
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/PBR/pbrBRDFConfiguration.d.ts +11 -0
- package/Materials/PBR/pbrBRDFConfiguration.js +16 -0
- package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +4 -0
- package/Materials/PBR/pbrBaseMaterial.js +12 -8
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +8 -0
- package/Materials/PBR/pbrMaterial.js +16 -0
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js +1 -0
- package/Materials/Textures/Filtering/hdrIrradianceFiltering.js.map +1 -1
- package/Materials/Textures/Loaders/basisTextureLoader.js +4 -0
- package/Materials/Textures/Loaders/basisTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/envTextureLoader.js +1 -0
- package/Materials/Textures/Loaders/envTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/exrTextureLoader.js +2 -0
- package/Materials/Textures/Loaders/exrTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.js +1 -0
- package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/textureLoaderManager.js +9 -9
- package/Materials/Textures/Loaders/textureLoaderManager.js.map +1 -1
- package/Materials/Textures/Packer/packer.js +3 -1
- package/Materials/Textures/Packer/packer.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +1 -0
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.polynomial.js +1 -0
- package/Materials/Textures/baseTexture.polynomial.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.js +1 -0
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.js +1 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.js +3 -0
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +2 -0
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.js +6 -0
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/effect.js +2 -1
- package/Materials/effect.js.map +1 -1
- package/Materials/effect.webgl.functions.js +3 -1
- package/Materials/effect.webgl.functions.js.map +1 -1
- package/Materials/effectRenderer.js +1 -0
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/material.js +2 -1
- package/Materials/material.js.map +1 -1
- package/Materials/shaderMaterial.js +4 -2
- package/Materials/shaderMaterial.js.map +1 -1
- package/Meshes/Compression/dracoCodec.js +5 -1
- package/Meshes/Compression/dracoCodec.js.map +1 -1
- package/Meshes/Compression/dracoCompression.js +4 -3
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/Compression/dracoCompressionWorker.js +5 -2
- package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
- package/Meshes/Compression/dracoDecoder.js +5 -1
- package/Meshes/Compression/dracoDecoder.js.map +1 -1
- package/Meshes/Compression/dracoEncoder.js +3 -2
- package/Meshes/Compression/dracoEncoder.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.js +18 -18
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +14 -15
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +20 -10
- package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.js +1 -0
- package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +5 -1
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/mesh.js +2 -2
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/meshUVSpaceRenderer.js +1 -0
- package/Meshes/meshUVSpaceRenderer.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +1 -0
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/assetsManager.js +2 -1
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/asyncLock.js +5 -2
- package/Misc/asyncLock.js.map +1 -1
- package/Misc/basis.js +9 -2
- package/Misc/basis.js.map +1 -1
- package/Misc/basisWorker.js +3 -1
- package/Misc/basisWorker.js.map +1 -1
- package/Misc/copyTextureToTexture.js +1 -0
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/coroutine.js +2 -1
- package/Misc/coroutine.js.map +1 -1
- package/Misc/dataReader.js +3 -4
- package/Misc/dataReader.js.map +1 -1
- package/Misc/dumpTools.js +7 -1
- package/Misc/dumpTools.js.map +1 -1
- package/Misc/environmentTextureTools.d.ts +0 -2
- package/Misc/environmentTextureTools.js +20 -7
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/equirectangularCapture.js +2 -1
- package/Misc/equirectangularCapture.js.map +1 -1
- package/Misc/fileTools.js +2 -0
- package/Misc/fileTools.js.map +1 -1
- package/Misc/filesInput.js +5 -1
- package/Misc/filesInput.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +10 -3
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/khronosTextureContainer2Worker.js +4 -1
- package/Misc/khronosTextureContainer2Worker.js.map +1 -1
- package/Misc/minMaxReducer.js +1 -0
- package/Misc/minMaxReducer.js.map +1 -1
- package/Misc/observable.extensions.js +3 -1
- package/Misc/observable.extensions.js.map +1 -1
- package/Misc/observable.js +2 -0
- package/Misc/observable.js.map +1 -1
- package/Misc/observableCoroutine.js +1 -0
- package/Misc/observableCoroutine.js.map +1 -1
- package/Misc/reflector.js +1 -0
- package/Misc/reflector.js.map +1 -1
- package/Misc/rgbdTextureTools.js +2 -1
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/sceneSerializer.js +2 -2
- package/Misc/sceneSerializer.js.map +1 -1
- package/Misc/screenshotTools.js +9 -4
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/textureTools.js +2 -0
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.internals.js +2 -1
- package/Misc/tools.internals.js.map +1 -1
- package/Misc/tools.js +9 -3
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.js +1 -0
- package/Misc/videoRecorder.js.map +1 -1
- package/Misc/webRequest.fetch.js +2 -1
- package/Misc/webRequest.fetch.js.map +1 -1
- package/Misc/workerPool.js +3 -0
- package/Misc/workerPool.js.map +1 -1
- package/Particles/flowMap.js +1 -1
- package/Particles/flowMap.js.map +1 -1
- package/Particles/particleHelper.js +7 -0
- package/Particles/particleHelper.js.map +1 -1
- package/Particles/pointsCloudSystem.js +7 -7
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Particles/thinParticleSystem.js +2 -0
- package/Particles/thinParticleSystem.js.map +1 -1
- package/Physics/physicsHelper.js +2 -2
- package/Physics/physicsHelper.js.map +1 -1
- package/Physics/v1/Plugins/oimoJSPlugin.js +1 -1
- package/Physics/v1/Plugins/oimoJSPlugin.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +1 -0
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/Rendering/GlobalIllumination/giRSMManager.js +1 -0
- package/Rendering/GlobalIllumination/giRSMManager.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +1 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
- package/Rendering/depthRenderer.js +1 -0
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTextures.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +1 -0
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/iblCdfGenerator.js +4 -1
- package/Rendering/iblCdfGenerator.js.map +1 -1
- package/Shaders/ShadersInclude/lightFragment.js +5 -1
- package/Shaders/ShadersInclude/lightFragment.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js +12 -5
- package/Shaders/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockDirectLighting.js +3 -0
- package/Shaders/ShadersInclude/pbrBlockDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js +21 -8
- package/Shaders/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js +3 -0
- package/Shaders/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectance.js +6 -6
- package/Shaders/ShadersInclude/pbrBlockReflectance.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectance0.js +2 -7
- package/Shaders/ShadersInclude/pbrBlockReflectance0.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockReflectivity.js +20 -16
- package/Shaders/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js +6 -8
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDebug.js +2 -2
- package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +1 -5
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/pbr.fragment.js +7 -3
- package/Shaders/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js +5 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +5 -5
- package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js +3 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js +21 -8
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalLitComponents.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js +3 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockFinalUnlitComponents.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js +6 -6
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance0.js +2 -7
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectance0.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js +22 -15
- package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js +6 -8
- package/ShadersWGSL/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js +2 -2
- package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +1 -7
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +7 -3
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/Sprites/spriteManager.js +5 -1
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.js +1 -0
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.js +4 -3
- package/XR/features/WebXRAnchorSystem.js.map +1 -1
- package/XR/features/WebXRDepthSensing.js +1 -1
- package/XR/features/WebXRDepthSensing.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +4 -1
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRHitTest.js +4 -1
- package/XR/features/WebXRHitTest.js.map +1 -1
- package/XR/features/WebXRHitTestLegacy.js +6 -5
- package/XR/features/WebXRHitTestLegacy.js.map +1 -1
- package/XR/features/WebXRImageTracking.js +2 -1
- package/XR/features/WebXRImageTracking.js.map +1 -1
- package/XR/features/WebXRLightEstimation.js +3 -0
- package/XR/features/WebXRLightEstimation.js.map +1 -1
- package/XR/features/WebXRNearInteraction.js +2 -0
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.js +2 -2
- package/XR/features/WebXRPlaneDetector.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.js +3 -2
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/motionController/webXRMicrosoftMixedRealityController.js +6 -6
- package/XR/motionController/webXRMicrosoftMixedRealityController.js.map +1 -1
- package/XR/motionController/webXRMotionControllerManager.js +15 -9
- package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
- package/XR/motionController/webXRProfiledMotionController.js +1 -1
- package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
- package/XR/native/nativeXRFrame.js +1 -0
- package/XR/native/nativeXRFrame.js.map +1 -1
- package/XR/webXRDefaultExperience.js +10 -12
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXREnterExitUI.js +2 -1
- package/XR/webXREnterExitUI.js.map +1 -1
- package/XR/webXRExperienceHelper.js +5 -2
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRFeaturesManager.js +1 -0
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/XR/webXRInput.js +1 -0
- package/XR/webXRInput.js.map +1 -1
- package/XR/webXRInputSource.js +2 -0
- package/XR/webXRInputSource.js.map +1 -1
- package/XR/webXRManagedOutputCanvas.js +5 -1
- package/XR/webXRManagedOutputCanvas.js.map +1 -1
- package/XR/webXRSessionManager.js +56 -60
- package/XR/webXRSessionManager.js.map +1 -1
- package/assetContainer.js +28 -28
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +5 -4
- package/scene.js.map +1 -1
|
@@ -203,6 +203,14 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
203
203
|
* The color reflected from the material.
|
|
204
204
|
*/
|
|
205
205
|
reflectionColor: Color3;
|
|
206
|
+
/**
|
|
207
|
+
* The material model to use for specular lighting of dielectric materials.
|
|
208
|
+
*/
|
|
209
|
+
dielectricSpecularModel: number;
|
|
210
|
+
/**
|
|
211
|
+
* The material model to use for specular lighting.
|
|
212
|
+
*/
|
|
213
|
+
conductorSpecularModel: number;
|
|
206
214
|
/**
|
|
207
215
|
* The color emitted from the material.
|
|
208
216
|
*/
|
|
@@ -316,6 +316,14 @@ export class PBRMaterial extends PBRBaseMaterial {
|
|
|
316
316
|
* The color reflected from the material.
|
|
317
317
|
*/
|
|
318
318
|
this.reflectionColor = new Color3(1.0, 1.0, 1.0);
|
|
319
|
+
/**
|
|
320
|
+
* The material model to use for specular lighting of dielectric materials.
|
|
321
|
+
*/
|
|
322
|
+
this.dielectricSpecularModel = 0;
|
|
323
|
+
/**
|
|
324
|
+
* The material model to use for specular lighting.
|
|
325
|
+
*/
|
|
326
|
+
this.conductorSpecularModel = 0;
|
|
319
327
|
/**
|
|
320
328
|
* The color emitted from the material.
|
|
321
329
|
*/
|
|
@@ -693,6 +701,14 @@ __decorate([
|
|
|
693
701
|
serializeAsColor3("reflection"),
|
|
694
702
|
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
695
703
|
], PBRMaterial.prototype, "reflectionColor", void 0);
|
|
704
|
+
__decorate([
|
|
705
|
+
serialize("dielectricSpecularModel"),
|
|
706
|
+
expandToProperty("_markAllSubMeshesAsMiscDirty")
|
|
707
|
+
], PBRMaterial.prototype, "dielectricSpecularModel", void 0);
|
|
708
|
+
__decorate([
|
|
709
|
+
serialize("conductorSpecularModel"),
|
|
710
|
+
expandToProperty("_markAllSubMeshesAsMiscDirty")
|
|
711
|
+
], PBRMaterial.prototype, "conductorSpecularModel", void 0);
|
|
696
712
|
__decorate([
|
|
697
713
|
serializeAsColor3("emissive"),
|
|
698
714
|
expandToProperty("_markAllSubMeshesAsTexturesDirty")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pbrMaterial.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/PBR/pbrMaterial.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,aA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AAC;oDACtB;AAQxB;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;0DAChB;AAW9B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;2DACO;AAOrD;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;uDACnB;AAS3B;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;+DACX;AAQnC;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;wDACnB;AAQ3B;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;yDAClB;AAO5B;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,8BAA8B,CAAC;0CAC5B;AAOd;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,8BAA8B,CAAC;gEACN;AAuN/C,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { serialize, serializeAsColor3, expandToProperty, serializeAsTexture } from \"../../Misc/decorators\";\r\nimport { GetEnvironmentBRDFTexture } from \"../../Misc/brdfTextureTools\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Color3 } from \"../../Maths/math.color\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport type { ImageProcessingConfiguration } from \"../../Materials/imageProcessingConfiguration\";\r\nimport type { ColorCurves } from \"../../Materials/colorCurves\";\r\nimport type { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { PBRBaseMaterial } from \"./pbrBaseMaterial\";\r\nimport { RegisterClass } from \"../../Misc/typeStore\";\r\nimport { Material } from \"../material\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\r\n\r\n/**\r\n * The Physically based material of BJS.\r\n *\r\n * This offers the main features of a standard PBR material.\r\n * For more information, please refer to the documentation :\r\n * https://doc.babylonjs.com/features/featuresDeepDive/materials/using/introToPBR\r\n */\r\nexport class PBRMaterial extends PBRBaseMaterial {\r\n /**\r\n * PBRMaterialTransparencyMode: No transparency mode, Alpha channel is not use.\r\n */\r\n public static override readonly PBRMATERIAL_OPAQUE = PBRBaseMaterial.PBRMATERIAL_OPAQUE;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.\r\n */\r\n public static override readonly PBRMATERIAL_ALPHATEST = PBRBaseMaterial.PBRMATERIAL_ALPHATEST;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.\r\n */\r\n public static override readonly PBRMATERIAL_ALPHABLEND = PBRBaseMaterial.PBRMATERIAL_ALPHABLEND;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.\r\n * They are also discarded below the alpha cutoff threshold to improve performances.\r\n */\r\n public static override readonly PBRMATERIAL_ALPHATESTANDBLEND = PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND;\r\n\r\n /**\r\n * Defines the default value of how much AO map is occluding the analytical lights\r\n * (point spot...).\r\n */\r\n public static override DEFAULT_AO_ON_ANALYTICAL_LIGHTS = PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;\r\n\r\n /**\r\n * Defines the default diffuse model used by the material.\r\n */\r\n public static override DEFAULT_DIFFUSE_MODEL = Constants.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR;\r\n\r\n /**\r\n * Intensity of the direct lights e.g. the four lights available in your scene.\r\n * This impacts both the direct diffuse and specular highlights.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public directIntensity: number = 1.0;\r\n\r\n /**\r\n * Intensity of the emissive part of the material.\r\n * This helps controlling the emissive effect without modifying the emissive color.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveIntensity: number = 1.0;\r\n\r\n /**\r\n * Intensity of the environment e.g. how much the environment will light the object\r\n * either through harmonics for rough material or through the reflection for shiny ones.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public environmentIntensity: number = 1.0;\r\n\r\n /**\r\n * This is a special control allowing the reduction of the specular highlights coming from the\r\n * four lights of the scene. Those highlights may not be needed in full environment lighting.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public specularIntensity: number = 1.0;\r\n\r\n /**\r\n * Debug Control allowing disabling the bump map on this material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public disableBumpMap: boolean = false;\r\n\r\n /**\r\n * AKA Diffuse Texture in standard nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public albedoTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * OpenPBR Base Weight texture (multiplier to the diffuse and metal lobes).\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public baseWeightTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * OpenPBR Base Diffuse Roughness texture (roughness of the diffuse lobe).\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public baseDiffuseRoughnessTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * AKA Occlusion Texture in other nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * AKA Occlusion Texture Intensity in other nomenclature.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTextureStrength: number = 1.0;\r\n\r\n /**\r\n * Defines how much the AO map is occluding the analytical lights (point spot...).\r\n * 1 means it completely occludes it\r\n * 0 mean it has no impact\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTextureImpactOnAnalyticalLights: number = PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;\r\n\r\n /**\r\n * Stores the alpha values in a texture. Use luminance if texture.getAlphaFromRGB is true.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public opacityTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the reflection values in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectionTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the emissive values in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * AKA Specular texture in other nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectivityTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Used to switch from specular/glossiness to metallic/roughness workflow.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Specifies the metallic scalar of the metallic/roughness workflow.\r\n * Can also be used to scale the metalness values of the metallic texture.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallic: Nullable<number>;\r\n\r\n /**\r\n * Specifies the roughness scalar of the metallic/roughness workflow.\r\n * Can also be used to scale the roughness values of the metallic texture.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public roughness: Nullable<number>;\r\n\r\n /**\r\n * In metallic workflow, specifies an F0 factor to help configuring the material F0.\r\n * By default the indexOfrefraction is used to compute F0;\r\n *\r\n * This is used as a factor against the default reflectance at normal incidence to tweak it.\r\n *\r\n * F0 = defaultF0 * metallicF0Factor * metallicReflectanceColor;\r\n * F90 = metallicReflectanceColor;\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicF0Factor = 1;\r\n\r\n /**\r\n * In metallic workflow, specifies an F0 color.\r\n * By default the F90 is always 1;\r\n *\r\n * Please note that this factor is also used as a factor against the default reflectance at normal incidence.\r\n *\r\n * F0 = defaultF0_from_IOR * metallicF0Factor * metallicReflectanceColor\r\n * F90 = metallicF0Factor;\r\n */\r\n @serializeAsColor3()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicReflectanceColor = Color3.White();\r\n\r\n /**\r\n * Specifies that only the A channel from metallicReflectanceTexture should be used.\r\n * If false, both RGB and A channels will be used\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useOnlyMetallicFromMetallicReflectanceTexture = false;\r\n\r\n /**\r\n * Defines to store metallicReflectanceColor in RGB and metallicF0Factor in A\r\n * This is multiplied against the scalar values defined in the material.\r\n * If useOnlyMetallicFromMetallicReflectanceTexture is true, don't use the RGB channels, only A\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicReflectanceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Defines to store reflectanceColor in RGB\r\n * This is multiplied against the scalar values defined in the material.\r\n * If both reflectanceTexture and metallicReflectanceTexture textures are provided and useOnlyMetallicFromMetallicReflectanceTexture\r\n * is false, metallicReflectanceTexture takes priority and reflectanceTexture is not used\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectanceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.\r\n * Gray Scale represents roughness in metallic mode and glossiness in specular mode.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public microSurfaceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores surface normal data used to displace a mesh in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the pre-calculated light information of a mesh in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", null)\r\n public lightmapTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the refracted light information in a texture.\r\n */\r\n public get refractionTexture(): Nullable<BaseTexture> {\r\n return this.subSurface.refractionTexture;\r\n }\r\n public set refractionTexture(value: Nullable<BaseTexture>) {\r\n this.subSurface.refractionTexture = value;\r\n if (value) {\r\n this.subSurface.isRefractionEnabled = true;\r\n } else if (!this.subSurface.linkRefractionWithTransparency) {\r\n this.subSurface.isRefractionEnabled = false;\r\n }\r\n }\r\n\r\n /**\r\n * The color of a material in ambient lighting.\r\n */\r\n @serializeAsColor3(\"ambient\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientColor = new Color3(0, 0, 0);\r\n\r\n /**\r\n * AKA Diffuse Color in other nomenclature.\r\n */\r\n @serializeAsColor3(\"albedo\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public albedoColor = new Color3(1, 1, 1);\r\n\r\n /**\r\n * OpenPBR Base Weight (multiplier to the diffuse and metal lobes).\r\n */\r\n @serialize(\"baseWeight\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public baseWeight = 1;\r\n\r\n /**\r\n * OpenPBR Base Diffuse Roughness (roughness of the diffuse lobe).\r\n */\r\n @serialize(\"baseDiffuseRoughness\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public baseDiffuseRoughness: Nullable<number>;\r\n\r\n /**\r\n * Defines the base diffuse roughness model of the material.\r\n */\r\n @serialize(\"baseDiffuseModel\")\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public baseDiffuseModel: number = PBRMaterial.DEFAULT_DIFFUSE_MODEL;\r\n\r\n /**\r\n * AKA Specular Color in other nomenclature.\r\n */\r\n @serializeAsColor3(\"reflectivity\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectivityColor = new Color3(1, 1, 1);\r\n\r\n /**\r\n * The color reflected from the material.\r\n */\r\n @serializeAsColor3(\"reflection\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectionColor = new Color3(1.0, 1.0, 1.0);\r\n\r\n /**\r\n * The color emitted from the material.\r\n */\r\n @serializeAsColor3(\"emissive\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveColor = new Color3(0, 0, 0);\r\n\r\n /**\r\n * AKA Glossiness in other nomenclature.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public microSurface = 1.0;\r\n\r\n /**\r\n * Index of refraction of the material base layer.\r\n * https://en.wikipedia.org/wiki/List_of_refractive_indices\r\n *\r\n * This does not only impact refraction but also the Base F0 of Dielectric Materials.\r\n *\r\n * From dielectric fresnel rules: F0 = square((iorT - iorI) / (iorT + iorI))\r\n */\r\n public get indexOfRefraction(): number {\r\n return this.subSurface.indexOfRefraction;\r\n }\r\n public set indexOfRefraction(value: number) {\r\n this.subSurface.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.\r\n */\r\n public get invertRefractionY(): boolean {\r\n return this.subSurface.invertRefractionY;\r\n }\r\n public set invertRefractionY(value: boolean) {\r\n this.subSurface.invertRefractionY = value;\r\n }\r\n\r\n /**\r\n * This parameters will make the material used its opacity to control how much it is refracting against not.\r\n * Materials half opaque for instance using refraction could benefit from this control.\r\n */\r\n public get linkRefractionWithTransparency(): boolean {\r\n return this.subSurface.linkRefractionWithTransparency;\r\n }\r\n public set linkRefractionWithTransparency(value: boolean) {\r\n this.subSurface.linkRefractionWithTransparency = value;\r\n if (value) {\r\n this.subSurface.isRefractionEnabled = true;\r\n }\r\n }\r\n\r\n /**\r\n * If true, the light map contains occlusion information instead of lighting info.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useLightmapAsShadowmap = false;\r\n\r\n /**\r\n * Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public useAlphaFromAlbedoTexture = false;\r\n\r\n /**\r\n * Enforces alpha test in opaque or blend mode in order to improve the performances of some situations.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public forceAlphaTest = false;\r\n\r\n /**\r\n * Defines the alpha limits in alpha test mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public alphaCutOff = 0.4;\r\n\r\n /**\r\n * Specifies that the material will keep the specular highlights over a transparent surface (only the most luminous ones).\r\n * A car glass is a good example of that. When sun reflects on it you can not see what is behind.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useSpecularOverAlpha = true;\r\n\r\n /**\r\n * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useMicroSurfaceFromReflectivityMapAlpha = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the roughness information in its alpha channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRoughnessFromMetallicTextureAlpha = true;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the roughness information in its green channel.\r\n * Needs useRoughnessFromMetallicTextureAlpha to be false.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRoughnessFromMetallicTextureGreen = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the metallness information in its blue channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useMetallnessFromMetallicTextureBlue = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the ambient occlusion information in its red channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAmbientOcclusionFromMetallicTextureRed = false;\r\n\r\n /**\r\n * Specifies if the ambient texture contains the ambient occlusion information in its red channel only.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAmbientInGrayScale = false;\r\n\r\n /**\r\n * In case the reflectivity map does not contain the microsurface information in its alpha channel,\r\n * The material will try to infer what glossiness each pixel should be.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAutoMicroSurfaceFromReflectivityMap = false;\r\n\r\n /**\r\n * BJS is using an hardcoded light falloff based on a manually sets up range.\r\n * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.\r\n * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.\r\n */\r\n @serialize()\r\n public get usePhysicalLightFalloff(): boolean {\r\n return this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL;\r\n }\r\n\r\n /**\r\n * BJS is using an hardcoded light falloff based on a manually sets up range.\r\n * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.\r\n * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.\r\n */\r\n public set usePhysicalLightFalloff(value: boolean) {\r\n if (value !== this.usePhysicalLightFalloff) {\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n\r\n if (value) {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL;\r\n } else {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_STANDARD;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * In order to support the falloff compatibility with gltf, a special mode has been added\r\n * to reproduce the gltf light falloff.\r\n */\r\n @serialize()\r\n public get useGLTFLightFalloff(): boolean {\r\n return this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_GLTF;\r\n }\r\n\r\n /**\r\n * In order to support the falloff compatibility with gltf, a special mode has been added\r\n * to reproduce the gltf light falloff.\r\n */\r\n public set useGLTFLightFalloff(value: boolean) {\r\n if (value !== this.useGLTFLightFalloff) {\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n\r\n if (value) {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_GLTF;\r\n } else {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_STANDARD;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most luminous ones).\r\n * A car glass is a good example of that. When the street lights reflects on it you can not see what is behind.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRadianceOverAlpha = true;\r\n\r\n /**\r\n * Allows using an object space normal map (instead of tangent space).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useObjectSpaceNormalMap = false;\r\n\r\n /**\r\n * Allows using the bump map in parallax mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useParallax = false;\r\n\r\n /**\r\n * Allows using the bump map in parallax occlusion mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useParallaxOcclusion = false;\r\n\r\n /**\r\n * Controls the scale bias of the parallax mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public parallaxScaleBias = 0.05;\r\n\r\n /**\r\n * If sets to true, disables all the lights affecting the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public disableLighting = false;\r\n\r\n /**\r\n * Force the shader to compute irradiance in the fragment shader in order to take bump in account.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public forceIrradianceInFragment = false;\r\n\r\n /**\r\n * Number of Simultaneous lights allowed on the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public maxSimultaneousLights = 4;\r\n\r\n /**\r\n * If sets to true, x component of normal map value will invert (x = 1.0 - x).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public invertNormalMapX = false;\r\n\r\n /**\r\n * If sets to true, y component of normal map value will invert (y = 1.0 - y).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public invertNormalMapY = false;\r\n\r\n /**\r\n * If sets to true and backfaceCulling is false, normals will be flipped on the backside.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public twoSidedLighting = false;\r\n\r\n /**\r\n * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.\r\n * And/Or occlude the blended part. (alpha is converted to gamma to compute the fresnel)\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAlphaFresnel = false;\r\n\r\n /**\r\n * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.\r\n * And/Or occlude the blended part. (alpha stays linear to compute the fresnel)\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useLinearAlphaFresnel = false;\r\n\r\n /**\r\n * Let user defines the brdf lookup texture used for IBL.\r\n * A default 8bit version is embedded but you could point at :\r\n * * Default texture: https://assets.babylonjs.com/environments/correlatedMSBRDF_RGBD.png\r\n * * Default 16bit pixel depth texture: https://assets.babylonjs.com/environments/correlatedMSBRDF.dds\r\n * * LEGACY Default None correlated https://assets.babylonjs.com/environments/uncorrelatedBRDF_RGBD.png\r\n * * LEGACY Default None correlated 16bit pixel depth https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds\r\n */\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public environmentBRDFTexture: Nullable<BaseTexture> = null;\r\n\r\n /**\r\n * Force normal to face away from face.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public forceNormalForward = false;\r\n\r\n /**\r\n * Enables specular anti aliasing in the PBR shader.\r\n * It will both interacts on the Geometry for analytical and IBL lighting.\r\n * It also prefilter the roughness map based on the bump values.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public enableSpecularAntiAliasing = false;\r\n\r\n /**\r\n * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal\r\n * makes the reflect vector face the model (under horizon).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useHorizonOcclusion = true;\r\n\r\n /**\r\n * This parameters will enable/disable radiance occlusion by preventing the radiance to lit\r\n * too much the area relying on ambient texture to define their ambient occlusion.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRadianceOcclusion = true;\r\n\r\n /**\r\n * If set to true, no lighting calculations will be applied.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public unlit = false;\r\n\r\n /**\r\n * If sets to true, the decal map will be applied after the detail map. Else, it is applied before (default: false)\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public applyDecalMapAfterDetailMap = false;\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): ImageProcessingConfiguration {\r\n return this._imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: ImageProcessingConfiguration) {\r\n this._attachImageProcessingConfiguration(value);\r\n\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n }\r\n\r\n /**\r\n * Gets whether the color curves effect is enabled.\r\n */\r\n public get cameraColorCurvesEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorCurvesEnabled;\r\n }\r\n /**\r\n * Sets whether the color curves effect is enabled.\r\n */\r\n public set cameraColorCurvesEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorCurvesEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public get cameraColorGradingEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorGradingEnabled;\r\n }\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public set cameraColorGradingEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorGradingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets whether tonemapping is enabled or not.\r\n */\r\n public get cameraToneMappingEnabled(): boolean {\r\n return this._imageProcessingConfiguration.toneMappingEnabled;\r\n }\r\n /**\r\n * Sets whether tonemapping is enabled or not\r\n */\r\n public set cameraToneMappingEnabled(value: boolean) {\r\n this._imageProcessingConfiguration.toneMappingEnabled = value;\r\n }\r\n\r\n /**\r\n * The camera exposure used on this material.\r\n * This property is here and not in the camera to allow controlling exposure without full screen post process.\r\n * This corresponds to a photographic exposure.\r\n */\r\n public get cameraExposure(): number {\r\n return this._imageProcessingConfiguration.exposure;\r\n }\r\n /**\r\n * The camera exposure used on this material.\r\n * This property is here and not in the camera to allow controlling exposure without full screen post process.\r\n * This corresponds to a photographic exposure.\r\n */\r\n public set cameraExposure(value: number) {\r\n this._imageProcessingConfiguration.exposure = value;\r\n }\r\n\r\n /**\r\n * Gets The camera contrast used on this material.\r\n */\r\n public get cameraContrast(): number {\r\n return this._imageProcessingConfiguration.contrast;\r\n }\r\n\r\n /**\r\n * Sets The camera contrast used on this material.\r\n */\r\n public set cameraContrast(value: number) {\r\n this._imageProcessingConfiguration.contrast = value;\r\n }\r\n\r\n /**\r\n * Gets the Color Grading 2D Lookup Texture.\r\n */\r\n public get cameraColorGradingTexture(): Nullable<BaseTexture> {\r\n return this._imageProcessingConfiguration.colorGradingTexture;\r\n }\r\n /**\r\n * Sets the Color Grading 2D Lookup Texture.\r\n */\r\n public set cameraColorGradingTexture(value: Nullable<BaseTexture>) {\r\n this._imageProcessingConfiguration.colorGradingTexture = value;\r\n }\r\n\r\n /**\r\n * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).\r\n * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.\r\n * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;\r\n * corresponding to low luminance, medium luminance, and high luminance areas respectively.\r\n */\r\n public get cameraColorCurves(): Nullable<ColorCurves> {\r\n return this._imageProcessingConfiguration.colorCurves;\r\n }\r\n /**\r\n * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).\r\n * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.\r\n * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;\r\n * corresponding to low luminance, medium luminance, and high luminance areas respectively.\r\n */\r\n public set cameraColorCurves(value: Nullable<ColorCurves>) {\r\n this._imageProcessingConfiguration.colorCurves = value;\r\n }\r\n\r\n /**\r\n * Instantiates a new PBRMaterial instance.\r\n *\r\n * @param name The material name\r\n * @param scene The scene the material will be use in.\r\n * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false\r\n */\r\n constructor(name: string, scene?: Scene, forceGLSL = false) {\r\n super(name, scene, forceGLSL);\r\n\r\n this._environmentBRDFTexture = GetEnvironmentBRDFTexture(this.getScene());\r\n }\r\n\r\n /**\r\n * @returns the name of this material class.\r\n */\r\n public override getClassName(): string {\r\n return \"PBRMaterial\";\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current material.\r\n * @param name - name to use for the new material.\r\n * @param cloneTexturesOnlyOnce - if a texture is used in more than one channel (e.g diffuse and opacity), only clone it once and reuse it on the other channels. Default false.\r\n * @param rootUrl defines the root URL to use to load textures\r\n * @returns cloned material instance\r\n */\r\n public override clone(name: string, cloneTexturesOnlyOnce: boolean = true, rootUrl = \"\"): PBRMaterial {\r\n const clone = SerializationHelper.Clone(() => new PBRMaterial(name, this.getScene()), this, { cloneTexturesOnlyOnce });\r\n\r\n clone.id = name;\r\n clone.name = name;\r\n\r\n this.stencil.copyTo(clone.stencil);\r\n\r\n this._clonePlugins(clone, rootUrl);\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serializes this PBR Material.\r\n * @returns - An object with the serialized material.\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.PBRMaterial\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Parses a PBR Material from a serialized object.\r\n * @param source - Serialized object.\r\n * @param scene - BJS scene instance.\r\n * @param rootUrl - url for the scene object\r\n * @returns - PBRMaterial\r\n */\r\n public static override Parse(source: any, scene: Scene, rootUrl: string): PBRMaterial {\r\n const material = SerializationHelper.Parse(() => new PBRMaterial(source.name, scene), source, scene, rootUrl);\r\n\r\n if (source.stencil) {\r\n material.stencil.parse(source.stencil, scene, rootUrl);\r\n }\r\n\r\n Material._ParsePlugins(source, material, scene, rootUrl);\r\n\r\n // The code block below ensures backward compatibility with serialized materials before plugins are automatically serialized.\r\n if (source.clearCoat) {\r\n material.clearCoat.parse(source.clearCoat, scene, rootUrl);\r\n }\r\n if (source.anisotropy) {\r\n material.anisotropy.parse(source.anisotropy, scene, rootUrl);\r\n }\r\n if (source.brdf) {\r\n material.brdf.parse(source.brdf, scene, rootUrl);\r\n }\r\n if (source.sheen) {\r\n material.sheen.parse(source.sheen, scene, rootUrl);\r\n }\r\n if (source.subSurface) {\r\n material.subSurface.parse(source.subSurface, scene, rootUrl);\r\n }\r\n if (source.iridescence) {\r\n material.iridescence.parse(source.iridescence, scene, rootUrl);\r\n }\r\n\r\n return material;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRMaterial\", PBRMaterial);\r\n"]}
|
|
1
|
+
{"version":3,"file":"pbrMaterial.js","sourceRoot":"","sources":["../../../../../dev/core/src/Materials/PBR/pbrMaterial.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAIpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,OAAO,WAAY,SAAQ,eAAe;IAkP5C;;OAEG;IACH,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;IAC7C,CAAC;IACD,IAAW,iBAAiB,CAAC,KAA4B;QACrD,IAAI,CAAC,UAAU,CAAC,iBAAi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C,CAAC;oDACtB;AAQxB;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;0DAChB;AAW9B;IADN,gBAAgB,CAAC,kCAAkC,CAAC;2DACO;AAOrD;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;uDACnB;AAS3B;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;+DACX;AAQnC;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;wDACnB;AAQ3B;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,kCAAkC,CAAC;yDAClB;AAO5B;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,8BAA8B,CAAC;0CAC5B;AAOd;IAFN,SAAS,EAAE;IACX,gBAAgB,CAAC,8BAA8B,CAAC;gEACN;AAuN/C,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { serialize, serializeAsColor3, expandToProperty, serializeAsTexture } from \"../../Misc/decorators\";\r\nimport { GetEnvironmentBRDFTexture } from \"../../Misc/brdfTextureTools\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Color3 } from \"../../Maths/math.color\";\r\nimport { Constants } from \"../../Engines/constants\";\r\nimport type { ImageProcessingConfiguration } from \"../../Materials/imageProcessingConfiguration\";\r\nimport type { ColorCurves } from \"../../Materials/colorCurves\";\r\nimport type { BaseTexture } from \"../../Materials/Textures/baseTexture\";\r\nimport { PBRBaseMaterial } from \"./pbrBaseMaterial\";\r\nimport { RegisterClass } from \"../../Misc/typeStore\";\r\nimport { Material } from \"../material\";\r\nimport { SerializationHelper } from \"../../Misc/decorators.serialization\";\r\n\r\n/**\r\n * The Physically based material of BJS.\r\n *\r\n * This offers the main features of a standard PBR material.\r\n * For more information, please refer to the documentation :\r\n * https://doc.babylonjs.com/features/featuresDeepDive/materials/using/introToPBR\r\n */\r\nexport class PBRMaterial extends PBRBaseMaterial {\r\n /**\r\n * PBRMaterialTransparencyMode: No transparency mode, Alpha channel is not use.\r\n */\r\n public static override readonly PBRMATERIAL_OPAQUE = PBRBaseMaterial.PBRMATERIAL_OPAQUE;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.\r\n */\r\n public static override readonly PBRMATERIAL_ALPHATEST = PBRBaseMaterial.PBRMATERIAL_ALPHATEST;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.\r\n */\r\n public static override readonly PBRMATERIAL_ALPHABLEND = PBRBaseMaterial.PBRMATERIAL_ALPHABLEND;\r\n\r\n /**\r\n * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.\r\n * They are also discarded below the alpha cutoff threshold to improve performances.\r\n */\r\n public static override readonly PBRMATERIAL_ALPHATESTANDBLEND = PBRBaseMaterial.PBRMATERIAL_ALPHATESTANDBLEND;\r\n\r\n /**\r\n * Defines the default value of how much AO map is occluding the analytical lights\r\n * (point spot...).\r\n */\r\n public static override DEFAULT_AO_ON_ANALYTICAL_LIGHTS = PBRBaseMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;\r\n\r\n /**\r\n * Defines the default diffuse model used by the material.\r\n */\r\n public static override DEFAULT_DIFFUSE_MODEL = Constants.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR;\r\n\r\n /**\r\n * Intensity of the direct lights e.g. the four lights available in your scene.\r\n * This impacts both the direct diffuse and specular highlights.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public directIntensity: number = 1.0;\r\n\r\n /**\r\n * Intensity of the emissive part of the material.\r\n * This helps controlling the emissive effect without modifying the emissive color.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveIntensity: number = 1.0;\r\n\r\n /**\r\n * Intensity of the environment e.g. how much the environment will light the object\r\n * either through harmonics for rough material or through the reflection for shiny ones.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public environmentIntensity: number = 1.0;\r\n\r\n /**\r\n * This is a special control allowing the reduction of the specular highlights coming from the\r\n * four lights of the scene. Those highlights may not be needed in full environment lighting.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public specularIntensity: number = 1.0;\r\n\r\n /**\r\n * Debug Control allowing disabling the bump map on this material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public disableBumpMap: boolean = false;\r\n\r\n /**\r\n * AKA Diffuse Texture in standard nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public albedoTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * OpenPBR Base Weight texture (multiplier to the diffuse and metal lobes).\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public baseWeightTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * OpenPBR Base Diffuse Roughness texture (roughness of the diffuse lobe).\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public baseDiffuseRoughnessTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * AKA Occlusion Texture in other nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * AKA Occlusion Texture Intensity in other nomenclature.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTextureStrength: number = 1.0;\r\n\r\n /**\r\n * Defines how much the AO map is occluding the analytical lights (point spot...).\r\n * 1 means it completely occludes it\r\n * 0 mean it has no impact\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientTextureImpactOnAnalyticalLights: number = PBRMaterial.DEFAULT_AO_ON_ANALYTICAL_LIGHTS;\r\n\r\n /**\r\n * Stores the alpha values in a texture. Use luminance if texture.getAlphaFromRGB is true.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public opacityTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the reflection values in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectionTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the emissive values in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * AKA Specular texture in other nomenclature.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectivityTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Used to switch from specular/glossiness to metallic/roughness workflow.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Specifies the metallic scalar of the metallic/roughness workflow.\r\n * Can also be used to scale the metalness values of the metallic texture.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallic: Nullable<number>;\r\n\r\n /**\r\n * Specifies the roughness scalar of the metallic/roughness workflow.\r\n * Can also be used to scale the roughness values of the metallic texture.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public roughness: Nullable<number>;\r\n\r\n /**\r\n * In metallic workflow, specifies an F0 factor to help configuring the material F0.\r\n * By default the indexOfrefraction is used to compute F0;\r\n *\r\n * This is used as a factor against the default reflectance at normal incidence to tweak it.\r\n *\r\n * F0 = defaultF0 * metallicF0Factor * metallicReflectanceColor;\r\n * F90 = metallicReflectanceColor;\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicF0Factor = 1;\r\n\r\n /**\r\n * In metallic workflow, specifies an F0 color.\r\n * By default the F90 is always 1;\r\n *\r\n * Please note that this factor is also used as a factor against the default reflectance at normal incidence.\r\n *\r\n * F0 = defaultF0_from_IOR * metallicF0Factor * metallicReflectanceColor\r\n * F90 = metallicF0Factor;\r\n */\r\n @serializeAsColor3()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicReflectanceColor = Color3.White();\r\n\r\n /**\r\n * Specifies that only the A channel from metallicReflectanceTexture should be used.\r\n * If false, both RGB and A channels will be used\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useOnlyMetallicFromMetallicReflectanceTexture = false;\r\n\r\n /**\r\n * Defines to store metallicReflectanceColor in RGB and metallicF0Factor in A\r\n * This is multiplied against the scalar values defined in the material.\r\n * If useOnlyMetallicFromMetallicReflectanceTexture is true, don't use the RGB channels, only A\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public metallicReflectanceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Defines to store reflectanceColor in RGB\r\n * This is multiplied against the scalar values defined in the material.\r\n * If both reflectanceTexture and metallicReflectanceTexture textures are provided and useOnlyMetallicFromMetallicReflectanceTexture\r\n * is false, metallicReflectanceTexture takes priority and reflectanceTexture is not used\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectanceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.\r\n * Gray Scale represents roughness in metallic mode and glossiness in specular mode.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public microSurfaceTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores surface normal data used to displace a mesh in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public bumpTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the pre-calculated light information of a mesh in a texture.\r\n */\r\n @serializeAsTexture()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\", null)\r\n public lightmapTexture: Nullable<BaseTexture>;\r\n\r\n /**\r\n * Stores the refracted light information in a texture.\r\n */\r\n public get refractionTexture(): Nullable<BaseTexture> {\r\n return this.subSurface.refractionTexture;\r\n }\r\n public set refractionTexture(value: Nullable<BaseTexture>) {\r\n this.subSurface.refractionTexture = value;\r\n if (value) {\r\n this.subSurface.isRefractionEnabled = true;\r\n } else if (!this.subSurface.linkRefractionWithTransparency) {\r\n this.subSurface.isRefractionEnabled = false;\r\n }\r\n }\r\n\r\n /**\r\n * The color of a material in ambient lighting.\r\n */\r\n @serializeAsColor3(\"ambient\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public ambientColor = new Color3(0, 0, 0);\r\n\r\n /**\r\n * AKA Diffuse Color in other nomenclature.\r\n */\r\n @serializeAsColor3(\"albedo\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public albedoColor = new Color3(1, 1, 1);\r\n\r\n /**\r\n * OpenPBR Base Weight (multiplier to the diffuse and metal lobes).\r\n */\r\n @serialize(\"baseWeight\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public baseWeight = 1;\r\n\r\n /**\r\n * OpenPBR Base Diffuse Roughness (roughness of the diffuse lobe).\r\n */\r\n @serialize(\"baseDiffuseRoughness\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public baseDiffuseRoughness: Nullable<number>;\r\n\r\n /**\r\n * Defines the base diffuse roughness model of the material.\r\n */\r\n @serialize(\"baseDiffuseModel\")\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public baseDiffuseModel: number = PBRMaterial.DEFAULT_DIFFUSE_MODEL;\r\n\r\n /**\r\n * AKA Specular Color in other nomenclature.\r\n */\r\n @serializeAsColor3(\"reflectivity\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectivityColor = new Color3(1, 1, 1);\r\n\r\n /**\r\n * The color reflected from the material.\r\n */\r\n @serializeAsColor3(\"reflection\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public reflectionColor = new Color3(1.0, 1.0, 1.0);\r\n\r\n /**\r\n * The material model to use for specular lighting of dielectric materials.\r\n */\r\n @serialize(\"dielectricSpecularModel\")\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public dielectricSpecularModel: number = Constants.MATERIAL_DIELECTRIC_SPECULAR_MODEL_GLTF;\r\n\r\n /**\r\n * The material model to use for specular lighting.\r\n */\r\n @serialize(\"conductorSpecularModel\")\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public conductorSpecularModel: number = Constants.MATERIAL_CONDUCTOR_SPECULAR_MODEL_GLTF;\r\n\r\n /**\r\n * The color emitted from the material.\r\n */\r\n @serializeAsColor3(\"emissive\")\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public emissiveColor = new Color3(0, 0, 0);\r\n\r\n /**\r\n * AKA Glossiness in other nomenclature.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public microSurface = 1.0;\r\n\r\n /**\r\n * Index of refraction of the material base layer.\r\n * https://en.wikipedia.org/wiki/List_of_refractive_indices\r\n *\r\n * This does not only impact refraction but also the Base F0 of Dielectric Materials.\r\n *\r\n * From dielectric fresnel rules: F0 = square((iorT - iorI) / (iorT + iorI))\r\n */\r\n public get indexOfRefraction(): number {\r\n return this.subSurface.indexOfRefraction;\r\n }\r\n public set indexOfRefraction(value: number) {\r\n this.subSurface.indexOfRefraction = value;\r\n }\r\n\r\n /**\r\n * Controls if refraction needs to be inverted on Y. This could be useful for procedural texture.\r\n */\r\n public get invertRefractionY(): boolean {\r\n return this.subSurface.invertRefractionY;\r\n }\r\n public set invertRefractionY(value: boolean) {\r\n this.subSurface.invertRefractionY = value;\r\n }\r\n\r\n /**\r\n * This parameters will make the material used its opacity to control how much it is refracting against not.\r\n * Materials half opaque for instance using refraction could benefit from this control.\r\n */\r\n public get linkRefractionWithTransparency(): boolean {\r\n return this.subSurface.linkRefractionWithTransparency;\r\n }\r\n public set linkRefractionWithTransparency(value: boolean) {\r\n this.subSurface.linkRefractionWithTransparency = value;\r\n if (value) {\r\n this.subSurface.isRefractionEnabled = true;\r\n }\r\n }\r\n\r\n /**\r\n * If true, the light map contains occlusion information instead of lighting info.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useLightmapAsShadowmap = false;\r\n\r\n /**\r\n * Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public useAlphaFromAlbedoTexture = false;\r\n\r\n /**\r\n * Enforces alpha test in opaque or blend mode in order to improve the performances of some situations.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public forceAlphaTest = false;\r\n\r\n /**\r\n * Defines the alpha limits in alpha test mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesAndMiscDirty\")\r\n public alphaCutOff = 0.4;\r\n\r\n /**\r\n * Specifies that the material will keep the specular highlights over a transparent surface (only the most luminous ones).\r\n * A car glass is a good example of that. When sun reflects on it you can not see what is behind.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useSpecularOverAlpha = true;\r\n\r\n /**\r\n * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useMicroSurfaceFromReflectivityMapAlpha = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the roughness information in its alpha channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRoughnessFromMetallicTextureAlpha = true;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the roughness information in its green channel.\r\n * Needs useRoughnessFromMetallicTextureAlpha to be false.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRoughnessFromMetallicTextureGreen = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the metallness information in its blue channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useMetallnessFromMetallicTextureBlue = false;\r\n\r\n /**\r\n * Specifies if the metallic texture contains the ambient occlusion information in its red channel.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAmbientOcclusionFromMetallicTextureRed = false;\r\n\r\n /**\r\n * Specifies if the ambient texture contains the ambient occlusion information in its red channel only.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAmbientInGrayScale = false;\r\n\r\n /**\r\n * In case the reflectivity map does not contain the microsurface information in its alpha channel,\r\n * The material will try to infer what glossiness each pixel should be.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAutoMicroSurfaceFromReflectivityMap = false;\r\n\r\n /**\r\n * BJS is using an hardcoded light falloff based on a manually sets up range.\r\n * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.\r\n * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.\r\n */\r\n @serialize()\r\n public get usePhysicalLightFalloff(): boolean {\r\n return this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL;\r\n }\r\n\r\n /**\r\n * BJS is using an hardcoded light falloff based on a manually sets up range.\r\n * In PBR, one way to represents the falloff is to use the inverse squared root algorithm.\r\n * This parameter can help you switch back to the BJS mode in order to create scenes using both materials.\r\n */\r\n public set usePhysicalLightFalloff(value: boolean) {\r\n if (value !== this.usePhysicalLightFalloff) {\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n\r\n if (value) {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_PHYSICAL;\r\n } else {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_STANDARD;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * In order to support the falloff compatibility with gltf, a special mode has been added\r\n * to reproduce the gltf light falloff.\r\n */\r\n @serialize()\r\n public get useGLTFLightFalloff(): boolean {\r\n return this._lightFalloff === PBRBaseMaterial.LIGHTFALLOFF_GLTF;\r\n }\r\n\r\n /**\r\n * In order to support the falloff compatibility with gltf, a special mode has been added\r\n * to reproduce the gltf light falloff.\r\n */\r\n public set useGLTFLightFalloff(value: boolean) {\r\n if (value !== this.useGLTFLightFalloff) {\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n\r\n if (value) {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_GLTF;\r\n } else {\r\n this._lightFalloff = PBRBaseMaterial.LIGHTFALLOFF_STANDARD;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most luminous ones).\r\n * A car glass is a good example of that. When the street lights reflects on it you can not see what is behind.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRadianceOverAlpha = true;\r\n\r\n /**\r\n * Allows using an object space normal map (instead of tangent space).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useObjectSpaceNormalMap = false;\r\n\r\n /**\r\n * Allows using the bump map in parallax mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useParallax = false;\r\n\r\n /**\r\n * Allows using the bump map in parallax occlusion mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useParallaxOcclusion = false;\r\n\r\n /**\r\n * Controls the scale bias of the parallax mode.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public parallaxScaleBias = 0.05;\r\n\r\n /**\r\n * If sets to true, disables all the lights affecting the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public disableLighting = false;\r\n\r\n /**\r\n * Force the shader to compute irradiance in the fragment shader in order to take bump in account.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public forceIrradianceInFragment = false;\r\n\r\n /**\r\n * Number of Simultaneous lights allowed on the material.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsLightsDirty\")\r\n public maxSimultaneousLights = 4;\r\n\r\n /**\r\n * If sets to true, x component of normal map value will invert (x = 1.0 - x).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public invertNormalMapX = false;\r\n\r\n /**\r\n * If sets to true, y component of normal map value will invert (y = 1.0 - y).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public invertNormalMapY = false;\r\n\r\n /**\r\n * If sets to true and backfaceCulling is false, normals will be flipped on the backside.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public twoSidedLighting = false;\r\n\r\n /**\r\n * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.\r\n * And/Or occlude the blended part. (alpha is converted to gamma to compute the fresnel)\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useAlphaFresnel = false;\r\n\r\n /**\r\n * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.\r\n * And/Or occlude the blended part. (alpha stays linear to compute the fresnel)\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useLinearAlphaFresnel = false;\r\n\r\n /**\r\n * Let user defines the brdf lookup texture used for IBL.\r\n * A default 8bit version is embedded but you could point at :\r\n * * Default texture: https://assets.babylonjs.com/environments/correlatedMSBRDF_RGBD.png\r\n * * Default 16bit pixel depth texture: https://assets.babylonjs.com/environments/correlatedMSBRDF.dds\r\n * * LEGACY Default None correlated https://assets.babylonjs.com/environments/uncorrelatedBRDF_RGBD.png\r\n * * LEGACY Default None correlated 16bit pixel depth https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds\r\n */\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public environmentBRDFTexture: Nullable<BaseTexture> = null;\r\n\r\n /**\r\n * Force normal to face away from face.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public forceNormalForward = false;\r\n\r\n /**\r\n * Enables specular anti aliasing in the PBR shader.\r\n * It will both interacts on the Geometry for analytical and IBL lighting.\r\n * It also prefilter the roughness map based on the bump values.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public enableSpecularAntiAliasing = false;\r\n\r\n /**\r\n * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal\r\n * makes the reflect vector face the model (under horizon).\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useHorizonOcclusion = true;\r\n\r\n /**\r\n * This parameters will enable/disable radiance occlusion by preventing the radiance to lit\r\n * too much the area relying on ambient texture to define their ambient occlusion.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsTexturesDirty\")\r\n public useRadianceOcclusion = true;\r\n\r\n /**\r\n * If set to true, no lighting calculations will be applied.\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public unlit = false;\r\n\r\n /**\r\n * If sets to true, the decal map will be applied after the detail map. Else, it is applied before (default: false)\r\n */\r\n @serialize()\r\n @expandToProperty(\"_markAllSubMeshesAsMiscDirty\")\r\n public applyDecalMapAfterDetailMap = false;\r\n\r\n /**\r\n * Gets the image processing configuration used either in this material.\r\n */\r\n public get imageProcessingConfiguration(): ImageProcessingConfiguration {\r\n return this._imageProcessingConfiguration;\r\n }\r\n\r\n /**\r\n * Sets the Default image processing configuration used either in the this material.\r\n *\r\n * If sets to null, the scene one is in use.\r\n */\r\n public set imageProcessingConfiguration(value: ImageProcessingConfiguration) {\r\n this._attachImageProcessingConfiguration(value);\r\n\r\n // Ensure the effect will be rebuilt.\r\n this._markAllSubMeshesAsTexturesDirty();\r\n }\r\n\r\n /**\r\n * Gets whether the color curves effect is enabled.\r\n */\r\n public get cameraColorCurvesEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorCurvesEnabled;\r\n }\r\n /**\r\n * Sets whether the color curves effect is enabled.\r\n */\r\n public set cameraColorCurvesEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorCurvesEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public get cameraColorGradingEnabled(): boolean {\r\n return this.imageProcessingConfiguration.colorGradingEnabled;\r\n }\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public set cameraColorGradingEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorGradingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets whether tonemapping is enabled or not.\r\n */\r\n public get cameraToneMappingEnabled(): boolean {\r\n return this._imageProcessingConfiguration.toneMappingEnabled;\r\n }\r\n /**\r\n * Sets whether tonemapping is enabled or not\r\n */\r\n public set cameraToneMappingEnabled(value: boolean) {\r\n this._imageProcessingConfiguration.toneMappingEnabled = value;\r\n }\r\n\r\n /**\r\n * The camera exposure used on this material.\r\n * This property is here and not in the camera to allow controlling exposure without full screen post process.\r\n * This corresponds to a photographic exposure.\r\n */\r\n public get cameraExposure(): number {\r\n return this._imageProcessingConfiguration.exposure;\r\n }\r\n /**\r\n * The camera exposure used on this material.\r\n * This property is here and not in the camera to allow controlling exposure without full screen post process.\r\n * This corresponds to a photographic exposure.\r\n */\r\n public set cameraExposure(value: number) {\r\n this._imageProcessingConfiguration.exposure = value;\r\n }\r\n\r\n /**\r\n * Gets The camera contrast used on this material.\r\n */\r\n public get cameraContrast(): number {\r\n return this._imageProcessingConfiguration.contrast;\r\n }\r\n\r\n /**\r\n * Sets The camera contrast used on this material.\r\n */\r\n public set cameraContrast(value: number) {\r\n this._imageProcessingConfiguration.contrast = value;\r\n }\r\n\r\n /**\r\n * Gets the Color Grading 2D Lookup Texture.\r\n */\r\n public get cameraColorGradingTexture(): Nullable<BaseTexture> {\r\n return this._imageProcessingConfiguration.colorGradingTexture;\r\n }\r\n /**\r\n * Sets the Color Grading 2D Lookup Texture.\r\n */\r\n public set cameraColorGradingTexture(value: Nullable<BaseTexture>) {\r\n this._imageProcessingConfiguration.colorGradingTexture = value;\r\n }\r\n\r\n /**\r\n * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).\r\n * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.\r\n * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;\r\n * corresponding to low luminance, medium luminance, and high luminance areas respectively.\r\n */\r\n public get cameraColorCurves(): Nullable<ColorCurves> {\r\n return this._imageProcessingConfiguration.colorCurves;\r\n }\r\n /**\r\n * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).\r\n * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.\r\n * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;\r\n * corresponding to low luminance, medium luminance, and high luminance areas respectively.\r\n */\r\n public set cameraColorCurves(value: Nullable<ColorCurves>) {\r\n this._imageProcessingConfiguration.colorCurves = value;\r\n }\r\n\r\n /**\r\n * Instantiates a new PBRMaterial instance.\r\n *\r\n * @param name The material name\r\n * @param scene The scene the material will be use in.\r\n * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false\r\n */\r\n constructor(name: string, scene?: Scene, forceGLSL = false) {\r\n super(name, scene, forceGLSL);\r\n\r\n this._environmentBRDFTexture = GetEnvironmentBRDFTexture(this.getScene());\r\n }\r\n\r\n /**\r\n * @returns the name of this material class.\r\n */\r\n public override getClassName(): string {\r\n return \"PBRMaterial\";\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current material.\r\n * @param name - name to use for the new material.\r\n * @param cloneTexturesOnlyOnce - if a texture is used in more than one channel (e.g diffuse and opacity), only clone it once and reuse it on the other channels. Default false.\r\n * @param rootUrl defines the root URL to use to load textures\r\n * @returns cloned material instance\r\n */\r\n public override clone(name: string, cloneTexturesOnlyOnce: boolean = true, rootUrl = \"\"): PBRMaterial {\r\n const clone = SerializationHelper.Clone(() => new PBRMaterial(name, this.getScene()), this, { cloneTexturesOnlyOnce });\r\n\r\n clone.id = name;\r\n clone.name = name;\r\n\r\n this.stencil.copyTo(clone.stencil);\r\n\r\n this._clonePlugins(clone, rootUrl);\r\n\r\n return clone;\r\n }\r\n\r\n /**\r\n * Serializes this PBR Material.\r\n * @returns - An object with the serialized material.\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.customType = \"BABYLON.PBRMaterial\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Parses a PBR Material from a serialized object.\r\n * @param source - Serialized object.\r\n * @param scene - BJS scene instance.\r\n * @param rootUrl - url for the scene object\r\n * @returns - PBRMaterial\r\n */\r\n public static override Parse(source: any, scene: Scene, rootUrl: string): PBRMaterial {\r\n const material = SerializationHelper.Parse(() => new PBRMaterial(source.name, scene), source, scene, rootUrl);\r\n\r\n if (source.stencil) {\r\n material.stencil.parse(source.stencil, scene, rootUrl);\r\n }\r\n\r\n Material._ParsePlugins(source, material, scene, rootUrl);\r\n\r\n // The code block below ensures backward compatibility with serialized materials before plugins are automatically serialized.\r\n if (source.clearCoat) {\r\n material.clearCoat.parse(source.clearCoat, scene, rootUrl);\r\n }\r\n if (source.anisotropy) {\r\n material.anisotropy.parse(source.anisotropy, scene, rootUrl);\r\n }\r\n if (source.brdf) {\r\n material.brdf.parse(source.brdf, scene, rootUrl);\r\n }\r\n if (source.sheen) {\r\n material.sheen.parse(source.sheen, scene, rootUrl);\r\n }\r\n if (source.subSurface) {\r\n material.subSurface.parse(source.subSurface, scene, rootUrl);\r\n }\r\n if (source.iridescence) {\r\n material.iridescence.parse(source.iridescence, scene, rootUrl);\r\n }\r\n\r\n return material;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.PBRMaterial\", PBRMaterial);\r\n"]}
|
|
@@ -164,6 +164,7 @@ export class HDRIrradianceFiltering {
|
|
|
164
164
|
await this._effectWrapper.effect.whenCompiledAsync();
|
|
165
165
|
const irradianceTexture = this._prefilterInternal(texture);
|
|
166
166
|
if (this.useCdf) {
|
|
167
|
+
// eslint-disable-next-line github/no-then
|
|
167
168
|
await this._cdfGenerator.findDominantDirection().then((dir) => {
|
|
168
169
|
irradianceTexture._dominantDirection = dir;
|
|
169
170
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hdrIrradianceFiltering.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Filtering/hdrIrradianceFiltering.ts"],"names":[],"mappings":"AA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,iBAAiB,EAAE,CAAC;QAErD,MAAM,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAE3D,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,MAAM,IAAI,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC1D,iBAAiB,CAAC,kBAAkB,GAAG,GAAG,CAAC;YAC/C,CAAC,CAAC,CAAC;QACP,CAAC;QACD,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,CAAC;QAE9B,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ","sourcesContent":["import { Vector3 } from \"../../../Maths/math\";\r\nimport { ILog2 } from \"../../../Maths/math.scalar.functions\";\r\nimport { BaseTexture } from \"../baseTexture\";\r\nimport type { AbstractEngine } from \"../../../Engines/abstractEngine\";\r\nimport type { Effect } from \"../../../Materials/effect\";\r\nimport { Constants } from \"../../../Engines/constants\";\r\nimport { EffectWrapper, EffectRenderer } from \"../../../Materials/effectRenderer\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport type { RenderTargetWrapper } from \"../../../Engines/renderTargetWrapper\";\r\n\r\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\r\nimport { IblCdfGenerator } from \"../../../Rendering/iblCdfGenerator\";\r\n\r\n/**\r\n * Options for texture filtering\r\n */\r\ninterface IHDRIrradianceFilteringOptions {\r\n /**\r\n * Scales pixel intensity for the input HDR map.\r\n */\r\n hdrScale?: number;\r\n\r\n /**\r\n * Quality of the filter. Should be `Constants.TEXTURE_FILTERING_QUALITY_OFFLINE` for prefiltering\r\n */\r\n quality?: number;\r\n\r\n /**\r\n * Use the Cumulative Distribution Function (CDF) for filtering\r\n */\r\n useCdf?: boolean;\r\n}\r\n\r\n/**\r\n * Filters HDR maps to get correct renderings of PBR reflections\r\n */\r\nexport class HDRIrradianceFiltering {\r\n private _engine: AbstractEngine;\r\n private _effectRenderer: EffectRenderer;\r\n private _effectWrapper: EffectWrapper;\r\n private _cdfGenerator: IblCdfGenerator;\r\n\r\n /**\r\n * Quality switch for prefiltering. Should be set to `Constants.TEXTURE_FILTERING_QUALITY_OFFLINE` unless\r\n * you care about baking speed.\r\n */\r\n public quality: number = Constants.TEXTURE_FILTERING_QUALITY_OFFLINE;\r\n\r\n /**\r\n * Scales pixel intensity for the input HDR map.\r\n */\r\n public hdrScale: number = 1;\r\n\r\n /**\r\n * Use the Cumulative Distribution Function (CDF) for filtering\r\n */\r\n public useCdf: boolean = false;\r\n\r\n /**\r\n * Instantiates HDR filter for irradiance map\r\n *\r\n * @param engine Thin engine\r\n * @param options Options\r\n */\r\n constructor(engine: AbstractEngine, options: IHDRIrradianceFilteringOptions = {}) {\r\n // pass\r\n this._engine = engine;\r\n this.hdrScale = options.hdrScale || this.hdrScale;\r\n this.quality = options.quality || this.quality;\r\n this.useCdf = options.useCdf || this.useCdf;\r\n }\r\n\r\n private _createRenderTarget(size: number): RenderTargetWrapper {\r\n let textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n if (this._engine.getCaps().textureHalfFloatRender) {\r\n textureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else if (this._engine.getCaps().textureFloatRender) {\r\n textureType = Constants.TEXTURETYPE_FLOAT;\r\n }\r\n\r\n const rtWrapper = this._engine.createRenderTargetCubeTexture(size, {\r\n format: Constants.TEXTUREFORMAT_RGBA,\r\n type: textureType,\r\n createMipMaps: false,\r\n generateMipMaps: false,\r\n generateDepthBuffer: false,\r\n generateStencilBuffer: false,\r\n samplingMode: Constants.TEXTURE_BILINEAR_SAMPLINGMODE,\r\n label: \"HDR_Irradiance_Filtering_Target\",\r\n });\r\n this._engine.updateTextureWrappingMode(rtWrapper.texture!, Constants.TEXTURE_CLAMP_ADDRESSMODE, Constants.TEXTURE_CLAMP_ADDRESSMODE, Constants.TEXTURE_CLAMP_ADDRESSMODE);\r\n\r\n return rtWrapper;\r\n }\r\n\r\n private _prefilterInternal(texture: BaseTexture): BaseTexture {\r\n const width = texture.getSize().width;\r\n const mipmapsCount = ILog2(width);\r\n\r\n const effect = this._effectWrapper.effect;\r\n // Choose a power of 2 size for the irradiance map.\r\n // It can be much smaller than the original texture.\r\n const irradianceSize = Math.max(32, 1 << ILog2(width >> 3));\r\n const outputTexture = this._createRenderTarget(irradianceSize);\r\n this._effectRenderer.saveStates();\r\n this._effectRenderer.setViewport();\r\n\r\n this._effectRenderer.applyEffectWrapper(this._effectWrapper);\r\n\r\n const directions = [\r\n [new Vector3(0, 0, -1), new Vector3(0, -1, 0), new Vector3(1, 0, 0)], // PositiveX\r\n [new Vector3(0, 0, 1), new Vector3(0, -1, 0), new Vector3(-1, 0, 0)], // NegativeX\r\n [new Vector3(1, 0, 0), new Vector3(0, 0, 1), new Vector3(0, 1, 0)], // PositiveY\r\n [new Vector3(1, 0, 0), new Vector3(0, 0, -1), new Vector3(0, -1, 0)], // NegativeY\r\n [new Vector3(1, 0, 0), new Vector3(0, -1, 0), new Vector3(0, 0, 1)], // PositiveZ\r\n [new Vector3(-1, 0, 0), new Vector3(0, -1, 0), new Vector3(0, 0, -1)], // NegativeZ\r\n ];\r\n\r\n effect.setFloat(\"hdrScale\", this.hdrScale);\r\n effect.setFloat2(\"vFilteringInfo\", texture.getSize().width, mipmapsCount);\r\n effect.setTexture(\"inputTexture\", texture);\r\n if (this._cdfGenerator) {\r\n effect.setTexture(\"icdfTexture\", this._cdfGenerator.getIcdfTexture());\r\n }\r\n\r\n for (let face = 0; face < 6; face++) {\r\n effect.setVector3(\"up\", directions[face][0]);\r\n effect.setVector3(\"right\", directions[face][1]);\r\n effect.setVector3(\"front\", directions[face][2]);\r\n\r\n this._engine.bindFramebuffer(outputTexture, face, undefined, undefined, true);\r\n this._effectRenderer.applyEffectWrapper(this._effectWrapper);\r\n\r\n this._effectRenderer.draw();\r\n }\r\n\r\n // Cleanup\r\n this._effectRenderer.restoreStates();\r\n this._engine.restoreDefaultFramebuffer();\r\n effect.setTexture(\"inputTexture\", null);\r\n effect.setTexture(\"icdfTexture\", null);\r\n const irradianceTexture = new BaseTexture(texture.getScene(), outputTexture.texture);\r\n irradianceTexture.name = texture.name + \"_irradiance\";\r\n irradianceTexture.displayName = texture.name + \"_irradiance\";\r\n irradianceTexture.gammaSpace = false;\r\n return irradianceTexture;\r\n }\r\n\r\n private _createEffect(texture: BaseTexture, onCompiled?: Nullable<(effect: Effect) => void>): EffectWrapper {\r\n const defines = [];\r\n if (texture.gammaSpace) {\r\n defines.push(\"#define GAMMA_INPUT\");\r\n }\r\n\r\n defines.push(\"#define NUM_SAMPLES \" + this.quality + \"u\"); // unsigned int\r\n\r\n const isWebGPU = this._engine.isWebGPU;\r\n const samplers = [\"inputTexture\"];\r\n if (this._cdfGenerator) {\r\n samplers.push(\"icdfTexture\");\r\n defines.push(\"#define IBL_CDF_FILTERING\");\r\n }\r\n const effectWrapper = new EffectWrapper({\r\n engine: this._engine,\r\n name: \"HDRIrradianceFiltering\",\r\n vertexShader: \"hdrIrradianceFiltering\",\r\n fragmentShader: \"hdrIrradianceFiltering\",\r\n samplerNames: samplers,\r\n uniformNames: [\"vSampleDirections\", \"vWeights\", \"up\", \"right\", \"front\", \"vFilteringInfo\", \"hdrScale\"],\r\n useShaderStore: true,\r\n defines,\r\n onCompiled: onCompiled,\r\n shaderLanguage: isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\r\n extraInitializationsAsync: async () => {\r\n if (isWebGPU) {\r\n await Promise.all([import(\"../../../ShadersWGSL/hdrIrradianceFiltering.vertex\"), import(\"../../../ShadersWGSL/hdrIrradianceFiltering.fragment\")]);\r\n } else {\r\n await Promise.all([import(\"../../../Shaders/hdrIrradianceFiltering.vertex\"), import(\"../../../Shaders/hdrIrradianceFiltering.fragment\")]);\r\n }\r\n },\r\n });\r\n\r\n return effectWrapper;\r\n }\r\n\r\n /**\r\n * Get a value indicating if the filter is ready to be used\r\n * @param texture Texture to filter\r\n * @returns true if the filter is ready\r\n */\r\n public isReady(texture: BaseTexture) {\r\n return texture.isReady() && this._effectWrapper.effect.isReady();\r\n }\r\n\r\n /**\r\n * Prefilters a cube texture to contain IBL irradiance.\r\n * Prefiltering will be invoked at the end of next rendering pass.\r\n * This has to be done once the map is loaded, and has not been prefiltered by a third party software.\r\n * See http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf for more information\r\n * @param texture Texture to filter\r\n * @returns Promise called when prefiltering is done\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public async prefilter(texture: BaseTexture): Promise<BaseTexture> {\r\n if (!this._engine._features.allowTexturePrefiltering) {\r\n throw new Error(\"HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.\");\r\n }\r\n\r\n if (this.useCdf) {\r\n this._cdfGenerator = new IblCdfGenerator(this._engine);\r\n this._cdfGenerator.iblSource = texture;\r\n\r\n await this._cdfGenerator.renderWhenReady();\r\n }\r\n\r\n this._effectRenderer = new EffectRenderer(this._engine);\r\n this._effectWrapper = this._createEffect(texture);\r\n await this._effectWrapper.effect.whenCompiledAsync();\r\n\r\n const irradianceTexture = this._prefilterInternal(texture);\r\n\r\n if (this.useCdf) {\r\n await this._cdfGenerator.findDominantDirection().then((dir) => {\r\n irradianceTexture._dominantDirection = dir;\r\n });\r\n }\r\n this._effectRenderer.dispose();\r\n this._effectWrapper.dispose();\r\n this._cdfGenerator?.dispose();\r\n\r\n return irradianceTexture;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"hdrIrradianceFiltering.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Filtering/hdrIrradianceFiltering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,KAAK,EA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AAO,CAAC,CAAC;QAE3D,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACd,0CAA0C;YAC1C,MAAM,IAAI,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC1D,iBAAiB,CAAC,kBAAkB,GAAG,GAAG,CAAC;YAC/C,CAAC,CAAC,CAAC;QACP,CAAC;QACD,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC;QAC/B,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC9B,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE,CAAC;QAE9B,OAAO,iBAAiB,CAAC;IAC7B,CAAC;CACJ","sourcesContent":["import { Vector3 } from \"../../../Maths/math\";\r\nimport { ILog2 } from \"../../../Maths/math.scalar.functions\";\r\nimport { BaseTexture } from \"../baseTexture\";\r\nimport type { AbstractEngine } from \"../../../Engines/abstractEngine\";\r\nimport type { Effect } from \"../../../Materials/effect\";\r\nimport { Constants } from \"../../../Engines/constants\";\r\nimport { EffectWrapper, EffectRenderer } from \"../../../Materials/effectRenderer\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport type { RenderTargetWrapper } from \"../../../Engines/renderTargetWrapper\";\r\n\r\nimport { ShaderLanguage } from \"core/Materials/shaderLanguage\";\r\nimport { IblCdfGenerator } from \"../../../Rendering/iblCdfGenerator\";\r\n\r\n/**\r\n * Options for texture filtering\r\n */\r\ninterface IHDRIrradianceFilteringOptions {\r\n /**\r\n * Scales pixel intensity for the input HDR map.\r\n */\r\n hdrScale?: number;\r\n\r\n /**\r\n * Quality of the filter. Should be `Constants.TEXTURE_FILTERING_QUALITY_OFFLINE` for prefiltering\r\n */\r\n quality?: number;\r\n\r\n /**\r\n * Use the Cumulative Distribution Function (CDF) for filtering\r\n */\r\n useCdf?: boolean;\r\n}\r\n\r\n/**\r\n * Filters HDR maps to get correct renderings of PBR reflections\r\n */\r\nexport class HDRIrradianceFiltering {\r\n private _engine: AbstractEngine;\r\n private _effectRenderer: EffectRenderer;\r\n private _effectWrapper: EffectWrapper;\r\n private _cdfGenerator: IblCdfGenerator;\r\n\r\n /**\r\n * Quality switch for prefiltering. Should be set to `Constants.TEXTURE_FILTERING_QUALITY_OFFLINE` unless\r\n * you care about baking speed.\r\n */\r\n public quality: number = Constants.TEXTURE_FILTERING_QUALITY_OFFLINE;\r\n\r\n /**\r\n * Scales pixel intensity for the input HDR map.\r\n */\r\n public hdrScale: number = 1;\r\n\r\n /**\r\n * Use the Cumulative Distribution Function (CDF) for filtering\r\n */\r\n public useCdf: boolean = false;\r\n\r\n /**\r\n * Instantiates HDR filter for irradiance map\r\n *\r\n * @param engine Thin engine\r\n * @param options Options\r\n */\r\n constructor(engine: AbstractEngine, options: IHDRIrradianceFilteringOptions = {}) {\r\n // pass\r\n this._engine = engine;\r\n this.hdrScale = options.hdrScale || this.hdrScale;\r\n this.quality = options.quality || this.quality;\r\n this.useCdf = options.useCdf || this.useCdf;\r\n }\r\n\r\n private _createRenderTarget(size: number): RenderTargetWrapper {\r\n let textureType = Constants.TEXTURETYPE_UNSIGNED_BYTE;\r\n if (this._engine.getCaps().textureHalfFloatRender) {\r\n textureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else if (this._engine.getCaps().textureFloatRender) {\r\n textureType = Constants.TEXTURETYPE_FLOAT;\r\n }\r\n\r\n const rtWrapper = this._engine.createRenderTargetCubeTexture(size, {\r\n format: Constants.TEXTUREFORMAT_RGBA,\r\n type: textureType,\r\n createMipMaps: false,\r\n generateMipMaps: false,\r\n generateDepthBuffer: false,\r\n generateStencilBuffer: false,\r\n samplingMode: Constants.TEXTURE_BILINEAR_SAMPLINGMODE,\r\n label: \"HDR_Irradiance_Filtering_Target\",\r\n });\r\n this._engine.updateTextureWrappingMode(rtWrapper.texture!, Constants.TEXTURE_CLAMP_ADDRESSMODE, Constants.TEXTURE_CLAMP_ADDRESSMODE, Constants.TEXTURE_CLAMP_ADDRESSMODE);\r\n\r\n return rtWrapper;\r\n }\r\n\r\n private _prefilterInternal(texture: BaseTexture): BaseTexture {\r\n const width = texture.getSize().width;\r\n const mipmapsCount = ILog2(width);\r\n\r\n const effect = this._effectWrapper.effect;\r\n // Choose a power of 2 size for the irradiance map.\r\n // It can be much smaller than the original texture.\r\n const irradianceSize = Math.max(32, 1 << ILog2(width >> 3));\r\n const outputTexture = this._createRenderTarget(irradianceSize);\r\n this._effectRenderer.saveStates();\r\n this._effectRenderer.setViewport();\r\n\r\n this._effectRenderer.applyEffectWrapper(this._effectWrapper);\r\n\r\n const directions = [\r\n [new Vector3(0, 0, -1), new Vector3(0, -1, 0), new Vector3(1, 0, 0)], // PositiveX\r\n [new Vector3(0, 0, 1), new Vector3(0, -1, 0), new Vector3(-1, 0, 0)], // NegativeX\r\n [new Vector3(1, 0, 0), new Vector3(0, 0, 1), new Vector3(0, 1, 0)], // PositiveY\r\n [new Vector3(1, 0, 0), new Vector3(0, 0, -1), new Vector3(0, -1, 0)], // NegativeY\r\n [new Vector3(1, 0, 0), new Vector3(0, -1, 0), new Vector3(0, 0, 1)], // PositiveZ\r\n [new Vector3(-1, 0, 0), new Vector3(0, -1, 0), new Vector3(0, 0, -1)], // NegativeZ\r\n ];\r\n\r\n effect.setFloat(\"hdrScale\", this.hdrScale);\r\n effect.setFloat2(\"vFilteringInfo\", texture.getSize().width, mipmapsCount);\r\n effect.setTexture(\"inputTexture\", texture);\r\n if (this._cdfGenerator) {\r\n effect.setTexture(\"icdfTexture\", this._cdfGenerator.getIcdfTexture());\r\n }\r\n\r\n for (let face = 0; face < 6; face++) {\r\n effect.setVector3(\"up\", directions[face][0]);\r\n effect.setVector3(\"right\", directions[face][1]);\r\n effect.setVector3(\"front\", directions[face][2]);\r\n\r\n this._engine.bindFramebuffer(outputTexture, face, undefined, undefined, true);\r\n this._effectRenderer.applyEffectWrapper(this._effectWrapper);\r\n\r\n this._effectRenderer.draw();\r\n }\r\n\r\n // Cleanup\r\n this._effectRenderer.restoreStates();\r\n this._engine.restoreDefaultFramebuffer();\r\n effect.setTexture(\"inputTexture\", null);\r\n effect.setTexture(\"icdfTexture\", null);\r\n const irradianceTexture = new BaseTexture(texture.getScene(), outputTexture.texture);\r\n irradianceTexture.name = texture.name + \"_irradiance\";\r\n irradianceTexture.displayName = texture.name + \"_irradiance\";\r\n irradianceTexture.gammaSpace = false;\r\n return irradianceTexture;\r\n }\r\n\r\n private _createEffect(texture: BaseTexture, onCompiled?: Nullable<(effect: Effect) => void>): EffectWrapper {\r\n const defines = [];\r\n if (texture.gammaSpace) {\r\n defines.push(\"#define GAMMA_INPUT\");\r\n }\r\n\r\n defines.push(\"#define NUM_SAMPLES \" + this.quality + \"u\"); // unsigned int\r\n\r\n const isWebGPU = this._engine.isWebGPU;\r\n const samplers = [\"inputTexture\"];\r\n if (this._cdfGenerator) {\r\n samplers.push(\"icdfTexture\");\r\n defines.push(\"#define IBL_CDF_FILTERING\");\r\n }\r\n const effectWrapper = new EffectWrapper({\r\n engine: this._engine,\r\n name: \"HDRIrradianceFiltering\",\r\n vertexShader: \"hdrIrradianceFiltering\",\r\n fragmentShader: \"hdrIrradianceFiltering\",\r\n samplerNames: samplers,\r\n uniformNames: [\"vSampleDirections\", \"vWeights\", \"up\", \"right\", \"front\", \"vFilteringInfo\", \"hdrScale\"],\r\n useShaderStore: true,\r\n defines,\r\n onCompiled: onCompiled,\r\n shaderLanguage: isWebGPU ? ShaderLanguage.WGSL : ShaderLanguage.GLSL,\r\n extraInitializationsAsync: async () => {\r\n if (isWebGPU) {\r\n await Promise.all([import(\"../../../ShadersWGSL/hdrIrradianceFiltering.vertex\"), import(\"../../../ShadersWGSL/hdrIrradianceFiltering.fragment\")]);\r\n } else {\r\n await Promise.all([import(\"../../../Shaders/hdrIrradianceFiltering.vertex\"), import(\"../../../Shaders/hdrIrradianceFiltering.fragment\")]);\r\n }\r\n },\r\n });\r\n\r\n return effectWrapper;\r\n }\r\n\r\n /**\r\n * Get a value indicating if the filter is ready to be used\r\n * @param texture Texture to filter\r\n * @returns true if the filter is ready\r\n */\r\n public isReady(texture: BaseTexture) {\r\n return texture.isReady() && this._effectWrapper.effect.isReady();\r\n }\r\n\r\n /**\r\n * Prefilters a cube texture to contain IBL irradiance.\r\n * Prefiltering will be invoked at the end of next rendering pass.\r\n * This has to be done once the map is loaded, and has not been prefiltered by a third party software.\r\n * See http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf for more information\r\n * @param texture Texture to filter\r\n * @returns Promise called when prefiltering is done\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public async prefilter(texture: BaseTexture): Promise<BaseTexture> {\r\n if (!this._engine._features.allowTexturePrefiltering) {\r\n throw new Error(\"HDR prefiltering is not available in WebGL 1., you can use real time filtering instead.\");\r\n }\r\n\r\n if (this.useCdf) {\r\n this._cdfGenerator = new IblCdfGenerator(this._engine);\r\n this._cdfGenerator.iblSource = texture;\r\n\r\n await this._cdfGenerator.renderWhenReady();\r\n }\r\n\r\n this._effectRenderer = new EffectRenderer(this._engine);\r\n this._effectWrapper = this._createEffect(texture);\r\n await this._effectWrapper.effect.whenCompiledAsync();\r\n\r\n const irradianceTexture = this._prefilterInternal(texture);\r\n\r\n if (this.useCdf) {\r\n // eslint-disable-next-line github/no-then\r\n await this._cdfGenerator.findDominantDirection().then((dir) => {\r\n irradianceTexture._dominantDirection = dir;\r\n });\r\n }\r\n this._effectRenderer.dispose();\r\n this._effectWrapper.dispose();\r\n this._cdfGenerator?.dispose();\r\n\r\n return irradianceTexture;\r\n }\r\n}\r\n"]}
|
|
@@ -36,6 +36,7 @@ export class _BasisTextureLoader {
|
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
38
|
TranscodeAsync(data, transcodeConfig)
|
|
39
|
+
// eslint-disable-next-line github/no-then
|
|
39
40
|
.then((result) => {
|
|
40
41
|
const hasMipmap = result.fileInfo.images[0].levels.length > 1 && texture.generateMipMaps;
|
|
41
42
|
LoadTextureFromTranscodeResult(texture, result);
|
|
@@ -47,6 +48,7 @@ export class _BasisTextureLoader {
|
|
|
47
48
|
onLoad();
|
|
48
49
|
}
|
|
49
50
|
})
|
|
51
|
+
// eslint-disable-next-line github/no-then
|
|
50
52
|
.catch((err) => {
|
|
51
53
|
const errorMessage = "Failed to transcode Basis file, transcoding may not be supported on this device";
|
|
52
54
|
Tools.Warn(errorMessage);
|
|
@@ -75,6 +77,7 @@ export class _BasisTextureLoader {
|
|
|
75
77
|
},
|
|
76
78
|
};
|
|
77
79
|
TranscodeAsync(data, transcodeConfig)
|
|
80
|
+
// eslint-disable-next-line github/no-then
|
|
78
81
|
.then((result) => {
|
|
79
82
|
const rootImage = result.fileInfo.images[0].levels[0];
|
|
80
83
|
const hasMipmap = result.fileInfo.images[0].levels.length > 1 && texture.generateMipMaps;
|
|
@@ -82,6 +85,7 @@ export class _BasisTextureLoader {
|
|
|
82
85
|
LoadTextureFromTranscodeResult(texture, result);
|
|
83
86
|
});
|
|
84
87
|
})
|
|
88
|
+
// eslint-disable-next-line github/no-then
|
|
85
89
|
.catch((err) => {
|
|
86
90
|
Tools.Warn("Failed to transcode Basis file, transcoding may not be supported on this device");
|
|
87
91
|
Tools.Warn(`Failed to transcode Basis file: ${err}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basisTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/basisTextureLoader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C;;;GAGG;AACH,gEAAgE;AAChE,MAAM,OAAO,mBAAmB;IAAhC;QACI;;WAEG;QACa,oBAAe,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"basisTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/basisTextureL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IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;gBAC9B,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;gBAC9B,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;aAChC;SACJ,CAAC;QACF,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC;YACjC,0CAA0C;aACzC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACb,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACtD,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,eAAe,CAAC;YACzF,QAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE;gBAC9E,8BAA8B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACpD,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;YACF,0CAA0C;aACzC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACX,KAAK,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;YAC9F,KAAK,CAAC,IAAI,CAAC,mCAAmC,GAAG,EAAE,CAAC,CAAC;YACrD,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,IAAI,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACX,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../../types\";\r\nimport type { InternalTexture } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { IInternalTextureLoader } from \"./internalTextureLoader\";\r\nimport { LoadTextureFromTranscodeResult, TranscodeAsync } from \"../../../Misc/basis\";\r\nimport { Tools } from \"../../../Misc/tools\";\r\n\r\n/**\r\n * Loader for .basis file format\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _BasisTextureLoader implements IInternalTextureLoader {\r\n /**\r\n * Defines whether the loader supports cascade loading the different faces.\r\n */\r\n public readonly supportCascades = false;\r\n\r\n /**\r\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\r\n * @param data contains the texture data\r\n * @param texture defines the BabylonJS internal texture\r\n * @param createPolynomials will be true if polynomials have been requested\r\n * @param onLoad defines the callback to trigger once the texture is ready\r\n * @param onError defines the callback to trigger in case of error\r\n */\r\n public loadCubeData(\r\n data: ArrayBufferView | ArrayBufferView[],\r\n texture: InternalTexture,\r\n createPolynomials: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>\r\n ): void {\r\n if (Array.isArray(data)) {\r\n return;\r\n }\r\n const caps = texture.getEngine().getCaps();\r\n const transcodeConfig = {\r\n supportedCompressionFormats: {\r\n etc1: caps.etc1 ? true : false,\r\n s3tc: caps.s3tc ? true : false,\r\n pvrtc: caps.pvrtc ? true : false,\r\n etc2: caps.etc2 ? true : false,\r\n astc: caps.astc ? true : false,\r\n bc7: caps.bptc ? true : false,\r\n },\r\n };\r\n TranscodeAsync(data, transcodeConfig)\r\n // eslint-disable-next-line github/no-then\r\n .then((result) => {\r\n const hasMipmap = result.fileInfo.images[0].levels.length > 1 && texture.generateMipMaps;\r\n LoadTextureFromTranscodeResult(texture, result);\r\n texture.getEngine()._setCubeMapTextureParams(texture, hasMipmap);\r\n texture.isReady = true;\r\n texture.onLoadedObservable.notifyObservers(texture);\r\n texture.onLoadedObservable.clear();\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n })\r\n // eslint-disable-next-line github/no-then\r\n .catch((err) => {\r\n const errorMessage = \"Failed to transcode Basis file, transcoding may not be supported on this device\";\r\n Tools.Warn(errorMessage);\r\n texture.isReady = true;\r\n if (onError) {\r\n onError(err);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\r\n * @param data contains the texture data\r\n * @param texture defines the BabylonJS internal texture\r\n * @param callback defines the method to call once ready to upload\r\n */\r\n public loadData(\r\n data: ArrayBufferView,\r\n texture: InternalTexture,\r\n callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void, failedLoading?: boolean) => void\r\n ): void {\r\n const caps = texture.getEngine().getCaps();\r\n const transcodeConfig = {\r\n supportedCompressionFormats: {\r\n etc1: caps.etc1 ? true : false,\r\n s3tc: caps.s3tc ? true : false,\r\n pvrtc: caps.pvrtc ? true : false,\r\n etc2: caps.etc2 ? true : false,\r\n astc: caps.astc ? true : false,\r\n bc7: caps.bptc ? true : false,\r\n },\r\n };\r\n TranscodeAsync(data, transcodeConfig)\r\n // eslint-disable-next-line github/no-then\r\n .then((result) => {\r\n const rootImage = result.fileInfo.images[0].levels[0];\r\n const hasMipmap = result.fileInfo.images[0].levels.length > 1 && texture.generateMipMaps;\r\n callback(rootImage.width, rootImage.height, hasMipmap, result.format !== -1, () => {\r\n LoadTextureFromTranscodeResult(texture, result);\r\n });\r\n })\r\n // eslint-disable-next-line github/no-then\r\n .catch((err) => {\r\n Tools.Warn(\"Failed to transcode Basis file, transcoding may not be supported on this device\");\r\n Tools.Warn(`Failed to transcode Basis file: ${err}`);\r\n callback(0, 0, false, false, () => {}, true);\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -29,6 +29,7 @@ export class _ENVTextureLoader {
|
|
|
29
29
|
texture.height = info.width;
|
|
30
30
|
try {
|
|
31
31
|
UploadEnvSpherical(texture, info);
|
|
32
|
+
// eslint-disable-next-line github/no-then
|
|
32
33
|
UploadEnvLevelsAsync(texture, data, info).then(() => {
|
|
33
34
|
texture.isReady = true;
|
|
34
35
|
texture.onLoadedObservable.notifyObservers(texture);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/envTextureLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAK7G;;;GAGG;AACH,gEAAgE;AAChE,MAAM,OAAO,iBAAiB;IAA9B;QACI;;WAEG;QACa,oBAAe,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"envTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/envTextureLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAK7G;;;GAGG;AACH,gEAAgE;AAChE,MAAM,OAAO,iBAAiB;IAA9B;QACI;;WAEG;QACa,oBAAe,GAAG,KAAK,CAAC;IAyD5C,CAAC;IAvDG;;;;;;;OAOG;IACI,YAAY,CACf,IAAyC,EACzC,OAAwB,EACxB,iBAA0B,EAC1B,MAAsC,EACtC,OAA8D;QAE9D,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,OAAO;QACX,CAAC;QAED,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,IAAI,EAAE,CAAC;YACP,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YAC3B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;YAE5B,IAAI,CAAC;gBACD,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;gBAClC,0CAA0C;gBAC1C,oBAAoB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,CAC1C,GAAG,EAAE;oBACD,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;oBACvB,OAAO,CAAC,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;oBACpD,OAAO,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;oBACnC,IAAI,MAAM,EAAE,CAAC;wBACT,MAAM,EAAE,CAAC;oBACb,CAAC;gBACL,CAAC,EACD,CAAC,MAAM,EAAE,EAAE;oBACP,OAAO,EAAE,CAAC,mCAAmC,EAAE,MAAM,CAAC,CAAC;gBAC3D,CAAC,CACJ,CAAC;YACN,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACT,OAAO,EAAE,CAAC,iCAAiC,EAAE,CAAC,CAAC,CAAC;YACpD,CAAC;QACL,CAAC;aAAM,IAAI,OAAO,EAAE,CAAC;YACjB,OAAO,CAAC,oCAAoC,EAAE,IAAI,CAAC,CAAC;QACxD,CAAC;IACL,CAAC;IAED;;OAEG;IACI,QAAQ;QACX,4CAA4C;QAC5C,MAAM,2BAA2B,CAAC;IACtC,CAAC;CACJ","sourcesContent":["import { GetEnvInfo, UploadEnvLevelsAsync, UploadEnvSpherical } from \"../../../Misc/environmentTextureTools\";\r\nimport type { Nullable } from \"../../../types\";\r\nimport type { InternalTexture } from \"../../../Materials/Textures/internalTexture\";\r\nimport type { IInternalTextureLoader } from \"./internalTextureLoader\";\r\n\r\n/**\r\n * Implementation of the ENV Texture Loader.\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _ENVTextureLoader implements IInternalTextureLoader {\r\n /**\r\n * Defines whether the loader supports cascade loading the different faces.\r\n */\r\n public readonly supportCascades = false;\r\n\r\n /**\r\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\r\n * @param data contains the texture data\r\n * @param texture defines the BabylonJS internal texture\r\n * @param createPolynomials will be true if polynomials have been requested\r\n * @param onLoad defines the callback to trigger once the texture is ready\r\n * @param onError defines the callback to trigger in case of error\r\n */\r\n public loadCubeData(\r\n data: ArrayBufferView | ArrayBufferView[],\r\n texture: InternalTexture,\r\n createPolynomials: boolean,\r\n onLoad: Nullable<(data?: any) => void>,\r\n onError: Nullable<(message?: string, exception?: any) => void>\r\n ): void {\r\n if (Array.isArray(data)) {\r\n return;\r\n }\r\n\r\n const info = GetEnvInfo(data);\r\n if (info) {\r\n texture.width = info.width;\r\n texture.height = info.width;\r\n\r\n try {\r\n UploadEnvSpherical(texture, info);\r\n // eslint-disable-next-line github/no-then\r\n UploadEnvLevelsAsync(texture, data, info).then(\r\n () => {\r\n texture.isReady = true;\r\n texture.onLoadedObservable.notifyObservers(texture);\r\n texture.onLoadedObservable.clear();\r\n if (onLoad) {\r\n onLoad();\r\n }\r\n },\r\n (reason) => {\r\n onError?.(\"Can not upload environment levels\", reason);\r\n }\r\n );\r\n } catch (e) {\r\n onError?.(\"Can not upload environment file\", e);\r\n }\r\n } else if (onError) {\r\n onError(\"Can not parse the environment file\", null);\r\n }\r\n }\r\n\r\n /**\r\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\r\n */\r\n public loadData(): void {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \".env not supported in 2d.\";\r\n }\r\n}\r\n"]}
|
|
@@ -107,6 +107,7 @@ export class _ExrTextureLoader {
|
|
|
107
107
|
const offset = { value: 0 };
|
|
108
108
|
const header = GetExrHeader(dataView, offset);
|
|
109
109
|
CreateDecoderAsync(header, dataView, offset, ExrLoaderGlobalConfiguration.DefaultOutputType)
|
|
110
|
+
// eslint-disable-next-line github/no-then
|
|
110
111
|
.then((decoder) => {
|
|
111
112
|
ScanData(decoder, header, dataView, offset);
|
|
112
113
|
// Updating texture
|
|
@@ -123,6 +124,7 @@ export class _ExrTextureLoader {
|
|
|
123
124
|
}
|
|
124
125
|
});
|
|
125
126
|
})
|
|
127
|
+
// eslint-disable-next-line github/no-then
|
|
126
128
|
.catch((error) => {
|
|
127
129
|
Logger.Error("Failed to load EXR texture: ", error);
|
|
128
130
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exrTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/exrTextureLoader.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,gCAAyB;AAE1C;;;;GAIG;AAEH,KAAK;AACL,0CAA0C;AAC1C,uBAAuB;AAEvB,qEAAqE;AACrE,8EAA8E;AAC9E,uEAAuE;AACvE,sEAAsE;AACtE,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,qDAAqD;AACrD,6EAA6E;AAC7E,8EAA8E;AAE9E,kFAAkF;AAClF,gFAAgF;AAChF,yEAAyE;AACzE,qEAAqE;AACrE,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,gFAAgF;AAChF,+DAA+D;AAC/D,KAAK;AAEL,8EAA8E;AAE9E,8EAA8E;AAC9E,KAAK;AACL,uEAAuE;AACvE,sBAAsB;AACtB,KAAK;AACL,0BAA0B;AAC1B,KAAK;AACL,wEAAwE;AACxE,4EAA4E;AAC5E,UAAU;AACV,4EAA4E;AAC5E,mEAAmE;AACnE,qEAAqE;AACrE,4EAA4E;AAC5E,mEAAmE;AACnE,mBAAmB;AACnB,2EAA2E;AAC3E,yEAAyE;AACzE,mEAAmE;AACnE,KAAK;AACL,yEAAyE;AACzE,uEAAuE;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,sEAAsE;AACtE,2EAA2E;AAC3E,2EAA2E;AAC3E,yEAAyE;AACzE,2EAA2E;AAC3E,0EAA0E;AAC1E,KAAK;AACL,8EAA8E;AAE9E,8EAA8E;AAE9E;;;;;;;GAOG;AACH,gEAAgE;AA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AAO,CAAC,OAAO,GAAG,KAAK,CAAC;gBACxB,OAAO,CAAC,WAAW,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC;gBAC1C,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;oBACpB,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;gBAC3F,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACb,MAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACX,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { InternalTexture } from \"../internalTexture\";\r\nimport type { IInternalTextureLoader } from \"./internalTextureLoader\";\r\nimport { GetExrHeader } from \"./EXR/exrLoader.header\";\r\nimport { CreateDecoderAsync, ScanData } from \"./EXR/exrLoader.decoder\";\r\nimport { ExrLoaderGlobalConfiguration } from \"./EXR/exrLoader.configuration\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js\r\n * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita\r\n * implementation.\r\n */\r\n\r\n// /*\r\n// Copyright (c) 2014 - 2017, Syoyo Fujita\r\n// All rights reserved.\r\n\r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// * Redistributions of source code must retain the above copyright\r\n// notice, this list of conditions and the following disclaimer.\r\n// * Redistributions in binary form must reproduce the above copyright\r\n// notice, this list of conditions and the following disclaimer in the\r\n// documentation and/or other materials provided with the distribution.\r\n// * Neither the name of the Syoyo Fujita nor the\r\n// names of its contributors may be used to endorse or promote products\r\n// derived from this software without specific prior written permission.\r\n\r\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\r\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\n// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\r\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// */\r\n\r\n// // TinyEXR contains some OpenEXR code, which is licensed under ------------\r\n\r\n// ///////////////////////////////////////////////////////////////////////////\r\n// //\r\n// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas\r\n// // Digital Ltd. LLC\r\n// //\r\n// // All rights reserved.\r\n// //\r\n// // Redistribution and use in source and binary forms, with or without\r\n// // modification, are permitted provided that the following conditions are\r\n// // met:\r\n// // * Redistributions of source code must retain the above copyright\r\n// // notice, this list of conditions and the following disclaimer.\r\n// // * Redistributions in binary form must reproduce the above\r\n// // copyright notice, this list of conditions and the following disclaimer\r\n// // in the documentation and/or other materials provided with the\r\n// // distribution.\r\n// // * Neither the name of Industrial Light & Magic nor the names of\r\n// // its contributors may be used to endorse or promote products derived\r\n// // from this software without specific prior written permission.\r\n// //\r\n// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n// // \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r\n// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r\n// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r\n// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r\n// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\n// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// //\r\n// ///////////////////////////////////////////////////////////////////////////\r\n\r\n// // End of OpenEXR license -------------------------------------------------\r\n\r\n/**\r\n * Loader for .exr file format\r\n * @see [PIZ compression](https://playground.babylonjs.com/#4RN0VF#151)\r\n * @see [ZIP compression](https://playground.babylonjs.com/#4RN0VF#146)\r\n * @see [RLE compression](https://playground.babylonjs.com/#4RN0VF#149)\r\n * @see [PXR24 compression](https://playground.babylonjs.com/#4RN0VF#150)\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _ExrTextureLoader implements IInternalTextureLoader {\r\n /**\r\n * Defines whether the loader supports cascade loading the different faces.\r\n */\r\n public readonly supportCascades = false;\r\n\r\n /**\r\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\r\n * @param _data contains the texture data\r\n * @param _texture defines the BabylonJS internal texture\r\n * @param _createPolynomials will be true if polynomials have been requested\r\n * @param _onLoad defines the callback to trigger once the texture is ready\r\n * @param _onError defines the callback to trigger in case of error\r\n * Cube texture are not supported by .exr files\r\n */\r\n public loadCubeData(\r\n _data: ArrayBufferView | ArrayBufferView[],\r\n _texture: InternalTexture,\r\n _createPolynomials: boolean,\r\n _onLoad: Nullable<(data?: any) => void>,\r\n _onError: Nullable<(message?: string, exception?: any) => void>\r\n ): void {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \".exr not supported in Cube.\";\r\n }\r\n\r\n /**\r\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\r\n * @param data contains the texture data\r\n * @param texture defines the BabylonJS internal texture\r\n * @param callback defines the method to call once ready to upload\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public loadData(\r\n data: ArrayBufferView,\r\n texture: InternalTexture,\r\n callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void, failedLoading?: boolean) => void\r\n ) {\r\n const dataView = new DataView(data.buffer);\r\n\r\n const offset = { value: 0 };\r\n const header = GetExrHeader(dataView, offset);\r\n CreateDecoderAsync(header, dataView, offset, ExrLoaderGlobalConfiguration.DefaultOutputType)\r\n .then((decoder) => {\r\n ScanData(decoder, header, dataView, offset);\r\n\r\n // Updating texture\r\n const width = header.dataWindow.xMax - header.dataWindow.xMin + 1;\r\n const height = header.dataWindow.yMax - header.dataWindow.yMin + 1;\r\n callback(width, height, texture.generateMipMaps, false, () => {\r\n const engine = texture.getEngine();\r\n texture.format = header.format;\r\n texture.type = decoder.textureType;\r\n texture.invertY = false;\r\n texture._gammaSpace = !header.linearSpace;\r\n if (decoder.byteArray) {\r\n engine._uploadDataToTextureDirectly(texture, decoder.byteArray, 0, 0, undefined, true);\r\n }\r\n });\r\n })\r\n .catch((error) => {\r\n Logger.Error(\"Failed to load EXR texture: \", error);\r\n });\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"exrTextureLoader.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Textures/Loaders/exrTextureLoader.ts"],"names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AW,CAAC;gBAC1C,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;oBACpB,MAAM,CAAC,4BAA4B,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;gBAC3F,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC;YACF,0CAA0C;aACzC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACb,MAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACX,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { InternalTexture } from \"../internalTexture\";\r\nimport type { IInternalTextureLoader } from \"./internalTextureLoader\";\r\nimport { GetExrHeader } from \"./EXR/exrLoader.header\";\r\nimport { CreateDecoderAsync, ScanData } from \"./EXR/exrLoader.decoder\";\r\nimport { ExrLoaderGlobalConfiguration } from \"./EXR/exrLoader.configuration\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * Inspired by https://github.com/sciecode/three.js/blob/dev/examples/jsm/loaders/EXRLoader.js\r\n * Referred to the original Industrial Light & Magic OpenEXR implementation and the TinyEXR / Syoyo Fujita\r\n * implementation.\r\n */\r\n\r\n// /*\r\n// Copyright (c) 2014 - 2017, Syoyo Fujita\r\n// All rights reserved.\r\n\r\n// Redistribution and use in source and binary forms, with or without\r\n// modification, are permitted provided that the following conditions are met:\r\n// * Redistributions of source code must retain the above copyright\r\n// notice, this list of conditions and the following disclaimer.\r\n// * Redistributions in binary form must reproduce the above copyright\r\n// notice, this list of conditions and the following disclaimer in the\r\n// documentation and/or other materials provided with the distribution.\r\n// * Neither the name of the Syoyo Fujita nor the\r\n// names of its contributors may be used to endorse or promote products\r\n// derived from this software without specific prior written permission.\r\n\r\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\r\n// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\n// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\n// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\r\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r\n// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// */\r\n\r\n// // TinyEXR contains some OpenEXR code, which is licensed under ------------\r\n\r\n// ///////////////////////////////////////////////////////////////////////////\r\n// //\r\n// // Copyright (c) 2002, Industrial Light & Magic, a division of Lucas\r\n// // Digital Ltd. LLC\r\n// //\r\n// // All rights reserved.\r\n// //\r\n// // Redistribution and use in source and binary forms, with or without\r\n// // modification, are permitted provided that the following conditions are\r\n// // met:\r\n// // * Redistributions of source code must retain the above copyright\r\n// // notice, this list of conditions and the following disclaimer.\r\n// // * Redistributions in binary form must reproduce the above\r\n// // copyright notice, this list of conditions and the following disclaimer\r\n// // in the documentation and/or other materials provided with the\r\n// // distribution.\r\n// // * Neither the name of Industrial Light & Magic nor the names of\r\n// // its contributors may be used to endorse or promote products derived\r\n// // from this software without specific prior written permission.\r\n// //\r\n// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r\n// // \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r\n// // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r\n// // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r\n// // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n// // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r\n// // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r\n// // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r\n// // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r\n// // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r\n// // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n// //\r\n// ///////////////////////////////////////////////////////////////////////////\r\n\r\n// // End of OpenEXR license -------------------------------------------------\r\n\r\n/**\r\n * Loader for .exr file format\r\n * @see [PIZ compression](https://playground.babylonjs.com/#4RN0VF#151)\r\n * @see [ZIP compression](https://playground.babylonjs.com/#4RN0VF#146)\r\n * @see [RLE compression](https://playground.babylonjs.com/#4RN0VF#149)\r\n * @see [PXR24 compression](https://playground.babylonjs.com/#4RN0VF#150)\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport class _ExrTextureLoader implements IInternalTextureLoader {\r\n /**\r\n * Defines whether the loader supports cascade loading the different faces.\r\n */\r\n public readonly supportCascades = false;\r\n\r\n /**\r\n * Uploads the cube texture data to the WebGL texture. It has already been bound.\r\n * @param _data contains the texture data\r\n * @param _texture defines the BabylonJS internal texture\r\n * @param _createPolynomials will be true if polynomials have been requested\r\n * @param _onLoad defines the callback to trigger once the texture is ready\r\n * @param _onError defines the callback to trigger in case of error\r\n * Cube texture are not supported by .exr files\r\n */\r\n public loadCubeData(\r\n _data: ArrayBufferView | ArrayBufferView[],\r\n _texture: InternalTexture,\r\n _createPolynomials: boolean,\r\n _onLoad: Nullable<(data?: any) => void>,\r\n _onError: Nullable<(message?: string, exception?: any) => void>\r\n ): void {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \".exr not supported in Cube.\";\r\n }\r\n\r\n /**\r\n * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.\r\n * @param data contains the texture data\r\n * @param texture defines the BabylonJS internal texture\r\n * @param callback defines the method to call once ready to upload\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n public loadData(\r\n data: ArrayBufferView,\r\n texture: InternalTexture,\r\n callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void, failedLoading?: boolean) => void\r\n ) {\r\n const dataView = new DataView(data.buffer);\r\n\r\n const offset = { value: 0 };\r\n const header = GetExrHeader(dataView, offset);\r\n CreateDecoderAsync(header, dataView, offset, ExrLoaderGlobalConfiguration.DefaultOutputType)\r\n // eslint-disable-next-line github/no-then\r\n .then((decoder) => {\r\n ScanData(decoder, header, dataView, offset);\r\n\r\n // Updating texture\r\n const width = header.dataWindow.xMax - header.dataWindow.xMin + 1;\r\n const height = header.dataWindow.yMax - header.dataWindow.yMin + 1;\r\n callback(width, height, texture.generateMipMaps, false, () => {\r\n const engine = texture.getEngine();\r\n texture.format = header.format;\r\n texture.type = decoder.textureType;\r\n texture.invertY = false;\r\n texture._gammaSpace = !header.linearSpace;\r\n if (decoder.byteArray) {\r\n engine._uploadDataToTextureDirectly(texture, decoder.byteArray, 0, 0, undefined, true);\r\n }\r\n });\r\n })\r\n // eslint-disable-next-line github/no-then\r\n .catch((error) => {\r\n Logger.Error(\"Failed to load EXR texture: \", error);\r\n });\r\n }\r\n}\r\n"]}
|
|
@@ -90,6 +90,7 @@ export class _KTXTextureLoader {
|
|
|
90
90
|
}
|
|
91
91
|
else if (KhronosTextureContainer2.IsValid(data)) {
|
|
92
92
|
const ktx2 = new KhronosTextureContainer2(texture.getEngine());
|
|
93
|
+
// eslint-disable-next-line github/no-then
|
|
93
94
|
ktx2._uploadAsync(data, texture, options).then(() => {
|
|
94
95
|
callback(texture.width, texture.height, texture.generateMipMaps, true, () => { }, false);
|
|
95
96
|
}, (error) => {
|