@onerjs/core 8.55.8 → 8.56.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animation.pure.js +2 -2
- package/Animations/animation.pure.js.map +1 -1
- package/Animations/runtimeAnimation.js +4 -0
- package/Animations/runtimeAnimation.js.map +1 -1
- package/AudioV2/webAudio/webAudioEngine.d.ts +7 -0
- package/AudioV2/webAudio/webAudioEngine.js +6 -5
- package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Meshes/followBehavior.js +1 -0
- package/Behaviors/Meshes/followBehavior.js.map +1 -1
- package/Behaviors/Meshes/surfaceMagnetismBehavior.js +1 -0
- package/Behaviors/Meshes/surfaceMagnetismBehavior.js.map +1 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.js +2 -2
- package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/followCameraPointersInput.d.ts +15 -0
- package/Cameras/Inputs/followCameraPointersInput.js +18 -3
- package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.pure.js +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.pure.js.map +1 -1
- package/Cameras/arcRotateCamera.pure.js +1 -1
- package/Cameras/arcRotateCamera.pure.js.map +1 -1
- package/Collisions/gpuPicker.d.ts +1 -0
- package/Collisions/gpuPicker.js +5 -4
- package/Collisions/gpuPicker.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.js +9 -5
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Culling/boundingSphere.js +7 -4
- package/Culling/boundingSphere.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.d.ts +5 -1
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.js +7 -3
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.pure.d.ts +6 -0
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.pure.js +16 -0
- package/Engines/AbstractEngine/abstractEngine.textureLoaders.pure.js.map +1 -0
- package/Engines/AbstractEngine/pure.d.ts +1 -0
- package/Engines/AbstractEngine/pure.js +1 -0
- package/Engines/AbstractEngine/pure.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
- package/Engines/IDrawContext.d.ts +2 -0
- package/Engines/IDrawContext.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +48 -6
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +1 -1
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/WebGPU/webgpuDrawContext.d.ts +8 -0
- package/Engines/WebGPU/webgpuDrawContext.js +15 -0
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/abstractEngine.pure.js +2 -2
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.d.ts +21 -4
- package/Engines/thinNativeEngine.pure.d.ts +6 -1
- package/Engines/thinNativeEngine.pure.js +29 -2
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +1 -0
- package/Engines/webgpuEngine.js +1 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +10 -0
- package/Engines/webgpuEngine.pure.js +15 -1
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.d.ts +3 -63
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.js +5 -71
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.d.ts +71 -0
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.js +86 -0
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Data/pure.d.ts +1 -0
- package/FlowGraph/Blocks/Data/pure.js +1 -0
- package/FlowGraph/Blocks/Data/pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.d.ts +3 -37
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.js +5 -39
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.d.ts +45 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.js +54 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.d.ts +3 -17
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.js +5 -22
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.d.ts +25 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.js +37 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Event/pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/pure.js +2 -0
- package/FlowGraph/Blocks/Event/pure.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.d.ts +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +198 -172
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js +2 -5
- package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js.map +1 -1
- package/FrameGraph/frameGraph.js +10 -1
- package/FrameGraph/frameGraph.js.map +1 -1
- package/Gamepads/gamepadManager.d.ts +1 -0
- package/Gamepads/gamepadManager.js +5 -2
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Gizmos/scaleGizmo.js +1 -0
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Lights/IES/iesLoader.js +6 -8
- package/Lights/IES/iesLoader.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.js +4 -6
- package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +2 -2
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/light.js +3 -5
- package/Lights/light.js.map +1 -1
- package/Lights/spotLight.pure.js +1 -1
- package/Lights/spotLight.pure.js.map +1 -1
- package/Materials/Background/backgroundMaterial.pure.d.ts +1 -1
- package/Materials/Background/backgroundMaterial.pure.js +3 -12
- package/Materials/Background/backgroundMaterial.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +2 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.pure.js +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js +2 -0
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js +1 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/powBlock.pure.js +2 -1
- package/Materials/Node/Blocks/powBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/triPlanarBlock.pure.js +14 -12
- package/Materials/Node/Blocks/triPlanarBlock.pure.js.map +1 -1
- package/Materials/Node/nodeMaterial.pure.d.ts +1 -0
- package/Materials/Node/nodeMaterialBuildState.d.ts +3 -3
- package/Materials/PBR/openpbrMaterial.pure.d.ts +2 -1
- package/Materials/PBR/openpbrMaterial.pure.js +3 -12
- package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +2 -1
- package/Materials/PBR/pbrBaseMaterial.pure.js +3 -12
- package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
- package/Materials/Textures/index.d.ts +1 -0
- package/Materials/Textures/index.js +1 -0
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.pure.js +1 -1
- package/Materials/Textures/renderTargetTexture.pure.js.map +1 -1
- package/Materials/drawWrapper.js +3 -0
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/imageProcessingConfiguration.defines.d.ts +3 -0
- package/Materials/imageProcessingConfiguration.defines.js +2 -0
- package/Materials/imageProcessingConfiguration.defines.js.map +1 -1
- package/Materials/imageProcessingConfiguration.functions.js +3 -0
- package/Materials/imageProcessingConfiguration.functions.js.map +1 -1
- package/Materials/imageProcessingConfiguration.pure.d.ts +58 -0
- package/Materials/imageProcessingConfiguration.pure.js +123 -2
- package/Materials/imageProcessingConfiguration.pure.js.map +1 -1
- package/Materials/material.pure.js +2 -2
- package/Materials/material.pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +2 -1
- package/Materials/standardMaterial.pure.js +4 -13
- package/Materials/standardMaterial.pure.js.map +1 -1
- package/Materials/uniformBuffer.d.ts +29 -0
- package/Materials/uniformBuffer.js +146 -0
- package/Materials/uniformBuffer.js.map +1 -1
- package/Maths/colorTemperature.functions.d.ts +29 -0
- package/Maths/colorTemperature.functions.js +196 -0
- package/Maths/colorTemperature.functions.js.map +1 -0
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Maths/math.path.js +1 -1
- package/Maths/math.path.js.map +1 -1
- package/Maths/math.polar.js +1 -1
- package/Maths/math.polar.js.map +1 -1
- package/Maths/math.vector.pure.js +4 -3
- package/Maths/math.vector.pure.js.map +1 -1
- package/Maths/pure.d.ts +1 -0
- package/Maths/pure.js +1 -0
- package/Maths/pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +72 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +164 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +2 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +36 -18
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.d.ts +5 -4
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.js +25 -8
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +3 -3
- package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js +2 -2
- package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js.map +1 -1
- package/Meshes/Node/Blocks/mappingBlock.pure.js +2 -2
- package/Meshes/Node/Blocks/mappingBlock.pure.js.map +1 -1
- package/Meshes/csg.js +5 -5
- package/Meshes/csg.js.map +1 -1
- package/Meshes/groundMesh.pure.js +1 -1
- package/Meshes/groundMesh.pure.js.map +1 -1
- package/Meshes/mesh.pure.js +2 -2
- package/Meshes/mesh.pure.js.map +1 -1
- package/Misc/deepMerger.js +1 -1
- package/Misc/deepMerger.js.map +1 -1
- package/Misc/dumpTools.pure.js +1 -1
- package/Misc/dumpTools.pure.js.map +1 -1
- package/Misc/index.d.ts +1 -0
- package/Misc/index.js +1 -0
- package/Misc/index.js.map +1 -1
- package/Misc/observable.pure.js +1 -3
- package/Misc/observable.pure.js.map +1 -1
- package/Misc/pure.d.ts +1 -0
- package/Misc/pure.js +1 -0
- package/Misc/pure.js.map +1 -1
- package/Misc/shaderImportLoader.d.ts +25 -0
- package/Misc/shaderImportLoader.js +54 -0
- package/Misc/shaderImportLoader.js.map +1 -0
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleClampBlock.pure.d.ts +0 -1
- package/Particles/Node/Blocks/particleClampBlock.pure.js +1 -6
- package/Particles/Node/Blocks/particleClampBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleMathBlock.pure.js +1 -1
- package/Particles/Node/Blocks/particleMathBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleNLerpBlock.pure.js +8 -3
- package/Particles/Node/Blocks/particleNLerpBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleSmoothStepBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleSmoothStepBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleStepBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleStepBlock.pure.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.js +1 -1
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.d.ts +41 -1
- package/PostProcesses/imageProcessingPostProcess.js +41 -1
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.pure.js +1 -1
- package/PostProcesses/sharpenPostProcess.pure.js.map +1 -1
- package/PostProcesses/thinImageProcessingPostProcess.d.ts +50 -0
- package/PostProcesses/thinImageProcessingPostProcess.js +65 -0
- package/PostProcesses/thinImageProcessingPostProcess.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.d.ts +12 -0
- package/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.js +22 -0
- package/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.js.map +1 -0
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.d.ts +1 -0
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js +39 -0
- package/Rendering/IBLShadows/iblShadowsPluginMaterial.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.d.ts +12 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +17 -5
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +14 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +122 -6
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +7 -0
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +17 -0
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
- package/Rendering/IBLShadows/pure.d.ts +1 -0
- package/Rendering/IBLShadows/pure.js +1 -0
- package/Rendering/IBLShadows/pure.js.map +1 -1
- package/Rendering/boundingBoxRenderer.pure.js +3 -3
- package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +11 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +36 -14
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +5 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +16 -3
- package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +5 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +12 -0
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/iblCdfGenerator.js +10 -1
- package/Rendering/iblCdfGenerator.js.map +1 -1
- package/Rendering/outlineRenderer.pure.js +1 -0
- package/Rendering/outlineRenderer.pure.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.js +1 -1
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Rendering/subSurfaceSceneComponent.pure.d.ts +1 -1
- package/Rendering/subSurfaceSceneComponent.pure.js +1 -1
- package/Rendering/subSurfaceSceneComponent.pure.js.map +1 -1
- package/Rendering/utilityLayerRenderer.js +1 -1
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js +1 -1
- package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/helperFunctions.js +2 -2
- package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/imageProcessingDeclaration.js +3 -0
- package/Shaders/ShadersInclude/imageProcessingDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/imageProcessingFunctions.js +3 -0
- package/Shaders/ShadersInclude/imageProcessingFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrDirectLighting.js +34 -4
- package/Shaders/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrIblFunctions.js +8 -2
- package/Shaders/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +5 -0
- package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js +7 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/Shaders/fluidRenderingParticleDiffuse.vertex.js +7 -1
- package/Shaders/fluidRenderingParticleDiffuse.vertex.js.map +1 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js +7 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/Shaders/gaussianSplattingVoxel.fragment.js +4 -10
- package/Shaders/gaussianSplattingVoxel.fragment.js.map +1 -1
- package/Shaders/iblCombineVoxelGrids.fragment.js +1 -1
- package/Shaders/iblCombineVoxelGrids.fragment.js.map +1 -1
- package/Shaders/iblShadowVoxelTracing.fragment.js +24 -7
- package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.js +13 -0
- package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js +3 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js +3 -0
- package/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js +35 -5
- package/ShadersWGSL/ShadersInclude/openpbrDirectLighting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrDirectLightingInit.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +8 -2
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +5 -0
- package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +16 -4
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleDiffuse.vertex.js +15 -3
- package/ShadersWGSL/fluidRenderingParticleDiffuse.vertex.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -3
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingVoxel.fragment.js +15 -9
- package/ShadersWGSL/gaussianSplattingVoxel.fragment.js.map +1 -1
- package/ShadersWGSL/iblCombineVoxelGrids.fragment.js +1 -1
- package/ShadersWGSL/iblCombineVoxelGrids.fragment.js.map +1 -1
- package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.d.ts +5 -0
- package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.js +14 -0
- package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.js.map +1 -0
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +24 -7
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/ShadersWGSL/iblVoxelGrid.fragment.js +26 -6
- package/ShadersWGSL/iblVoxelGrid.fragment.js.map +1 -1
- package/SmartAssets/smartAssetManager.pure.js +1 -1
- package/SmartAssets/smartAssetManager.pure.js.map +1 -1
- package/Sprites/thinSprite.js +1 -1
- package/Sprites/thinSprite.js.map +1 -1
- package/XR/features/Layers/WebXRCompositionLayer.d.ts +182 -12
- package/XR/features/Layers/WebXRCompositionLayer.js +272 -3
- package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
- package/XR/features/Layers/WebXRFallbackLayer.d.ts +84 -0
- package/XR/features/Layers/WebXRFallbackLayer.js +137 -0
- package/XR/features/Layers/WebXRFallbackLayer.js.map +1 -0
- package/XR/features/Layers/WebXRWebGPUCompositionLayer.d.ts +4 -4
- package/XR/features/Layers/WebXRWebGPUCompositionLayer.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.pure.d.ts +45 -0
- package/XR/features/WebXRAnchorSystem.pure.js +153 -13
- package/XR/features/WebXRAnchorSystem.pure.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.pure.js +2 -1
- package/XR/features/WebXRControllerPointerSelection.pure.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.pure.js +2 -1
- package/XR/features/WebXRControllerTeleportation.pure.js.map +1 -1
- package/XR/features/WebXRDepthSensing.pure.d.ts +21 -0
- package/XR/features/WebXRDepthSensing.pure.js +42 -0
- package/XR/features/WebXRDepthSensing.pure.js.map +1 -1
- package/XR/features/WebXRHandTracking.pure.js +2 -0
- package/XR/features/WebXRHandTracking.pure.js.map +1 -1
- package/XR/features/WebXRLayers.pure.d.ts +183 -8
- package/XR/features/WebXRLayers.pure.js +531 -99
- package/XR/features/WebXRLayers.pure.js.map +1 -1
- package/XR/features/WebXRLayersFallback.d.ts +5 -0
- package/XR/features/WebXRLayersFallback.js +8 -0
- package/XR/features/WebXRLayersFallback.js.map +1 -0
- package/XR/features/WebXRLayersFallback.pure.d.ts +6 -0
- package/XR/features/WebXRLayersFallback.pure.js +44 -0
- package/XR/features/WebXRLayersFallback.pure.js.map +1 -0
- package/XR/features/WebXRLightEstimation.pure.d.ts +3 -4
- package/XR/features/WebXRLightEstimation.pure.js +22 -21
- package/XR/features/WebXRLightEstimation.pure.js.map +1 -1
- package/XR/features/WebXRMeshDetector.pure.d.ts +5 -0
- package/XR/features/WebXRMeshDetector.pure.js +1 -0
- package/XR/features/WebXRMeshDetector.pure.js.map +1 -1
- package/XR/features/WebXRNearInteraction.pure.js +3 -3
- package/XR/features/WebXRNearInteraction.pure.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.pure.d.ts +9 -5
- package/XR/features/WebXRPlaneDetector.pure.js +12 -8
- package/XR/features/WebXRPlaneDetector.pure.js.map +1 -1
- package/XR/features/WebXRTrackedSources.d.ts +5 -0
- package/XR/features/WebXRTrackedSources.js +8 -0
- package/XR/features/WebXRTrackedSources.js.map +1 -0
- package/XR/features/WebXRTrackedSources.pure.d.ts +70 -0
- package/XR/features/WebXRTrackedSources.pure.js +153 -0
- package/XR/features/WebXRTrackedSources.pure.js.map +1 -0
- package/XR/features/index.d.ts +1 -0
- package/XR/features/index.js +1 -0
- package/XR/features/index.js.map +1 -1
- package/XR/features/pure.d.ts +2 -0
- package/XR/features/pure.js +2 -0
- package/XR/features/pure.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.d.ts +53 -1
- package/XR/motionController/webXRAbstractMotionController.js +61 -0
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/webXRCamera.d.ts +2 -0
- package/XR/webXRCamera.js +8 -2
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRDefaultExperience.js +8 -4
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXRExperienceHelper.js +86 -44
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRFeaturesManager.d.ts +9 -0
- package/XR/webXRFeaturesManager.js +4 -0
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/XR/webXRGraphicsBinding.d.ts +29 -0
- package/XR/webXRGraphicsBinding.js +40 -0
- package/XR/webXRGraphicsBinding.js.map +1 -1
- package/XR/webXRInputSource.js +1 -1
- package/XR/webXRInputSource.js.map +1 -1
- package/XR/webXRLayerWrapper.d.ts +26 -10
- package/XR/webXRLayerWrapper.js +19 -7
- package/XR/webXRLayerWrapper.js.map +1 -1
- package/XR/webXRRenderTargetTextureProvider.d.ts +4 -4
- package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRSessionManager.d.ts +45 -0
- package/XR/webXRSessionManager.js +174 -29
- package/XR/webXRSessionManager.js.map +1 -1
- package/XR/webXRWebGLRenderTargetTextureProvider.d.ts +2 -1
- package/XR/webXRWebGLRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRWebGPURenderTargetTextureProvider.d.ts +3 -3
- package/XR/webXRWebGPURenderTargetTextureProvider.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +5 -0
- package/scene.pure.js +25 -0
- package/scene.pure.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenSpaceCurvaturePostProcess.pure.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/screenSpaceCurvaturePostProcess.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAG7D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;GAEG;IACU,+BAA+B;;sBAAS,WAAW;;;;sBAAnD,+BAAgC,SAAQ,WAAW;YAC5D;;eAEG;YAEH,IAAW,KAAK;gBACZ,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC;YACrC,CAAC;YAED,IAAW,KAAK,CAAC,KAAa;gBAC1B,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,KAAK,CAAC;YACtC,CAAC;YAED;;eAEG;YAEH,IAAW,MAAM;gBACb,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC;YACtC,CAAC;YAED,IAAW,MAAM,CAAC,KAAa;gBAC3B,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,KAAK,CAAC;YACvC,CAAC;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IAAI,CAAC,OAAO,GAAG,CAAC,MAAc,EAAE,EAAE;wBAC9B,MAAM,aAAa,GAAG,IAAI,CAAC,uBAAwB,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;wBAC7E,MAAM,CAAC,UAAU,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC;oBACtD,CAAC,CAAC;gBACN,CAAC;YACL,CAAC;YAED;;eAEG;YACI,MAAM,KAAK,WAAW;gBACzB,MAAM,MAAM,GAAG,WAAW,CAAC,iBAAiB,CAAC;gBAC7C,IAAI,CAAC,MAAM,EAAE,CAAC;oBACV,OAAO,KAAK,CAAC;gBACjB,CAAC;gBAED,OAAO,MAAM,CAAC,OAAO,EAAE,CAAC,oBAAoB,CAAC;YACjD,CAAC;YAED;;eAEG;YACI,MAAM,CAAU,MAAM,CAAC,iBAAsB,EAAE,YAAoB,EAAE,KAAY,EAAE,OAAe;gBACrG,OAAO,mBAAmB,CAAC,KAAK,CAC5B,GAAG,EAAE;oBACD,OAAO,IAAI,EAA+B,CACtC,iBAAiB,CAAC,IAAI,EACtB,KAAK,EACL,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,KAAK,CAAC,SAAS,EAAE,EACjB,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"screenSpaceCurvaturePostProcess.pure.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/screenSpaceCurvaturePostProcess.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAG7D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,m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AAI,EAA+B,CACtC,iBAAiB,CAAC,IAAI,EACtB,KAAK,EACL,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,KAAK,CAAC,SAAS,EAAE,EACjB,iBAAiB,CAAC,QAAQ,EAC1B,iBAAiB,CAAC,WAAW,CAChC,CAAC;gBACN,CAAC,EACD,iBAAiB,EACjB,KAAK,EACL,OAAO,CACV,CAAC;YACN,CAAC;;;;qCA7HA,SAAS,EAAE;sCAYX,SAAS,EAAE;YAXZ,oKAAW,KAAK,6DAEf;YAUD,uKAAW,MAAM,6DAEhB;;;;;SAnBQ,+BAA+B;AAoI5C,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,uCAAuC;IACnD,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,yCAAyC,EAAE,+BAA+B,CAAC,CAAC;AAC9F,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type Nullable } from \"../types\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { type Camera } from \"../Cameras/camera.pure\";\r\nimport { type Effect } from \"../Materials/effect.pure\";\r\nimport { PostProcess } from \"./postProcess.pure\";\r\nimport { type PostProcessOptions } from \"./postProcess\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { type GeometryBufferRenderer } from \"../Rendering/geometryBufferRenderer.pure\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\nimport { type AbstractEngine } from \"../Engines/abstractEngine.pure\";\r\nimport { type Scene } from \"../scene.pure\";\r\nimport { ThinScreenSpaceCurvaturePostProcess } from \"./thinScreenSpaceCurvaturePostProcess\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\n/**\r\n * The Screen Space curvature effect can help highlighting ridge and valley of a model.\r\n */\r\nexport class ScreenSpaceCurvaturePostProcess extends PostProcess {\r\n /**\r\n * Defines how much ridge the curvature effect displays.\r\n */\r\n @serialize()\r\n public get ridge() {\r\n return this._effectWrapper.ridge;\r\n }\r\n\r\n public set ridge(value: number) {\r\n this._effectWrapper.ridge = value;\r\n }\r\n\r\n /**\r\n * Defines how much valley the curvature effect displays.\r\n */\r\n @serialize()\r\n public get valley() {\r\n return this._effectWrapper.valley;\r\n }\r\n\r\n public set valley(value: number) {\r\n this._effectWrapper.valley = value;\r\n }\r\n\r\n private _geometryBufferRenderer: Nullable<GeometryBufferRenderer>;\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"ScreenSpaceCurvaturePostProcess\" string\r\n */\r\n public override getClassName(): string {\r\n return \"ScreenSpaceCurvaturePostProcess\";\r\n }\r\n\r\n declare protected _effectWrapper: ThinScreenSpaceCurvaturePostProcess;\r\n\r\n /**\r\n * Creates a new instance ScreenSpaceCurvaturePostProcess\r\n * @param name The name of the effect.\r\n * @param scene The scene containing the objects to blur according to their velocity.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n scene: Scene,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n blockCompilation = false\r\n ) {\r\n const localOptions = {\r\n uniforms: ThinScreenSpaceCurvaturePostProcess.Uniforms,\r\n samplers: ThinScreenSpaceCurvaturePostProcess.Samplers,\r\n size: typeof options === \"number\" ? options : undefined,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n textureType,\r\n blockCompilation,\r\n ...(options as PostProcessOptions),\r\n };\r\n\r\n super(name, ThinScreenSpaceCurvaturePostProcess.FragmentUrl, {\r\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinScreenSpaceCurvaturePostProcess(name, engine, localOptions) : undefined,\r\n ...localOptions,\r\n });\r\n\r\n this._geometryBufferRenderer = scene.enableGeometryBufferRenderer();\r\n\r\n if (!this._geometryBufferRenderer) {\r\n // Geometry buffer renderer is not supported. So, work as a passthrough.\r\n Logger.Error(\"Multiple Render Target support needed for screen space curvature post process. Please use IsSupported test first.\");\r\n } else {\r\n if (this._geometryBufferRenderer.generateNormalsInWorldSpace) {\r\n Logger.Error(\"ScreenSpaceCurvaturePostProcess does not support generateNormalsInWorldSpace=true for the geometry buffer renderer!\");\r\n }\r\n\r\n // Geometry buffer renderer is supported.\r\n this.onApply = (effect: Effect) => {\r\n const normalTexture = this._geometryBufferRenderer!.getGBuffer().textures[1];\r\n effect.setTexture(\"normalSampler\", normalTexture);\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Support test.\r\n */\r\n public static get IsSupported(): boolean {\r\n const engine = EngineStore.LastCreatedEngine;\r\n if (!engine) {\r\n return false;\r\n }\r\n\r\n return engine.getCaps().drawBuffersExtension;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static override _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string) {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new ScreenSpaceCurvaturePostProcess(\r\n parsedPostProcess.name,\r\n scene,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.textureType\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for screenSpaceCurvaturePostProcess.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterScreenSpaceCurvaturePostProcess(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.ScreenSpaceCurvaturePostProcess\", ScreenSpaceCurvaturePostProcess);\r\n}\r\n"]}
|
|
@@ -80,7 +80,7 @@ let SharpenPostProcess = (() => {
|
|
|
80
80
|
*/
|
|
81
81
|
static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {
|
|
82
82
|
return SerializationHelper.Parse(() => {
|
|
83
|
-
return new _a(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.
|
|
83
|
+
return new _a(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType);
|
|
84
84
|
}, parsedPostProcess, scene, rootUrl);
|
|
85
85
|
}
|
|
86
86
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharpenPostProcess.pure.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/sharpenPostProcess.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAK7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAGvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;;GAGG;IACU,kBAAkB;;sBAAS,WAAW;;;;sBAAtC,kBAAmB,SAAQ,WAAW;YAC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G,OAAO,mBAAmB,CAAC,KAAK,CAC5B,GAAG,EAAE;oBACD,OAAO,IAAI,EAAkB,CACzB,iBAAiB,CAAC,IAAI,EACtB,iBAAiB,CAAC,OAAO,EACzB,YAAY,EACZ,iBAAiB,CAAC,wBAAwB,EAC1C,KAAK,CAAC,SAAS,EAAE,EACjB,iBAAiB,CAAC,QAAQ,EAC1B,iBAAiB,CAAC,WAAW,CAChC,CAAC;gBACN,CAAC,EACD,iBAAiB,EACjB,KAAK,EACL,OAAO,CACV,CAAC;YACN,CAAC;;;;2CA/FA,SAAS,EAAE;0CAYX,SAAS,EAAE;YAXZ,sLAAW,WAAW,6DAErB;YAUD,mLAAW,UAAU,6DAEpB;;;;;SAnBQ,kBAAkB;AAsG/B,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,0BAA0B;IACtC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC;AACpE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { type Nullable } from \"../types\";\r\nimport { type Camera } from \"../Cameras/camera.pure\";\r\nimport { type Effect } from \"../Materials/effect.pure\";\r\nimport { PostProcess } from \"./postProcess.pure\";\r\nimport { type PostProcessOptions } from \"./postProcess\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { serialize } from \"../Misc/decorators\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\nimport { type AbstractEngine } from \"../Engines/abstractEngine.pure\";\r\nimport { type Scene } from \"../scene.pure\";\r\nimport { ThinSharpenPostProcess } from \"./thinSharpenPostProcess\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\n/**\r\n * The SharpenPostProcess applies a sharpen kernel to every pixel\r\n * See http://en.wikipedia.org/wiki/Kernel_(image_processing)\r\n */\r\nexport class SharpenPostProcess extends PostProcess {\r\n /**\r\n * How much of the original color should be applied. Setting this to 0 will display edge detection. (default: 1)\r\n */\r\n @serialize()\r\n public get colorAmount() {\r\n return this._effectWrapper.colorAmount;\r\n }\r\n\r\n public set colorAmount(value: number) {\r\n this._effectWrapper.colorAmount = value;\r\n }\r\n\r\n /**\r\n * How much sharpness should be applied (default: 0.3)\r\n */\r\n @serialize()\r\n public get edgeAmount() {\r\n return this._effectWrapper.edgeAmount;\r\n }\r\n\r\n public set edgeAmount(value: number) {\r\n this._effectWrapper.edgeAmount = value;\r\n }\r\n\r\n /**\r\n * Gets a string identifying the name of the class\r\n * @returns \"SharpenPostProcess\" string\r\n */\r\n public override getClassName(): string {\r\n return \"SharpenPostProcess\";\r\n }\r\n\r\n declare protected _effectWrapper: ThinSharpenPostProcess;\r\n\r\n /**\r\n * Creates a new instance ConvolutionPostProcess\r\n * @param name The name of the effect.\r\n * @param options The required width/height ratio to downsize to before computing the render pass.\r\n * @param camera The camera to apply the render pass to.\r\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\r\n * @param engine The engine which the post process will be applied. (default: current engine)\r\n * @param reusable If the post process can be reused on the same frame. (default: false)\r\n * @param textureType Type of textures used when performing the post process. (default: 0)\r\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\r\n */\r\n constructor(\r\n name: string,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode?: number,\r\n engine?: AbstractEngine,\r\n reusable?: boolean,\r\n textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE,\r\n blockCompilation = false\r\n ) {\r\n const localOptions = {\r\n uniforms: ThinSharpenPostProcess.Uniforms,\r\n size: typeof options === \"number\" ? options : undefined,\r\n camera,\r\n samplingMode,\r\n engine,\r\n reusable,\r\n textureType,\r\n blockCompilation,\r\n ...(options as PostProcessOptions),\r\n };\r\n\r\n super(name, ThinSharpenPostProcess.FragmentUrl, {\r\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinSharpenPostProcess(name, engine, localOptions) : undefined,\r\n ...localOptions,\r\n });\r\n\r\n this.onApply = (_effect: Effect) => {\r\n this._effectWrapper.textureWidth = this.width;\r\n this._effectWrapper.textureHeight = this.height;\r\n };\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static override _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string) {\r\n return SerializationHelper.Parse(\r\n () => {\r\n return new SharpenPostProcess(\r\n parsedPostProcess.name,\r\n parsedPostProcess.options,\r\n targetCamera,\r\n parsedPostProcess.renderTargetSamplingMode,\r\n scene.getEngine(),\r\n parsedPostProcess.reusable,\r\n parsedPostProcess.textureType\r\n );\r\n },\r\n parsedPostProcess,\r\n scene,\r\n rootUrl\r\n );\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for sharpenPostProcess.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterSharpenPostProcess(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.SharpenPostProcess\", SharpenPostProcess);\r\n}\r\n"]}
|
|
@@ -14,7 +14,33 @@ export interface ThinImageProcessingPostProcessOptions extends EffectWrapperCrea
|
|
|
14
14
|
* If not provided, the last created scene will be used.
|
|
15
15
|
*/
|
|
16
16
|
scene?: Nullable<Scene>;
|
|
17
|
+
/**
|
|
18
|
+
* The correlated color temperature, in Kelvin, of the illuminant to neutralize via white balance, applied to
|
|
19
|
+
* the resolved image processing configuration - see `ImageProcessingConfiguration.temperature`. Providing
|
|
20
|
+
* this (or `tint`) also enables white balance. Defaults to 6500 K.
|
|
21
|
+
*/
|
|
22
|
+
temperature?: number;
|
|
23
|
+
/**
|
|
24
|
+
* The white balance tint offset to apply, on the green/magenta axis, to the resolved image processing
|
|
25
|
+
* configuration - see `ImageProcessingConfiguration.tint`. Providing this (or `temperature`) also enables
|
|
26
|
+
* white balance. Defaults to 0 (no tint offset).
|
|
27
|
+
*/
|
|
28
|
+
tint?: number;
|
|
17
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Applies the `temperature`/`tint` white balance options (if provided) to an image processing configuration,
|
|
32
|
+
* enabling white balance if either was supplied. Exported (but internal) so it can be applied uniformly
|
|
33
|
+
* regardless of how the configuration was resolved - in particular, `ImageProcessingPostProcess` also calls this
|
|
34
|
+
* directly on `this.imageProcessingConfiguration` after construction, since a caller-supplied `effectWrapper`
|
|
35
|
+
* bypasses `ThinImageProcessingPostProcess`'s own constructor (and thus its own call to this function) entirely.
|
|
36
|
+
* @param configuration the image processing configuration to update
|
|
37
|
+
* @param options the options object that may contain `temperature`/`tint`, or a plain size number (ignored)
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare function _ApplyWhiteBalanceOptions(configuration: ImageProcessingConfiguration, options?: {
|
|
41
|
+
temperature?: number;
|
|
42
|
+
tint?: number;
|
|
43
|
+
} | number): void;
|
|
18
44
|
/**
|
|
19
45
|
* Post process used to apply image processing to a scene
|
|
20
46
|
*/
|
|
@@ -112,6 +138,30 @@ export declare class ThinImageProcessingPostProcess extends EffectWrapper {
|
|
|
112
138
|
* Sets contrast used in the effect.
|
|
113
139
|
*/
|
|
114
140
|
set contrast(value: number);
|
|
141
|
+
/**
|
|
142
|
+
* Gets whether the white balance effect is enabled.
|
|
143
|
+
*/
|
|
144
|
+
get whiteBalanceEnabled(): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Sets whether the white balance effect is enabled.
|
|
147
|
+
*/
|
|
148
|
+
set whiteBalanceEnabled(value: boolean);
|
|
149
|
+
/**
|
|
150
|
+
* Gets the white balance correlated color temperature, in Kelvin, used in the effect.
|
|
151
|
+
*/
|
|
152
|
+
get temperature(): number;
|
|
153
|
+
/**
|
|
154
|
+
* Sets the white balance correlated color temperature, in Kelvin, used in the effect.
|
|
155
|
+
*/
|
|
156
|
+
set temperature(value: number);
|
|
157
|
+
/**
|
|
158
|
+
* Gets the white balance tint offset used in the effect.
|
|
159
|
+
*/
|
|
160
|
+
get tint(): number;
|
|
161
|
+
/**
|
|
162
|
+
* Sets the white balance tint offset used in the effect.
|
|
163
|
+
*/
|
|
164
|
+
set tint(value: number);
|
|
115
165
|
/**
|
|
116
166
|
* Gets Vignette stretch size.
|
|
117
167
|
*/
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { EffectWrapper } from "../Materials/effectRenderer.pure.js";
|
|
2
2
|
import { EngineStore } from "../Engines/engineStore.js";
|
|
3
3
|
import { ImageProcessingConfiguration } from "../Materials/imageProcessingConfiguration.pure.js";
|
|
4
|
+
/**
|
|
5
|
+
* Applies the `temperature`/`tint` white balance options (if provided) to an image processing configuration,
|
|
6
|
+
* enabling white balance if either was supplied. Exported (but internal) so it can be applied uniformly
|
|
7
|
+
* regardless of how the configuration was resolved - in particular, `ImageProcessingPostProcess` also calls this
|
|
8
|
+
* directly on `this.imageProcessingConfiguration` after construction, since a caller-supplied `effectWrapper`
|
|
9
|
+
* bypasses `ThinImageProcessingPostProcess`'s own constructor (and thus its own call to this function) entirely.
|
|
10
|
+
* @param configuration the image processing configuration to update
|
|
11
|
+
* @param options the options object that may contain `temperature`/`tint`, or a plain size number (ignored)
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
15
|
+
export function _ApplyWhiteBalanceOptions(configuration, options) {
|
|
16
|
+
if (!options || typeof options === "number") {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (options.temperature === undefined && options.tint === undefined) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (options.temperature !== undefined) {
|
|
23
|
+
configuration.temperature = options.temperature;
|
|
24
|
+
}
|
|
25
|
+
if (options.tint !== undefined) {
|
|
26
|
+
configuration.tint = options.tint;
|
|
27
|
+
}
|
|
28
|
+
configuration.whiteBalanceEnabled = true;
|
|
29
|
+
}
|
|
4
30
|
/**
|
|
5
31
|
* Post process used to apply image processing to a scene
|
|
6
32
|
*/
|
|
@@ -174,6 +200,42 @@ export class ThinImageProcessingPostProcess extends EffectWrapper {
|
|
|
174
200
|
set contrast(value) {
|
|
175
201
|
this.imageProcessingConfiguration.contrast = value;
|
|
176
202
|
}
|
|
203
|
+
/**
|
|
204
|
+
* Gets whether the white balance effect is enabled.
|
|
205
|
+
*/
|
|
206
|
+
get whiteBalanceEnabled() {
|
|
207
|
+
return this.imageProcessingConfiguration.whiteBalanceEnabled;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Sets whether the white balance effect is enabled.
|
|
211
|
+
*/
|
|
212
|
+
set whiteBalanceEnabled(value) {
|
|
213
|
+
this.imageProcessingConfiguration.whiteBalanceEnabled = value;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Gets the white balance correlated color temperature, in Kelvin, used in the effect.
|
|
217
|
+
*/
|
|
218
|
+
get temperature() {
|
|
219
|
+
return this.imageProcessingConfiguration.temperature;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Sets the white balance correlated color temperature, in Kelvin, used in the effect.
|
|
223
|
+
*/
|
|
224
|
+
set temperature(value) {
|
|
225
|
+
this.imageProcessingConfiguration.temperature = value;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Gets the white balance tint offset used in the effect.
|
|
229
|
+
*/
|
|
230
|
+
get tint() {
|
|
231
|
+
return this.imageProcessingConfiguration.tint;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Sets the white balance tint offset used in the effect.
|
|
235
|
+
*/
|
|
236
|
+
set tint(value) {
|
|
237
|
+
this.imageProcessingConfiguration.tint = value;
|
|
238
|
+
}
|
|
177
239
|
/**
|
|
178
240
|
* Gets Vignette stretch size.
|
|
179
241
|
*/
|
|
@@ -379,6 +441,7 @@ export class ThinImageProcessingPostProcess extends EffectWrapper {
|
|
|
379
441
|
*/
|
|
380
442
|
this._defines = {
|
|
381
443
|
IMAGEPROCESSING: false,
|
|
444
|
+
WHITEBALANCE: false,
|
|
382
445
|
VIGNETTE: false,
|
|
383
446
|
VIGNETTEBLENDMODEMULTIPLY: false,
|
|
384
447
|
VIGNETTEBLENDMODEOPAQUE: false,
|
|
@@ -401,12 +464,14 @@ export class ThinImageProcessingPostProcess extends EffectWrapper {
|
|
|
401
464
|
if (imageProcessingConfiguration) {
|
|
402
465
|
imageProcessingConfiguration.applyByPostProcess = true;
|
|
403
466
|
this._attachImageProcessingConfiguration(imageProcessingConfiguration, true);
|
|
467
|
+
_ApplyWhiteBalanceOptions(this.imageProcessingConfiguration, options);
|
|
404
468
|
// This will cause the shader to be compiled
|
|
405
469
|
this._updateParameters();
|
|
406
470
|
}
|
|
407
471
|
// Setup the default processing configuration to the scene.
|
|
408
472
|
else {
|
|
409
473
|
this._attachImageProcessingConfiguration(null, true);
|
|
474
|
+
_ApplyWhiteBalanceOptions(this.imageProcessingConfiguration, options);
|
|
410
475
|
this.imageProcessingConfiguration.applyByPostProcess = true;
|
|
411
476
|
}
|
|
412
477
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thinImageProcessingPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinImageProcessingPostProcess.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAmB9F;;GAEG;AACH,MAAM,OAAO,8BAA+B,SAAQ,aAAa;IAM1C,cAAc,CAAC,SAAkB,EAAE,IAAoB;QACtE,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,yCAAyC,CAAC,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACJ,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EAAE,CAAC;YAC/B,4BAA4B,CAAC,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtE,4BAA4B,CAAC,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1E,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACnD,CAAC;IAEe,IAAI,CAAC,iBAAiB,GAAG,KAAK;QAC1C,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC9B,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAClF,CAAC;IAEe,OAAO;QACnB,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,IAAI,IAAI,CAAC,6BAA6B,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YACtE,IAAI,CAAC,6BAA6B,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAChG,CAAC;QAED,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;YACrC,IAAI,CAAC,4BAA4B,CAAC,kBAAkB,GAAG,KAAK,CAAC;QACjE,CAAC;IACL,CAAC;;AAjgBD;;GAEG;AACoB,0CAAW,GAAG,iBAAiB,AAApB,CAAqB","sourcesContent":["import {\r\n type Nullable,\r\n type AbstractEngine,\r\n type EffectWrapperCreationOptions,\r\n type Observer,\r\n type NonNullableFields,\r\n type Scene,\r\n type ColorCurves,\r\n type BaseTexture,\r\n type Color4,\r\n} from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer.pure\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { type IImageProcessingConfigurationDefines } from \"../Materials/imageProcessingConfiguration.defines\";\r\nimport { ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration.pure\";\r\n\r\n/**\r\n * Options used to create a ThinImageProcessingPostProcessOptions.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ThinImageProcessingPostProcessOptions extends EffectWrapperCreationOptions {\r\n /**\r\n * An existing image processing configuration to use. If not provided, the scene one will be used.\r\n */\r\n imageProcessingConfiguration?: ImageProcessingConfiguration;\r\n\r\n /**\r\n * The scene to retrieve the image processing configuration from if not provided in the options.\r\n * If not provided, the last created scene will be used.\r\n */\r\n scene?: Nullable<Scene>;\r\n}\r\n\r\n/**\r\n * Post process used to apply image processing to a scene\r\n */\r\nexport class ThinImageProcessingPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"imageProcessing\";\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/imageProcessing.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/imageProcessing.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Default configuration related to image processing available in the PBR Material.\r\n */\r\n protected _imageProcessingConfiguration: ImageProcessingConfiguration;\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 // We are almost sure it is applied by post process as\r\n // We are in the post process :-)\r\n value.applyByPostProcess = true;\r\n this._attachImageProcessingConfiguration(value);\r\n }\r\n\r\n /**\r\n * Keep track of the image processing observer to allow dispose and replace.\r\n */\r\n private _imageProcessingObserver: Nullable<Observer<ImageProcessingConfiguration>>;\r\n\r\n /**\r\n * Attaches a new image processing configuration to the PBR Material.\r\n * @param configuration\r\n * @param doNotBuild\r\n */\r\n protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>, doNotBuild = false): void {\r\n if (configuration === this._imageProcessingConfiguration) {\r\n return;\r\n }\r\n\r\n // Detaches observer.\r\n if (this._imageProcessingConfiguration && this._imageProcessingObserver) {\r\n this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);\r\n }\r\n\r\n // Pick the scene configuration if needed.\r\n if (!configuration) {\r\n let scene = this.options.scene;\r\n\r\n if (!scene) {\r\n const engine = this.options.engine;\r\n if (engine && engine.scenes) {\r\n const scenes = engine.scenes;\r\n scene = scenes[scenes.length - 1];\r\n } else {\r\n scene = EngineStore.LastCreatedScene!;\r\n }\r\n }\r\n\r\n if (scene) {\r\n this._imageProcessingConfiguration = scene.imageProcessingConfiguration;\r\n } else {\r\n this._imageProcessingConfiguration = new ImageProcessingConfiguration();\r\n }\r\n } else {\r\n this._imageProcessingConfiguration = configuration;\r\n }\r\n\r\n // Attaches observer.\r\n if (this._imageProcessingConfiguration) {\r\n this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {\r\n this._updateParameters();\r\n });\r\n }\r\n\r\n // Ensure the effect will be rebuilt.\r\n if (!doNotBuild) {\r\n this._updateParameters();\r\n }\r\n }\r\n\r\n /**\r\n * Gets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public get colorCurves(): Nullable<ColorCurves> {\r\n return this.imageProcessingConfiguration.colorCurves;\r\n }\r\n /**\r\n * Sets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public set colorCurves(value: Nullable<ColorCurves>) {\r\n this.imageProcessingConfiguration.colorCurves = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color curves effect is enabled.\r\n */\r\n public get colorCurvesEnabled(): 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 colorCurvesEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorCurvesEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public get colorGradingTexture(): Nullable<BaseTexture> {\r\n return this.imageProcessingConfiguration.colorGradingTexture;\r\n }\r\n /**\r\n * Sets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public set colorGradingTexture(value: Nullable<BaseTexture>) {\r\n this.imageProcessingConfiguration.colorGradingTexture = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public get colorGradingEnabled(): 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 colorGradingEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorGradingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets exposure used in the effect.\r\n */\r\n public get exposure(): number {\r\n return this.imageProcessingConfiguration.exposure;\r\n }\r\n /**\r\n * Sets exposure used in the effect.\r\n */\r\n public set exposure(value: number) {\r\n this.imageProcessingConfiguration.exposure = value;\r\n }\r\n\r\n /**\r\n * Gets whether tonemapping is enabled or not.\r\n */\r\n public get toneMappingEnabled(): 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 toneMappingEnabled(value: boolean) {\r\n this._imageProcessingConfiguration.toneMappingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the type of tone mapping effect.\r\n */\r\n public get toneMappingType(): number {\r\n return this._imageProcessingConfiguration.toneMappingType;\r\n }\r\n /**\r\n * Sets the type of tone mapping effect.\r\n */\r\n public set toneMappingType(value: number) {\r\n this._imageProcessingConfiguration.toneMappingType = value;\r\n }\r\n\r\n /**\r\n * Gets contrast used in the effect.\r\n */\r\n public get contrast(): number {\r\n return this.imageProcessingConfiguration.contrast;\r\n }\r\n /**\r\n * Sets contrast used in the effect.\r\n */\r\n public set contrast(value: number) {\r\n this.imageProcessingConfiguration.contrast = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette stretch size.\r\n */\r\n public get vignetteStretch(): number {\r\n return this.imageProcessingConfiguration.vignetteStretch;\r\n }\r\n /**\r\n * Sets Vignette stretch size.\r\n */\r\n public set vignetteStretch(value: number) {\r\n this.imageProcessingConfiguration.vignetteStretch = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public get vignetteCentreX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n /**\r\n * Sets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public set vignetteCentreX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public get vignetteCentreY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n /**\r\n * Sets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public set vignetteCentreY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center Y Offset.\r\n */\r\n public get vignetteCenterY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n public set vignetteCenterY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center X Offset.\r\n */\r\n public get vignetteCenterX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n public set vignetteCenterX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette weight or intensity of the vignette effect.\r\n */\r\n public get vignetteWeight(): number {\r\n return this.imageProcessingConfiguration.vignetteWeight;\r\n }\r\n /**\r\n * Sets Vignette weight or intensity of the vignette effect.\r\n */\r\n public set vignetteWeight(value: number) {\r\n this.imageProcessingConfiguration.vignetteWeight = value;\r\n }\r\n\r\n /**\r\n * Gets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public get vignetteColor(): Color4 {\r\n return this.imageProcessingConfiguration.vignetteColor;\r\n }\r\n /**\r\n * Sets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public set vignetteColor(value: Color4) {\r\n this.imageProcessingConfiguration.vignetteColor = value;\r\n }\r\n\r\n /**\r\n * Gets Camera field of view used by the Vignette effect.\r\n */\r\n public get vignetteCameraFov(): number {\r\n return this.imageProcessingConfiguration.vignetteCameraFov;\r\n }\r\n /**\r\n * Sets Camera field of view used by the Vignette effect.\r\n */\r\n public set vignetteCameraFov(value: number) {\r\n this.imageProcessingConfiguration.vignetteCameraFov = value;\r\n }\r\n\r\n /**\r\n * Gets the vignette blend mode allowing different kind of effect.\r\n */\r\n public get vignetteBlendMode(): number {\r\n return this.imageProcessingConfiguration.vignetteBlendMode;\r\n }\r\n /**\r\n * Sets the vignette blend mode allowing different kind of effect.\r\n */\r\n public set vignetteBlendMode(value: number) {\r\n this.imageProcessingConfiguration.vignetteBlendMode = value;\r\n }\r\n\r\n /**\r\n * Gets whether the vignette effect is enabled.\r\n */\r\n public get vignetteEnabled(): boolean {\r\n return this.imageProcessingConfiguration.vignetteEnabled;\r\n }\r\n /**\r\n * Sets whether the vignette effect is enabled.\r\n */\r\n public set vignetteEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.vignetteEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets intensity of the dithering effect.\r\n */\r\n public get ditheringIntensity(): number {\r\n return this.imageProcessingConfiguration.ditheringIntensity;\r\n }\r\n /**\r\n * Sets intensity of the dithering effect.\r\n */\r\n public set ditheringIntensity(value: number) {\r\n this.imageProcessingConfiguration.ditheringIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets whether the dithering effect is enabled.\r\n */\r\n public get ditheringEnabled(): boolean {\r\n return this.imageProcessingConfiguration.ditheringEnabled;\r\n }\r\n /**\r\n * Sets whether the dithering effect is enabled.\r\n */\r\n public set ditheringEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.ditheringEnabled = value;\r\n }\r\n\r\n private _fromLinearSpace = true;\r\n /**\r\n * Gets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n public get fromLinearSpace(): boolean {\r\n return this._fromLinearSpace;\r\n }\r\n /**\r\n * Sets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n public set fromLinearSpace(value: boolean) {\r\n if (this._fromLinearSpace === value) {\r\n return;\r\n }\r\n\r\n this._fromLinearSpace = value;\r\n this._updateParameters();\r\n }\r\n\r\n /**\r\n * * Gets the width of the output texture used to store the result of the post process.\r\n */\r\n public get outputTextureWidth() {\r\n return this.imageProcessingConfiguration.outputTextureWidth;\r\n }\r\n\r\n /**\r\n * * Sets the width of the output texture used to store the result of the post process.\r\n */\r\n public set outputTextureWidth(value: number) {\r\n this.imageProcessingConfiguration.outputTextureWidth = value;\r\n }\r\n\r\n /**\r\n * * Gets the height of the output texture used to store the result of the post process.\r\n */\r\n public get outputTextureHeight() {\r\n return this.imageProcessingConfiguration.outputTextureHeight;\r\n }\r\n\r\n /**\r\n * * Sets the height of the output texture used to store the result of the post process.\r\n */\r\n public set outputTextureHeight(value: number) {\r\n this.imageProcessingConfiguration.outputTextureHeight = value;\r\n }\r\n\r\n /**\r\n * Gets/sets the aspect ratio used to override the default one.\r\n */\r\n public overrideAspectRatio?: number;\r\n\r\n /**\r\n * Defines cache preventing GC.\r\n */\r\n private _defines: IImageProcessingConfigurationDefines & { FROMLINEARSPACE: boolean } = {\r\n IMAGEPROCESSING: false,\r\n VIGNETTE: false,\r\n VIGNETTEBLENDMODEMULTIPLY: false,\r\n VIGNETTEBLENDMODEOPAQUE: false,\r\n TONEMAPPING: 0,\r\n CONTRAST: false,\r\n COLORCURVES: false,\r\n COLORGRADING: false,\r\n COLORGRADING3D: false,\r\n FROMLINEARSPACE: false,\r\n SAMPLER3DGREENDEPTH: false,\r\n SAMPLER3DBGRMAP: false,\r\n DITHER: false,\r\n IMAGEPROCESSINGPOSTPROCESS: false,\r\n EXPOSURE: false,\r\n SKIPFINALCOLORCLAMP: false,\r\n };\r\n\r\n public override readonly options: Required<NonNullableFields<ThinImageProcessingPostProcessOptions>>;\r\n\r\n /**\r\n * Constructs a new image processing post process\r\n * @param name Name of the effect\r\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\r\n * @param options Options to configure the effect\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: ThinImageProcessingPostProcessOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || EngineStore.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinImageProcessingPostProcess.FragmentUrl,\r\n });\r\n\r\n const imageProcessingConfiguration = options?.imageProcessingConfiguration;\r\n\r\n // Setup the configuration as forced by the constructor. This would then not force the\r\n // scene materials output in linear space and let untouched the default forward pass.\r\n if (imageProcessingConfiguration) {\r\n imageProcessingConfiguration.applyByPostProcess = true;\r\n this._attachImageProcessingConfiguration(imageProcessingConfiguration, true);\r\n // This will cause the shader to be compiled\r\n this._updateParameters();\r\n }\r\n // Setup the default processing configuration to the scene.\r\n else {\r\n this._attachImageProcessingConfiguration(null, true);\r\n this.imageProcessingConfiguration.applyByPostProcess = true;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateParameters(): void {\r\n this._defines.FROMLINEARSPACE = this._fromLinearSpace;\r\n this.imageProcessingConfiguration.prepareDefines(this._defines, true);\r\n let defines = \"\";\r\n for (const prop in this._defines) {\r\n const value = (<any>this._defines)[prop];\r\n const type = typeof value;\r\n\r\n switch (type) {\r\n case \"number\":\r\n case \"string\":\r\n defines += `#define ${prop} ${value};\\n`;\r\n break;\r\n default:\r\n if (value) {\r\n defines += `#define ${prop};\\n`;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n const samplers = [\"textureSampler\"];\r\n const uniforms = [\"scale\"];\r\n\r\n if (ImageProcessingConfiguration) {\r\n ImageProcessingConfiguration.PrepareSamplers(samplers, this._defines);\r\n ImageProcessingConfiguration.PrepareUniforms(uniforms, this._defines);\r\n }\r\n\r\n this.updateEffect(defines, uniforms, samplers);\r\n }\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n this.imageProcessingConfiguration.bind(this.effect, this.overrideAspectRatio);\r\n }\r\n\r\n public override dispose(): void {\r\n super.dispose();\r\n\r\n if (this._imageProcessingConfiguration && this._imageProcessingObserver) {\r\n this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);\r\n }\r\n\r\n if (this._imageProcessingConfiguration) {\r\n this.imageProcessingConfiguration.applyByPostProcess = false;\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"thinImageProcessingPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinImageProcessingPostProcess.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAiC9F;;;;;;;;;GASG;AACH,gEAAgE;AAChE,MAAM,UAAU,yBAAyB,CAAC,aAA2C,EAAE,OAA0D;IAC7I,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO;IACX,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAClE,OAAO;IACX,CAAC;IAED,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QACpC,aAAa,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAA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YAC/B,4BAA4B,CAAC,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtE,4BAA4B,CAAC,eAAe,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1E,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACnD,CAAC;IAEe,IAAI,CAAC,iBAAiB,GAAG,KAAK;QAC1C,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC9B,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAClF,CAAC;IAEe,OAAO;QACnB,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,IAAI,IAAI,CAAC,6BAA6B,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YACtE,IAAI,CAAC,6BAA6B,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAChG,CAAC;QAED,IAAI,IAAI,CAAC,6BAA6B,EAAE,CAAC;YACrC,IAAI,CAAC,4BAA4B,CAAC,kBAAkB,GAAG,KAAK,CAAC;QACjE,CAAC;IACL,CAAC;;AA3iBD;;GAEG;AACoB,0CAAW,GAAG,iBAAiB,AAApB,CAAqB","sourcesContent":["import {\r\n type Nullable,\r\n type AbstractEngine,\r\n type EffectWrapperCreationOptions,\r\n type Observer,\r\n type NonNullableFields,\r\n type Scene,\r\n type ColorCurves,\r\n type BaseTexture,\r\n type Color4,\r\n} from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer.pure\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport { type IImageProcessingConfigurationDefines } from \"../Materials/imageProcessingConfiguration.defines\";\r\nimport { ImageProcessingConfiguration } from \"../Materials/imageProcessingConfiguration.pure\";\r\n\r\n/**\r\n * Options used to create a ThinImageProcessingPostProcessOptions.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport interface ThinImageProcessingPostProcessOptions extends EffectWrapperCreationOptions {\r\n /**\r\n * An existing image processing configuration to use. If not provided, the scene one will be used.\r\n */\r\n imageProcessingConfiguration?: ImageProcessingConfiguration;\r\n\r\n /**\r\n * The scene to retrieve the image processing configuration from if not provided in the options.\r\n * If not provided, the last created scene will be used.\r\n */\r\n scene?: Nullable<Scene>;\r\n\r\n /**\r\n * The correlated color temperature, in Kelvin, of the illuminant to neutralize via white balance, applied to\r\n * the resolved image processing configuration - see `ImageProcessingConfiguration.temperature`. Providing\r\n * this (or `tint`) also enables white balance. Defaults to 6500 K.\r\n */\r\n temperature?: number;\r\n\r\n /**\r\n * The white balance tint offset to apply, on the green/magenta axis, to the resolved image processing\r\n * configuration - see `ImageProcessingConfiguration.tint`. Providing this (or `temperature`) also enables\r\n * white balance. Defaults to 0 (no tint offset).\r\n */\r\n tint?: number;\r\n}\r\n\r\n/**\r\n * Applies the `temperature`/`tint` white balance options (if provided) to an image processing configuration,\r\n * enabling white balance if either was supplied. Exported (but internal) so it can be applied uniformly\r\n * regardless of how the configuration was resolved - in particular, `ImageProcessingPostProcess` also calls this\r\n * directly on `this.imageProcessingConfiguration` after construction, since a caller-supplied `effectWrapper`\r\n * bypasses `ThinImageProcessingPostProcess`'s own constructor (and thus its own call to this function) entirely.\r\n * @param configuration the image processing configuration to update\r\n * @param options the options object that may contain `temperature`/`tint`, or a plain size number (ignored)\r\n * @internal\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function _ApplyWhiteBalanceOptions(configuration: ImageProcessingConfiguration, options?: { temperature?: number; tint?: number } | number): void {\r\n if (!options || typeof options === \"number\") {\r\n return;\r\n }\r\n\r\n if (options.temperature === undefined && options.tint === undefined) {\r\n return;\r\n }\r\n\r\n if (options.temperature !== undefined) {\r\n configuration.temperature = options.temperature;\r\n }\r\n if (options.tint !== undefined) {\r\n configuration.tint = options.tint;\r\n }\r\n configuration.whiteBalanceEnabled = true;\r\n}\r\n\r\n/**\r\n * Post process used to apply image processing to a scene\r\n */\r\nexport class ThinImageProcessingPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"imageProcessing\";\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/imageProcessing.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/imageProcessing.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Default configuration related to image processing available in the PBR Material.\r\n */\r\n protected _imageProcessingConfiguration: ImageProcessingConfiguration;\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 // We are almost sure it is applied by post process as\r\n // We are in the post process :-)\r\n value.applyByPostProcess = true;\r\n this._attachImageProcessingConfiguration(value);\r\n }\r\n\r\n /**\r\n * Keep track of the image processing observer to allow dispose and replace.\r\n */\r\n private _imageProcessingObserver: Nullable<Observer<ImageProcessingConfiguration>>;\r\n\r\n /**\r\n * Attaches a new image processing configuration to the PBR Material.\r\n * @param configuration\r\n * @param doNotBuild\r\n */\r\n protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>, doNotBuild = false): void {\r\n if (configuration === this._imageProcessingConfiguration) {\r\n return;\r\n }\r\n\r\n // Detaches observer.\r\n if (this._imageProcessingConfiguration && this._imageProcessingObserver) {\r\n this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);\r\n }\r\n\r\n // Pick the scene configuration if needed.\r\n if (!configuration) {\r\n let scene = this.options.scene;\r\n\r\n if (!scene) {\r\n const engine = this.options.engine;\r\n if (engine && engine.scenes) {\r\n const scenes = engine.scenes;\r\n scene = scenes[scenes.length - 1];\r\n } else {\r\n scene = EngineStore.LastCreatedScene!;\r\n }\r\n }\r\n\r\n if (scene) {\r\n this._imageProcessingConfiguration = scene.imageProcessingConfiguration;\r\n } else {\r\n this._imageProcessingConfiguration = new ImageProcessingConfiguration();\r\n }\r\n } else {\r\n this._imageProcessingConfiguration = configuration;\r\n }\r\n\r\n // Attaches observer.\r\n if (this._imageProcessingConfiguration) {\r\n this._imageProcessingObserver = this._imageProcessingConfiguration.onUpdateParameters.add(() => {\r\n this._updateParameters();\r\n });\r\n }\r\n\r\n // Ensure the effect will be rebuilt.\r\n if (!doNotBuild) {\r\n this._updateParameters();\r\n }\r\n }\r\n\r\n /**\r\n * Gets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public get colorCurves(): Nullable<ColorCurves> {\r\n return this.imageProcessingConfiguration.colorCurves;\r\n }\r\n /**\r\n * Sets Color curves setup used in the effect if colorCurvesEnabled is set to true .\r\n */\r\n public set colorCurves(value: Nullable<ColorCurves>) {\r\n this.imageProcessingConfiguration.colorCurves = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color curves effect is enabled.\r\n */\r\n public get colorCurvesEnabled(): 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 colorCurvesEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorCurvesEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public get colorGradingTexture(): Nullable<BaseTexture> {\r\n return this.imageProcessingConfiguration.colorGradingTexture;\r\n }\r\n /**\r\n * Sets Color grading LUT texture used in the effect if colorGradingEnabled is set to true.\r\n */\r\n public set colorGradingTexture(value: Nullable<BaseTexture>) {\r\n this.imageProcessingConfiguration.colorGradingTexture = value;\r\n }\r\n\r\n /**\r\n * Gets whether the color grading effect is enabled.\r\n */\r\n public get colorGradingEnabled(): 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 colorGradingEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.colorGradingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets exposure used in the effect.\r\n */\r\n public get exposure(): number {\r\n return this.imageProcessingConfiguration.exposure;\r\n }\r\n /**\r\n * Sets exposure used in the effect.\r\n */\r\n public set exposure(value: number) {\r\n this.imageProcessingConfiguration.exposure = value;\r\n }\r\n\r\n /**\r\n * Gets whether tonemapping is enabled or not.\r\n */\r\n public get toneMappingEnabled(): 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 toneMappingEnabled(value: boolean) {\r\n this._imageProcessingConfiguration.toneMappingEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the type of tone mapping effect.\r\n */\r\n public get toneMappingType(): number {\r\n return this._imageProcessingConfiguration.toneMappingType;\r\n }\r\n /**\r\n * Sets the type of tone mapping effect.\r\n */\r\n public set toneMappingType(value: number) {\r\n this._imageProcessingConfiguration.toneMappingType = value;\r\n }\r\n\r\n /**\r\n * Gets contrast used in the effect.\r\n */\r\n public get contrast(): number {\r\n return this.imageProcessingConfiguration.contrast;\r\n }\r\n /**\r\n * Sets contrast used in the effect.\r\n */\r\n public set contrast(value: number) {\r\n this.imageProcessingConfiguration.contrast = value;\r\n }\r\n\r\n /**\r\n * Gets whether the white balance effect is enabled.\r\n */\r\n public get whiteBalanceEnabled(): boolean {\r\n return this.imageProcessingConfiguration.whiteBalanceEnabled;\r\n }\r\n /**\r\n * Sets whether the white balance effect is enabled.\r\n */\r\n public set whiteBalanceEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.whiteBalanceEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets the white balance correlated color temperature, in Kelvin, used in the effect.\r\n */\r\n public get temperature(): number {\r\n return this.imageProcessingConfiguration.temperature;\r\n }\r\n /**\r\n * Sets the white balance correlated color temperature, in Kelvin, used in the effect.\r\n */\r\n public set temperature(value: number) {\r\n this.imageProcessingConfiguration.temperature = value;\r\n }\r\n\r\n /**\r\n * Gets the white balance tint offset used in the effect.\r\n */\r\n public get tint(): number {\r\n return this.imageProcessingConfiguration.tint;\r\n }\r\n /**\r\n * Sets the white balance tint offset used in the effect.\r\n */\r\n public set tint(value: number) {\r\n this.imageProcessingConfiguration.tint = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette stretch size.\r\n */\r\n public get vignetteStretch(): number {\r\n return this.imageProcessingConfiguration.vignetteStretch;\r\n }\r\n /**\r\n * Sets Vignette stretch size.\r\n */\r\n public set vignetteStretch(value: number) {\r\n this.imageProcessingConfiguration.vignetteStretch = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public get vignetteCentreX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n /**\r\n * Sets Vignette center X Offset.\r\n * @deprecated use vignetteCenterX instead\r\n */\r\n public set vignetteCentreX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public get vignetteCentreY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n /**\r\n * Sets Vignette center Y Offset.\r\n * @deprecated use vignetteCenterY instead\r\n */\r\n public set vignetteCentreY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center Y Offset.\r\n */\r\n public get vignetteCenterY(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterY;\r\n }\r\n public set vignetteCenterY(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterY = value;\r\n }\r\n\r\n /**\r\n * Vignette center X Offset.\r\n */\r\n public get vignetteCenterX(): number {\r\n return this.imageProcessingConfiguration.vignetteCenterX;\r\n }\r\n public set vignetteCenterX(value: number) {\r\n this.imageProcessingConfiguration.vignetteCenterX = value;\r\n }\r\n\r\n /**\r\n * Gets Vignette weight or intensity of the vignette effect.\r\n */\r\n public get vignetteWeight(): number {\r\n return this.imageProcessingConfiguration.vignetteWeight;\r\n }\r\n /**\r\n * Sets Vignette weight or intensity of the vignette effect.\r\n */\r\n public set vignetteWeight(value: number) {\r\n this.imageProcessingConfiguration.vignetteWeight = value;\r\n }\r\n\r\n /**\r\n * Gets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public get vignetteColor(): Color4 {\r\n return this.imageProcessingConfiguration.vignetteColor;\r\n }\r\n /**\r\n * Sets Color of the vignette applied on the screen through the chosen blend mode (vignetteBlendMode)\r\n * if vignetteEnabled is set to true.\r\n */\r\n public set vignetteColor(value: Color4) {\r\n this.imageProcessingConfiguration.vignetteColor = value;\r\n }\r\n\r\n /**\r\n * Gets Camera field of view used by the Vignette effect.\r\n */\r\n public get vignetteCameraFov(): number {\r\n return this.imageProcessingConfiguration.vignetteCameraFov;\r\n }\r\n /**\r\n * Sets Camera field of view used by the Vignette effect.\r\n */\r\n public set vignetteCameraFov(value: number) {\r\n this.imageProcessingConfiguration.vignetteCameraFov = value;\r\n }\r\n\r\n /**\r\n * Gets the vignette blend mode allowing different kind of effect.\r\n */\r\n public get vignetteBlendMode(): number {\r\n return this.imageProcessingConfiguration.vignetteBlendMode;\r\n }\r\n /**\r\n * Sets the vignette blend mode allowing different kind of effect.\r\n */\r\n public set vignetteBlendMode(value: number) {\r\n this.imageProcessingConfiguration.vignetteBlendMode = value;\r\n }\r\n\r\n /**\r\n * Gets whether the vignette effect is enabled.\r\n */\r\n public get vignetteEnabled(): boolean {\r\n return this.imageProcessingConfiguration.vignetteEnabled;\r\n }\r\n /**\r\n * Sets whether the vignette effect is enabled.\r\n */\r\n public set vignetteEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.vignetteEnabled = value;\r\n }\r\n\r\n /**\r\n * Gets intensity of the dithering effect.\r\n */\r\n public get ditheringIntensity(): number {\r\n return this.imageProcessingConfiguration.ditheringIntensity;\r\n }\r\n /**\r\n * Sets intensity of the dithering effect.\r\n */\r\n public set ditheringIntensity(value: number) {\r\n this.imageProcessingConfiguration.ditheringIntensity = value;\r\n }\r\n\r\n /**\r\n * Gets whether the dithering effect is enabled.\r\n */\r\n public get ditheringEnabled(): boolean {\r\n return this.imageProcessingConfiguration.ditheringEnabled;\r\n }\r\n /**\r\n * Sets whether the dithering effect is enabled.\r\n */\r\n public set ditheringEnabled(value: boolean) {\r\n this.imageProcessingConfiguration.ditheringEnabled = value;\r\n }\r\n\r\n private _fromLinearSpace = true;\r\n /**\r\n * Gets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n public get fromLinearSpace(): boolean {\r\n return this._fromLinearSpace;\r\n }\r\n /**\r\n * Sets whether the input of the processing is in Gamma or Linear Space.\r\n */\r\n public set fromLinearSpace(value: boolean) {\r\n if (this._fromLinearSpace === value) {\r\n return;\r\n }\r\n\r\n this._fromLinearSpace = value;\r\n this._updateParameters();\r\n }\r\n\r\n /**\r\n * * Gets the width of the output texture used to store the result of the post process.\r\n */\r\n public get outputTextureWidth() {\r\n return this.imageProcessingConfiguration.outputTextureWidth;\r\n }\r\n\r\n /**\r\n * * Sets the width of the output texture used to store the result of the post process.\r\n */\r\n public set outputTextureWidth(value: number) {\r\n this.imageProcessingConfiguration.outputTextureWidth = value;\r\n }\r\n\r\n /**\r\n * * Gets the height of the output texture used to store the result of the post process.\r\n */\r\n public get outputTextureHeight() {\r\n return this.imageProcessingConfiguration.outputTextureHeight;\r\n }\r\n\r\n /**\r\n * * Sets the height of the output texture used to store the result of the post process.\r\n */\r\n public set outputTextureHeight(value: number) {\r\n this.imageProcessingConfiguration.outputTextureHeight = value;\r\n }\r\n\r\n /**\r\n * Gets/sets the aspect ratio used to override the default one.\r\n */\r\n public overrideAspectRatio?: number;\r\n\r\n /**\r\n * Defines cache preventing GC.\r\n */\r\n private _defines: IImageProcessingConfigurationDefines & { FROMLINEARSPACE: boolean } = {\r\n IMAGEPROCESSING: false,\r\n WHITEBALANCE: false,\r\n VIGNETTE: false,\r\n VIGNETTEBLENDMODEMULTIPLY: false,\r\n VIGNETTEBLENDMODEOPAQUE: false,\r\n TONEMAPPING: 0,\r\n CONTRAST: false,\r\n COLORCURVES: false,\r\n COLORGRADING: false,\r\n COLORGRADING3D: false,\r\n FROMLINEARSPACE: false,\r\n SAMPLER3DGREENDEPTH: false,\r\n SAMPLER3DBGRMAP: false,\r\n DITHER: false,\r\n IMAGEPROCESSINGPOSTPROCESS: false,\r\n EXPOSURE: false,\r\n SKIPFINALCOLORCLAMP: false,\r\n };\r\n\r\n public override readonly options: Required<NonNullableFields<ThinImageProcessingPostProcessOptions>>;\r\n\r\n /**\r\n * Constructs a new image processing post process\r\n * @param name Name of the effect\r\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\r\n * @param options Options to configure the effect\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: ThinImageProcessingPostProcessOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || EngineStore.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinImageProcessingPostProcess.FragmentUrl,\r\n });\r\n\r\n const imageProcessingConfiguration = options?.imageProcessingConfiguration;\r\n\r\n // Setup the configuration as forced by the constructor. This would then not force the\r\n // scene materials output in linear space and let untouched the default forward pass.\r\n if (imageProcessingConfiguration) {\r\n imageProcessingConfiguration.applyByPostProcess = true;\r\n this._attachImageProcessingConfiguration(imageProcessingConfiguration, true);\r\n _ApplyWhiteBalanceOptions(this.imageProcessingConfiguration, options);\r\n // This will cause the shader to be compiled\r\n this._updateParameters();\r\n }\r\n // Setup the default processing configuration to the scene.\r\n else {\r\n this._attachImageProcessingConfiguration(null, true);\r\n _ApplyWhiteBalanceOptions(this.imageProcessingConfiguration, options);\r\n this.imageProcessingConfiguration.applyByPostProcess = true;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateParameters(): void {\r\n this._defines.FROMLINEARSPACE = this._fromLinearSpace;\r\n this.imageProcessingConfiguration.prepareDefines(this._defines, true);\r\n let defines = \"\";\r\n for (const prop in this._defines) {\r\n const value = (<any>this._defines)[prop];\r\n const type = typeof value;\r\n\r\n switch (type) {\r\n case \"number\":\r\n case \"string\":\r\n defines += `#define ${prop} ${value};\\n`;\r\n break;\r\n default:\r\n if (value) {\r\n defines += `#define ${prop};\\n`;\r\n }\r\n break;\r\n }\r\n }\r\n\r\n const samplers = [\"textureSampler\"];\r\n const uniforms = [\"scale\"];\r\n\r\n if (ImageProcessingConfiguration) {\r\n ImageProcessingConfiguration.PrepareSamplers(samplers, this._defines);\r\n ImageProcessingConfiguration.PrepareUniforms(uniforms, this._defines);\r\n }\r\n\r\n this.updateEffect(defines, uniforms, samplers);\r\n }\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n this.imageProcessingConfiguration.bind(this.effect, this.overrideAspectRatio);\r\n }\r\n\r\n public override dispose(): void {\r\n super.dispose();\r\n\r\n if (this._imageProcessingConfiguration && this._imageProcessingObserver) {\r\n this._imageProcessingConfiguration.onUpdateParameters.remove(this._imageProcessingObserver);\r\n }\r\n\r\n if (this._imageProcessingConfiguration) {\r\n this.imageProcessingConfiguration.applyByPostProcess = false;\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { type Material } from "../../Materials/material.pure.js";
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether a material can receive IBL shadows by hosting an `IBLShadowsPluginMaterial`.
|
|
5
|
+
*
|
|
6
|
+
* Shared by both the legacy `IblShadowsRenderPipeline` and the Frame Graph
|
|
7
|
+
* `FrameGraphIblShadowsRendererTask` so the two code paths cannot drift out of sync.
|
|
8
|
+
* @param material The material to test.
|
|
9
|
+
* @returns True if the material supports the IBL shadows plugin.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function IsIBLShadowsReceiverCompatible(material: Material): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** This file must only contain pure code and pure imports */
|
|
2
|
+
import { PBRBaseMaterial } from "../../Materials/PBR/pbrBaseMaterial.pure.js";
|
|
3
|
+
import { StandardMaterial } from "../../Materials/standardMaterial.pure.js";
|
|
4
|
+
import { OpenPBRMaterial } from "../../Materials/PBR/openpbrMaterial.pure.js";
|
|
5
|
+
/**
|
|
6
|
+
* Determines whether a material can receive IBL shadows by hosting an `IBLShadowsPluginMaterial`.
|
|
7
|
+
*
|
|
8
|
+
* Shared by both the legacy `IblShadowsRenderPipeline` and the Frame Graph
|
|
9
|
+
* `FrameGraphIblShadowsRendererTask` so the two code paths cannot drift out of sync.
|
|
10
|
+
* @param material The material to test.
|
|
11
|
+
* @returns True if the material supports the IBL shadows plugin.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export function IsIBLShadowsReceiverCompatible(material) {
|
|
15
|
+
return (material instanceof PBRBaseMaterial ||
|
|
16
|
+
material instanceof StandardMaterial ||
|
|
17
|
+
material instanceof OpenPBRMaterial ||
|
|
18
|
+
// ShadowOnlyMaterial lives in the separate `materials` package (which `core` cannot import),
|
|
19
|
+
// so it is identified by class name rather than `instanceof`.
|
|
20
|
+
material.getClassName() === "ShadowOnlyMaterial");
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=iblShadowsMaterialCompatibility.pure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iblShadowsMaterialCompatibility.pure.js","sourceRoot":"","sources":["../../../../../dev/core/src/Rendering/IBLShadows/iblShadowsMaterialCompatibility.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAG7D,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E;;;;;;;;GAQG;AACH,MAAM,UAAU,8BAA8B,CAAC,QAAkB;IAC7D,OAAO,CACH,QAAQ,YAAY,eAAe;QACnC,QAAQ,YAAY,gBAAgB;QACpC,QAAQ,YAAY,eAAe;QACnC,6FAA6F;QAC7F,8DAA8D;QAC9D,QAAQ,CAAC,YAAY,EAAE,KAAK,oBAAoB,CACnD,CAAC;AACN,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\n\nimport { type Material } from \"core/Materials/material.pure\";\nimport { PBRBaseMaterial } from \"core/Materials/PBR/pbrBaseMaterial.pure\";\nimport { StandardMaterial } from \"core/Materials/standardMaterial.pure\";\nimport { OpenPBRMaterial } from \"core/Materials/PBR/openpbrMaterial.pure\";\n\n/**\n * Determines whether a material can receive IBL shadows by hosting an `IBLShadowsPluginMaterial`.\n *\n * Shared by both the legacy `IblShadowsRenderPipeline` and the Frame Graph\n * `FrameGraphIblShadowsRendererTask` so the two code paths cannot drift out of sync.\n * @param material The material to test.\n * @returns True if the material supports the IBL shadows plugin.\n * @internal\n */\nexport function IsIBLShadowsReceiverCompatible(material: Material): boolean {\n return (\n material instanceof PBRBaseMaterial ||\n material instanceof StandardMaterial ||\n material instanceof OpenPBRMaterial ||\n // ShadowOnlyMaterial lives in the separate `materials` package (which `core` cannot import),\n // so it is identified by class name rather than `instanceof`.\n material.getClassName() === \"ShadowOnlyMaterial\"\n );\n}\n"]}
|
|
@@ -50,6 +50,7 @@ export declare class IBLShadowsPluginMaterial extends MaterialPluginBase {
|
|
|
50
50
|
isCompatible(): boolean;
|
|
51
51
|
constructor(material: Material | StandardMaterial | PBRBaseMaterial | OpenPBRMaterial);
|
|
52
52
|
private _isOpenPBRMaterial;
|
|
53
|
+
private _isShadowOnlyMaterial;
|
|
53
54
|
prepareDefines(defines: MaterialIBLShadowsRenderDefines): void;
|
|
54
55
|
getClassName(): string;
|
|
55
56
|
getUniforms(_shaderLanguage: ShaderLanguage): any;
|
|
@@ -80,6 +80,9 @@ let IBLShadowsPluginMaterial = (() => {
|
|
|
80
80
|
_isOpenPBRMaterial() {
|
|
81
81
|
return this._material.getClassName() === "OpenPBRMaterial";
|
|
82
82
|
}
|
|
83
|
+
_isShadowOnlyMaterial() {
|
|
84
|
+
return this._material.getClassName() === "ShadowOnlyMaterial";
|
|
85
|
+
}
|
|
83
86
|
prepareDefines(defines) {
|
|
84
87
|
defines.RENDER_WITH_IBL_SHADOWS = this._isEnabled;
|
|
85
88
|
defines.COLORED_IBL_SHADOWS = this.isColored;
|
|
@@ -197,6 +200,24 @@ let IBLShadowsPluginMaterial = (() => {
|
|
|
197
200
|
ambient_occlusion = min(ambient_occlusion, vec3f(computeIndirectShadow().x));
|
|
198
201
|
#endif
|
|
199
202
|
#endif
|
|
203
|
+
`;
|
|
204
|
+
}
|
|
205
|
+
else if (this._isShadowOnlyMaterial()) {
|
|
206
|
+
// ShadowOnlyMaterial encodes shadow strength in a single alpha channel via the `shadow`
|
|
207
|
+
// scalar, so modulate `shadow` directly rather than color.rgb (which is the -typically
|
|
208
|
+
// black- shadowColor). Because there is only one output channel, IBL shadows on this
|
|
209
|
+
// material are monochrome by contract: a colored shadow value is reduced to its Rec.709
|
|
210
|
+
// luminance rather than preserving per-channel hue (which an alpha-only catcher cannot do).
|
|
211
|
+
frag["CUSTOM_FRAGMENT_BEFORE_LIGHT_COMPOSITION"] = `
|
|
212
|
+
#ifdef RENDER_WITH_IBL_SHADOWS
|
|
213
|
+
#ifdef COLORED_IBL_SHADOWS
|
|
214
|
+
var shadowValue: vec3f = computeIndirectShadow();
|
|
215
|
+
shadow *= clamp(dot(shadowValue, vec3f(0.2126f, 0.7152f, 0.0722f)), 0.0f, 1.0f);
|
|
216
|
+
#else
|
|
217
|
+
var shadowValue: vec2f = computeIndirectShadow();
|
|
218
|
+
shadow *= clamp(shadowValue.x, 0.0f, 1.0f);
|
|
219
|
+
#endif
|
|
220
|
+
#endif
|
|
200
221
|
`;
|
|
201
222
|
}
|
|
202
223
|
else {
|
|
@@ -276,6 +297,24 @@ let IBLShadowsPluginMaterial = (() => {
|
|
|
276
297
|
ambient_occlusion = min(ambient_occlusion, vec3(computeIndirectShadow().x));
|
|
277
298
|
#endif
|
|
278
299
|
#endif
|
|
300
|
+
`;
|
|
301
|
+
}
|
|
302
|
+
else if (this._isShadowOnlyMaterial()) {
|
|
303
|
+
// ShadowOnlyMaterial encodes shadow strength in a single alpha channel via the `shadow`
|
|
304
|
+
// scalar, so modulate `shadow` directly rather than color.rgb (which is the -typically
|
|
305
|
+
// black- shadowColor). Because there is only one output channel, IBL shadows on this
|
|
306
|
+
// material are monochrome by contract: a colored shadow value is reduced to its Rec.709
|
|
307
|
+
// luminance rather than preserving per-channel hue (which an alpha-only catcher cannot do).
|
|
308
|
+
frag["CUSTOM_FRAGMENT_BEFORE_LIGHT_COMPOSITION"] = `
|
|
309
|
+
#ifdef RENDER_WITH_IBL_SHADOWS
|
|
310
|
+
#ifdef COLORED_IBL_SHADOWS
|
|
311
|
+
vec3 shadowValue = computeIndirectShadow();
|
|
312
|
+
shadow *= clamp(dot(shadowValue, vec3(0.2126, 0.7152, 0.0722)), 0.0, 1.0);
|
|
313
|
+
#else
|
|
314
|
+
vec2 shadowValue = computeIndirectShadow();
|
|
315
|
+
shadow *= clamp(shadowValue.x, 0.0, 1.0);
|
|
316
|
+
#endif
|
|
317
|
+
#endif
|
|
279
318
|
`;
|
|
280
319
|
}
|
|
281
320
|
else {
|