@babylonjs/core 5.22.1 → 5.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Actions/abstractActionManager.d.ts +6 -6
- package/Actions/abstractActionManager.js +1 -1
- package/Actions/abstractActionManager.js.map +1 -1
- package/Actions/actionManager.d.ts +5 -5
- package/Actions/actionManager.js +5 -5
- package/Actions/actionManager.js.map +1 -1
- package/Animations/animatable.js +2 -1
- package/Animations/animatable.js.map +1 -1
- package/Animations/animation.js +137 -139
- package/Animations/animation.js.map +1 -1
- package/Animations/animationGroup.d.ts +3 -3
- package/Animations/animationGroup.js +3 -3
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.js +6 -7
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Audio/audioSceneComponent.d.ts +1 -1
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.d.ts +2 -1
- package/Audio/sound.js +21 -9
- package/Audio/sound.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.d.ts +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Cameras/bouncingBehavior.d.ts +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js +1 -1
- package/Behaviors/Cameras/bouncingBehavior.js.map +1 -1
- package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
- package/Behaviors/Cameras/framingBehavior.js +1 -1
- package/Behaviors/Cameras/framingBehavior.js.map +1 -1
- package/Bones/bone.d.ts +1 -1
- package/Bones/bone.js +1 -1
- package/Bones/bone.js.map +1 -1
- package/Bones/skeleton.d.ts +2 -2
- package/Bones/skeleton.js +11 -5
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js +3 -22
- package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/BaseCameraPointersInput.js +3 -3
- package/Cameras/Inputs/BaseCameraPointersInput.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +1 -11
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.js +3 -3
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.js +1 -4
- package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.js +3 -3
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +1 -1
- package/Cameras/arcRotateCamera.js +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +2 -2
- package/Cameras/camera.js +2 -2
- package/Cameras/camera.js.map +1 -1
- package/Cameras/freeCamera.d.ts +1 -1
- package/Cameras/freeCamera.js +1 -1
- package/Cameras/freeCamera.js.map +1 -1
- package/Cameras/gamepadCamera.d.ts +1 -1
- package/Cameras/gamepadCamera.js +1 -1
- package/Cameras/gamepadCamera.js.map +1 -1
- package/Cameras/targetCamera.d.ts +1 -1
- package/Cameras/targetCamera.js +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Cameras/touchCamera.d.ts +1 -1
- package/Cameras/touchCamera.js +1 -1
- package/Cameras/touchCamera.js.map +1 -1
- package/Cameras/universalCamera.d.ts +1 -1
- package/Cameras/universalCamera.js +1 -1
- package/Cameras/universalCamera.js.map +1 -1
- package/Cameras/virtualJoysticksCamera.d.ts +1 -1
- package/Cameras/virtualJoysticksCamera.js +1 -1
- package/Cameras/virtualJoysticksCamera.js.map +1 -1
- package/Culling/boundingBox.d.ts +2 -2
- package/Culling/boundingBox.js +2 -2
- package/Culling/boundingBox.js.map +1 -1
- package/Culling/ray.d.ts +1 -1
- package/Culling/ray.js +1 -1
- package/Culling/ray.js.map +1 -1
- package/Debug/debugLayer.d.ts +1 -1
- package/Debug/debugLayer.js +1 -1
- package/Debug/debugLayer.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +20 -2
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +8 -10
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.query.d.ts +2 -2
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/ICanvas.d.ts +11 -0
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/WebGL/webGLPipelineContext.d.ts +29 -19
- package/Engines/WebGL/webGLPipelineContext.js +99 -311
- package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/engine.d.ts +2 -2
- package/Engines/engine.js +2 -2
- package/Engines/engine.js.map +1 -1
- package/Engines/nativeEngine.d.ts +2 -2
- package/Engines/nativeEngine.js +2 -2
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +1 -0
- package/Engines/renderTargetWrapper.js +5 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +6 -5
- package/Engines/thinEngine.js +11 -7
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +4 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Events/clipboardEvents.d.ts +1 -1
- package/Events/clipboardEvents.js +1 -1
- package/Events/clipboardEvents.js.map +1 -1
- package/Events/deviceInputEvents.d.ts +11 -4
- package/Events/deviceInputEvents.js.map +1 -1
- package/Gamepads/Controllers/windowsMotionController.d.ts +1 -1
- package/Gamepads/Controllers/windowsMotionController.js +1 -1
- package/Gamepads/Controllers/windowsMotionController.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +4 -0
- package/Gizmos/boundingBoxGizmo.js +6 -0
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Inputs/scene.inputManager.js +4 -4
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.d.ts +3 -3
- package/Layers/effectLayer.js +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +3 -3
- package/Layers/glowLayer.js +2 -2
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +3 -3
- package/Layers/highlightLayer.js +2 -2
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/directionalLight.d.ts +2 -2
- package/Lights/directionalLight.js +2 -2
- package/Lights/directionalLight.js.map +1 -1
- package/Lights/hemisphericLight.d.ts +3 -3
- package/Lights/hemisphericLight.js +3 -3
- package/Lights/hemisphericLight.js.map +1 -1
- package/Lights/light.d.ts +2 -2
- package/Lights/light.js +2 -2
- package/Lights/light.js.map +1 -1
- package/Lights/lightConstants.d.ts +1 -1
- package/Lights/lightConstants.js +1 -1
- package/Lights/lightConstants.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +3 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Loading/sceneLoader.d.ts +1 -1
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +4 -0
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +4 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +1 -1
- package/Materials/Node/nodeMaterial.js +5 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +4 -1
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.d.ts +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.d.ts +2 -1
- package/Materials/Textures/Procedurals/customProceduralTexture.js +9 -3
- package/Materials/Textures/Procedurals/customProceduralTexture.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +9 -9
- package/Materials/Textures/Procedurals/proceduralTexture.js +9 -9
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/colorGradingTexture.d.ts +1 -1
- package/Materials/Textures/colorGradingTexture.js +1 -1
- package/Materials/Textures/colorGradingTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.d.ts +2 -2
- package/Materials/Textures/cubeTexture.js +2 -2
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.d.ts +1 -1
- package/Materials/Textures/rawCubeTexture.js +1 -1
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +3 -5
- package/Materials/Textures/renderTargetTexture.js +19 -19
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/colorCurves.d.ts +3 -3
- package/Materials/colorCurves.js +3 -3
- package/Materials/colorCurves.js.map +1 -1
- package/Materials/effect.d.ts +27 -27
- package/Materials/effect.js +22 -288
- package/Materials/effect.js.map +1 -1
- package/Materials/fresnelParameters.d.ts +1 -1
- package/Materials/fresnelParameters.js +1 -1
- package/Materials/fresnelParameters.js.map +1 -1
- package/Materials/imageProcessingConfiguration.d.ts +4 -4
- package/Materials/imageProcessingConfiguration.js +4 -4
- package/Materials/imageProcessingConfiguration.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +25 -25
- package/Materials/shaderMaterial.js +25 -25
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.js +4 -1
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/index.d.ts +1 -0
- package/Maths/index.js +1 -0
- package/Maths/index.js.map +1 -1
- package/Maths/math.functions.d.ts +2 -2
- package/Maths/math.functions.js +2 -2
- package/Maths/math.functions.js.map +1 -1
- package/Maths/math.polar.d.ts +77 -0
- package/Maths/math.polar.js +114 -0
- package/Maths/math.polar.js.map +1 -0
- package/Maths/math.scalar.d.ts +2 -2
- package/Maths/math.scalar.js +2 -2
- package/Maths/math.scalar.js.map +1 -1
- package/Maths/math.vector.d.ts +13 -12
- package/Maths/math.vector.js +13 -12
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +1 -1
- package/Meshes/abstractMesh.js +13 -2
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +3 -3
- package/Meshes/geometry.js +3 -3
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/groundMesh.d.ts +5 -4
- package/Meshes/groundMesh.js +5 -4
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/instancedMesh.d.ts +1 -1
- package/Meshes/instancedMesh.js +1 -1
- package/Meshes/instancedMesh.js.map +1 -1
- package/Meshes/mesh.d.ts +3 -3
- package/Meshes/mesh.js +7 -3
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/subMesh.d.ts +1 -1
- package/Meshes/subMesh.js +1 -1
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/thinInstanceMesh.d.ts +1 -1
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Meshes/transformNode.js +6 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +2 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +2 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/HighDynamicRange/hdr.d.ts +3 -3
- package/Misc/HighDynamicRange/hdr.js +3 -3
- package/Misc/HighDynamicRange/hdr.js.map +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.d.ts +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js +1 -1
- package/Misc/HighDynamicRange/panoramaToCubemap.js.map +1 -1
- package/Misc/arrayTools.d.ts +13 -12
- package/Misc/arrayTools.js +70 -39
- package/Misc/arrayTools.js.map +1 -1
- package/Misc/assetsManager.d.ts +3 -3
- package/Misc/assetsManager.js +3 -3
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +17 -3
- package/Misc/basis.js.map +1 -1
- package/Misc/environmentTextureTools.d.ts +4 -4
- package/Misc/environmentTextureTools.js +5 -5
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/fileTools.d.ts +3 -3
- package/Misc/fileTools.js +19 -12
- package/Misc/fileTools.js.map +1 -1
- package/Misc/logger.js +1 -1
- package/Misc/logger.js.map +1 -1
- package/Misc/observable.d.ts +1 -1
- package/Misc/observable.js +1 -1
- package/Misc/observable.js.map +1 -1
- package/Misc/performanceMonitor.d.ts +3 -3
- package/Misc/performanceMonitor.js +3 -3
- package/Misc/performanceMonitor.js.map +1 -1
- package/Misc/rgbdTextureTools.d.ts +1 -1
- package/Misc/rgbdTextureTools.js +1 -1
- package/Misc/rgbdTextureTools.js.map +1 -1
- package/Misc/sceneOptimizer.d.ts +7 -7
- package/Misc/sceneOptimizer.js +7 -7
- package/Misc/sceneOptimizer.js.map +1 -1
- package/Misc/stringDictionary.d.ts +6 -6
- package/Misc/stringDictionary.js +6 -6
- package/Misc/stringDictionary.js.map +1 -1
- package/Misc/textureTools.d.ts +4 -4
- package/Misc/textureTools.js +4 -4
- package/Misc/textureTools.js.map +1 -1
- package/Misc/tools.d.ts +6 -6
- package/Misc/tools.js +6 -6
- package/Misc/tools.js.map +1 -1
- package/Misc/videoRecorder.d.ts +1 -1
- package/Misc/videoRecorder.js +1 -1
- package/Misc/videoRecorder.js.map +1 -1
- package/Offline/database.js +3 -3
- package/Offline/database.js.map +1 -1
- package/Particles/IParticleSystem.d.ts +1 -1
- package/Particles/IParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.d.ts +1 -1
- package/Particles/gpuParticleSystem.js +1 -1
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleSystem.d.ts +1 -1
- package/Particles/particleSystem.js +1 -1
- package/Particles/particleSystem.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +4 -0
- package/Particles/solidParticleSystem.js +25 -3
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Physics/Plugins/ammoJSPlugin.d.ts +1 -1
- package/Physics/Plugins/ammoJSPlugin.js +1 -1
- package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.js +1 -1
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/Physics/physicsEngineComponent.d.ts +1 -1
- package/Physics/physicsEngineComponent.js +1 -1
- package/Physics/physicsEngineComponent.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +3 -3
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +1 -2
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +3 -3
- package/PostProcesses/blurPostProcess.js +3 -3
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +3 -3
- package/PostProcesses/volumetricLightScatteringPostProcess.js +3 -3
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/depthPeelingRenderer.d.ts +1 -0
- package/Rendering/depthPeelingRenderer.js +32 -5
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/edgesRenderer.d.ts +2 -2
- package/Rendering/edgesRenderer.js +1 -1
- package/Rendering/edgesRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.d.ts +4 -2
- package/Rendering/geometryBufferRenderer.js +5 -3
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/geometryBufferRendererSceneComponent.d.ts +2 -1
- package/Rendering/geometryBufferRendererSceneComponent.js +3 -2
- package/Rendering/geometryBufferRendererSceneComponent.js.map +1 -1
- package/Rendering/prePassRenderer.d.ts +11 -3
- package/Rendering/prePassRenderer.js +18 -3
- package/Rendering/prePassRenderer.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.d.ts +2 -2
- package/Rendering/subSurfaceConfiguration.js +2 -2
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Sprites/spriteSceneComponent.js +4 -1
- package/Sprites/spriteSceneComponent.js.map +1 -1
- package/XR/features/WebXRControllerTeleportation.d.ts +4 -0
- package/XR/features/WebXRControllerTeleportation.js +24 -19
- package/XR/features/WebXRControllerTeleportation.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.d.ts +2 -2
- package/XR/motionController/webXRAbstractMotionController.js +2 -2
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/motionController/webXRControllerComponent.d.ts +1 -1
- package/XR/motionController/webXRControllerComponent.js +1 -1
- package/XR/motionController/webXRControllerComponent.js.map +1 -1
- package/XR/motionController/webXRMotionControllerManager.d.ts +3 -3
- package/XR/motionController/webXRMotionControllerManager.js +3 -3
- package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
- package/node.d.ts +4 -4
- package/node.js +3 -3
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +0 -4
- package/scene.d.ts +80 -63
- package/scene.js +92 -46
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +1 -1
- package/sceneComponent.js.map +1 -1
package/Layers/highlightLayer.js
CHANGED
|
@@ -137,7 +137,7 @@ export class HighlightLayer extends EffectLayer {
|
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Get the effect name of the layer.
|
|
140
|
-
* @
|
|
140
|
+
* @returns The effect name
|
|
141
141
|
*/
|
|
142
142
|
getEffectName() {
|
|
143
143
|
return HighlightLayer.EffectName;
|
|
@@ -236,7 +236,7 @@ export class HighlightLayer extends EffectLayer {
|
|
|
236
236
|
* Checks for the readiness of the element composing the layer.
|
|
237
237
|
* @param subMesh the mesh to check for
|
|
238
238
|
* @param useInstances specify whether or not to use instances to render the mesh
|
|
239
|
-
* @
|
|
239
|
+
* @returns true if ready otherwise, false
|
|
240
240
|
*/
|
|
241
241
|
isReady(subMesh, useInstances) {
|
|
242
242
|
const material = subMesh.getMaterial();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlightLayer.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Layers/highlightLayer.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,gCAAgC,CAAC;AACxC,OAAO,yCAAyC,CAAC;AACjD,OAAO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AAS,EAAE;iDACqB;AAMjC;IADC,SAAS,EAAE;iDACqB;AAsBjC;IADC,SAAS,EAAE;wDAGX;AAMD;IADC,SAAS,EAAE;sDAGX;AAeD;IADC,SAAS,CAAC,SAAS,CAAC;gDACoB;AAioB7C,aAAa,CAAC,wBAAwB,EAAE,cAAc,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { serialize, SerializationHelper } from \"../Misc/decorators\";\r\nimport type { Observer } from \"../Misc/observable\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Material } from \"../Materials/material\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { PostProcessOptions } from \"../PostProcesses/postProcess\";\r\nimport { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport { PassPostProcess } from \"../PostProcesses/passPostProcess\";\r\nimport { BlurPostProcess } from \"../PostProcesses/blurPostProcess\";\r\nimport { EffectLayer } from \"./effectLayer\";\r\nimport { AbstractScene } from \"../abstractScene\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { Color4, Color3 } from \"../Maths/math.color\";\r\n\r\nimport \"../Shaders/glowMapMerge.fragment\";\r\nimport \"../Shaders/glowMapMerge.vertex\";\r\nimport \"../Shaders/glowBlurPostProcess.fragment\";\r\nimport \"../Layers/effectLayerSceneComponent\";\r\n\r\ndeclare module \"../abstractScene\" {\r\n export interface AbstractScene {\r\n /**\r\n * Return a the first highlight layer of the scene with a given name.\r\n * @param name The name of the highlight layer to look for.\r\n * @return The highlight layer if found otherwise null.\r\n */\r\n getHighlightLayerByName(name: string): Nullable<HighlightLayer>;\r\n }\r\n}\r\n\r\nAbstractScene.prototype.getHighlightLayerByName = function (name: string): Nullable<HighlightLayer> {\r\n for (let index = 0; index < this.effectLayers?.length; index++) {\r\n if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === HighlightLayer.EffectName) {\r\n return (<any>this.effectLayers[index]) as HighlightLayer;\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Special Glow Blur post process only blurring the alpha channel\r\n * It enforces keeping the most luminous color in the color channel.\r\n */\r\nclass GlowBlurPostProcess extends PostProcess {\r\n constructor(\r\n name: string,\r\n public direction: Vector2,\r\n public kernel: number,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode: number = Texture.BILINEAR_SAMPLINGMODE,\r\n engine?: Engine,\r\n reusable?: boolean\r\n ) {\r\n super(name, \"glowBlurPostProcess\", [\"screenSize\", \"direction\", \"blurWidth\"], null, options, camera, samplingMode, engine, reusable);\r\n\r\n this.onApplyObservable.add((effect: Effect) => {\r\n effect.setFloat2(\"screenSize\", this.width, this.height);\r\n effect.setVector2(\"direction\", this.direction);\r\n effect.setFloat(\"blurWidth\", this.kernel);\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Highlight layer options. This helps customizing the behaviour\r\n * of the highlight layer.\r\n */\r\nexport interface IHighlightLayerOptions {\r\n /**\r\n * Multiplication factor apply to the canvas size to compute the render target size\r\n * used to generated the glowing objects (the smaller the faster).\r\n */\r\n mainTextureRatio: number;\r\n\r\n /**\r\n * Enforces a fixed size texture to ensure resize independent blur.\r\n */\r\n mainTextureFixedSize?: number;\r\n\r\n /**\r\n * Multiplication factor apply to the main texture size in the first step of the blur to reduce the size\r\n * of the picture to blur (the smaller the faster).\r\n */\r\n blurTextureSizeRatio: number;\r\n\r\n /**\r\n * How big in texel of the blur texture is the vertical blur.\r\n */\r\n blurVerticalSize: number;\r\n\r\n /**\r\n * How big in texel of the blur texture is the horizontal blur.\r\n */\r\n blurHorizontalSize: number;\r\n\r\n /**\r\n * Alpha blending mode used to apply the blur. Default is combine.\r\n */\r\n alphaBlendingMode: number;\r\n\r\n /**\r\n * The camera attached to the layer.\r\n */\r\n camera: Nullable<Camera>;\r\n\r\n /**\r\n * Should we display highlight as a solid stroke?\r\n */\r\n isStroke?: boolean;\r\n\r\n /**\r\n * The rendering group to draw the layer in.\r\n */\r\n renderingGroupId: number;\r\n}\r\n\r\n/**\r\n * Storage interface grouping all the information required for glowing a mesh.\r\n */\r\ninterface IHighlightLayerMesh {\r\n /**\r\n * The glowy mesh\r\n */\r\n mesh: Mesh;\r\n /**\r\n * The color of the glow\r\n */\r\n color: Color3;\r\n /**\r\n * The mesh render callback use to insert stencil information\r\n */\r\n observerHighlight: Nullable<Observer<Mesh>>;\r\n /**\r\n * The mesh render callback use to come to the default behavior\r\n */\r\n observerDefault: Nullable<Observer<Mesh>>;\r\n /**\r\n * If it exists, the emissive color of the material will be used to generate the glow.\r\n * Else it falls back to the current color.\r\n */\r\n glowEmissiveOnly: boolean;\r\n}\r\n\r\n/**\r\n * Storage interface grouping all the information required for an excluded mesh.\r\n */\r\ninterface IHighlightLayerExcludedMesh {\r\n /**\r\n * The glowy mesh\r\n */\r\n mesh: Mesh;\r\n /**\r\n * The mesh render callback use to prevent stencil use\r\n */\r\n beforeBind: Nullable<Observer<Mesh>>;\r\n /**\r\n * The mesh render callback use to restore previous stencil use\r\n */\r\n afterRender: Nullable<Observer<Mesh>>;\r\n}\r\n\r\n/**\r\n * The highlight layer Helps adding a glow effect around a mesh.\r\n *\r\n * Once instantiated in a scene, simply use the addMesh or removeMesh method to add or remove\r\n * glowy meshes to your scene.\r\n *\r\n * !!! THIS REQUIRES AN ACTIVE STENCIL BUFFER ON THE CANVAS !!!\r\n */\r\nexport class HighlightLayer extends EffectLayer {\r\n /**\r\n * Effect Name of the highlight layer.\r\n */\r\n public static readonly EffectName = \"HighlightLayer\";\r\n\r\n /**\r\n * The neutral color used during the preparation of the glow effect.\r\n * This is black by default as the blend operation is a blend operation.\r\n */\r\n public static NeutralColor: Color4 = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * Stencil value used for glowing meshes.\r\n */\r\n public static GlowingMeshStencilReference = 0x02;\r\n\r\n /**\r\n * Stencil value used for the other meshes in the scene.\r\n */\r\n public static NormalMeshStencilReference = 0x01;\r\n\r\n /**\r\n * Specifies whether or not the inner glow is ACTIVE in the layer.\r\n */\r\n @serialize()\r\n public innerGlow: boolean = true;\r\n\r\n /**\r\n * Specifies whether or not the outer glow is ACTIVE in the layer.\r\n */\r\n @serialize()\r\n public outerGlow: boolean = true;\r\n\r\n /**\r\n * Specifies the horizontal size of the blur.\r\n */\r\n public set blurHorizontalSize(value: number) {\r\n this._horizontalBlurPostprocess.kernel = value;\r\n this._options.blurHorizontalSize = value;\r\n }\r\n\r\n /**\r\n * Specifies the vertical size of the blur.\r\n */\r\n public set blurVerticalSize(value: number) {\r\n this._verticalBlurPostprocess.kernel = value;\r\n this._options.blurVerticalSize = value;\r\n }\r\n\r\n /**\r\n * Gets the horizontal size of the blur.\r\n */\r\n @serialize()\r\n public get blurHorizontalSize(): number {\r\n return this._horizontalBlurPostprocess.kernel;\r\n }\r\n\r\n /**\r\n * Gets the vertical size of the blur.\r\n */\r\n @serialize()\r\n public get blurVerticalSize(): number {\r\n return this._verticalBlurPostprocess.kernel;\r\n }\r\n\r\n /**\r\n * An event triggered when the highlight layer is being blurred.\r\n */\r\n public onBeforeBlurObservable = new Observable<HighlightLayer>();\r\n\r\n /**\r\n * An event triggered when the highlight layer has been blurred.\r\n */\r\n public onAfterBlurObservable = new Observable<HighlightLayer>();\r\n\r\n private _instanceGlowingMeshStencilReference = HighlightLayer.GlowingMeshStencilReference++;\r\n\r\n @serialize(\"options\")\r\n private _options: IHighlightLayerOptions;\r\n private _downSamplePostprocess: PassPostProcess;\r\n private _horizontalBlurPostprocess: GlowBlurPostProcess;\r\n private _verticalBlurPostprocess: GlowBlurPostProcess;\r\n private _blurTexture: RenderTargetTexture;\r\n\r\n private _meshes: Nullable<{ [id: string]: Nullable<IHighlightLayerMesh> }> = {};\r\n private _excludedMeshes: Nullable<{ [id: string]: Nullable<IHighlightLayerExcludedMesh> }> = {};\r\n\r\n /**\r\n * Instantiates a new highlight Layer and references it to the scene..\r\n * @param name The name of the layer\r\n * @param scene The scene to use the layer in\r\n * @param options Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information)\r\n */\r\n constructor(public name: string, scene?: Scene, options?: Partial<IHighlightLayerOptions>) {\r\n super(name, scene);\r\n this.neutralColor = HighlightLayer.NeutralColor;\r\n\r\n // Warn on stencil\r\n if (!this._engine.isStencilEnable) {\r\n Logger.Warn(\"Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }\");\r\n }\r\n\r\n // Adapt options\r\n this._options = {\r\n mainTextureRatio: 0.5,\r\n blurTextureSizeRatio: 0.5,\r\n blurHorizontalSize: 1.0,\r\n blurVerticalSize: 1.0,\r\n alphaBlendingMode: Constants.ALPHA_COMBINE,\r\n camera: null,\r\n renderingGroupId: -1,\r\n ...options,\r\n };\r\n\r\n // Initialize the layer\r\n this._init({\r\n alphaBlendingMode: this._options.alphaBlendingMode,\r\n camera: this._options.camera,\r\n mainTextureFixedSize: this._options.mainTextureFixedSize,\r\n mainTextureRatio: this._options.mainTextureRatio,\r\n renderingGroupId: this._options.renderingGroupId,\r\n });\r\n\r\n // Do not render as long as no meshes have been added\r\n this._shouldRender = false;\r\n }\r\n\r\n /**\r\n * Get the effect name of the layer.\r\n * @return The effect name\r\n */\r\n public getEffectName(): string {\r\n return HighlightLayer.EffectName;\r\n }\r\n\r\n protected _numInternalDraws(): number {\r\n return 2; // we need two rendering, one for the inner glow and the other for the outer glow\r\n }\r\n\r\n /**\r\n * Create the merge effect. This is the shader use to blit the information back\r\n * to the main canvas at the end of the scene rendering.\r\n */\r\n protected _createMergeEffect(): Effect {\r\n // Effect\r\n return this._engine.createEffect(\"glowMapMerge\", [VertexBuffer.PositionKind], [\"offset\"], [\"textureSampler\"], this._options.isStroke ? \"#define STROKE \\n\" : undefined);\r\n }\r\n\r\n /**\r\n * Creates the render target textures and post processes used in the highlight layer.\r\n */\r\n protected _createTextureAndPostProcesses(): void {\r\n let blurTextureWidth = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio;\r\n let blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;\r\n blurTextureWidth = this._engine.needPOTTextures ? Engine.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;\r\n blurTextureHeight = this._engine.needPOTTextures ? Engine.GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;\r\n\r\n let textureType = 0;\r\n if (this._engine.getCaps().textureHalfFloatRender) {\r\n textureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else {\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n }\r\n\r\n this._blurTexture = new RenderTargetTexture(\r\n \"HighlightLayerBlurRTT\",\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n this._scene,\r\n false,\r\n true,\r\n textureType\r\n );\r\n this._blurTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture.anisotropicFilteringLevel = 16;\r\n this._blurTexture.updateSamplingMode(Texture.TRILINEAR_SAMPLINGMODE);\r\n this._blurTexture.renderParticles = false;\r\n this._blurTexture.ignoreCameraViewport = true;\r\n\r\n this._textures = [this._blurTexture];\r\n\r\n if (this._options.alphaBlendingMode === Constants.ALPHA_COMBINE) {\r\n this._downSamplePostprocess = new PassPostProcess(\r\n \"HighlightLayerPPP\",\r\n this._options.blurTextureSizeRatio,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine()\r\n );\r\n this._downSamplePostprocess.externalTextureSamplerBinding = true;\r\n this._downSamplePostprocess.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._mainTexture);\r\n });\r\n\r\n this._horizontalBlurPostprocess = new GlowBlurPostProcess(\r\n \"HighlightLayerHBP\",\r\n new Vector2(1.0, 0),\r\n this._options.blurHorizontalSize,\r\n 1,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine()\r\n );\r\n this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setFloat2(\"screenSize\", blurTextureWidth, blurTextureHeight);\r\n });\r\n\r\n this._verticalBlurPostprocess = new GlowBlurPostProcess(\r\n \"HighlightLayerVBP\",\r\n new Vector2(0, 1.0),\r\n this._options.blurVerticalSize,\r\n 1,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine()\r\n );\r\n this._verticalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setFloat2(\"screenSize\", blurTextureWidth, blurTextureHeight);\r\n });\r\n\r\n this._postProcesses = [this._downSamplePostprocess, this._horizontalBlurPostprocess, this._verticalBlurPostprocess];\r\n } else {\r\n this._horizontalBlurPostprocess = new BlurPostProcess(\r\n \"HighlightLayerHBP\",\r\n new Vector2(1.0, 0),\r\n this._options.blurHorizontalSize / 2,\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\r\n );\r\n this._horizontalBlurPostprocess.width = blurTextureWidth;\r\n this._horizontalBlurPostprocess.height = blurTextureHeight;\r\n this._horizontalBlurPostprocess.externalTextureSamplerBinding = true;\r\n this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._mainTexture);\r\n });\r\n\r\n this._verticalBlurPostprocess = new BlurPostProcess(\r\n \"HighlightLayerVBP\",\r\n new Vector2(0, 1.0),\r\n this._options.blurVerticalSize / 2,\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\r\n );\r\n\r\n this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess];\r\n }\r\n\r\n this._mainTexture.onAfterUnbindObservable.add(() => {\r\n this.onBeforeBlurObservable.notifyObservers(this);\r\n\r\n const internalTexture = this._blurTexture.renderTarget;\r\n if (internalTexture) {\r\n this._scene.postProcessManager.directRender(this._postProcesses, internalTexture, true);\r\n this._engine.unBindFramebuffer(internalTexture, true);\r\n }\r\n\r\n this.onAfterBlurObservable.notifyObservers(this);\r\n });\r\n\r\n // Prevent autoClear.\r\n this._postProcesses.map((pp) => {\r\n pp.autoClear = false;\r\n });\r\n }\r\n\r\n /**\r\n * Returns whether or not the layer needs stencil enabled during the mesh rendering.\r\n */\r\n public needStencil(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks for the readiness of the element composing the layer.\r\n * @param subMesh the mesh to check for\r\n * @param useInstances specify whether or not to use instances to render the mesh\r\n * @return true if ready otherwise, false\r\n */\r\n public isReady(subMesh: SubMesh, useInstances: boolean): boolean {\r\n const material = subMesh.getMaterial();\r\n const mesh = subMesh.getRenderingMesh();\r\n\r\n if (!material || !mesh || !this._meshes) {\r\n return false;\r\n }\r\n\r\n let emissiveTexture: Nullable<Texture> = null;\r\n const highlightLayerMesh = this._meshes[mesh.uniqueId];\r\n\r\n if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {\r\n emissiveTexture = (<any>material).emissiveTexture;\r\n }\r\n return super._isReady(subMesh, useInstances, emissiveTexture);\r\n }\r\n\r\n /**\r\n * Implementation specific of rendering the generating effect on the main canvas.\r\n * @param effect The effect used to render through\r\n * @param renderIndex\r\n */\r\n protected _internalRender(effect: Effect, renderIndex: number): void {\r\n // Texture\r\n effect.setTexture(\"textureSampler\", this._blurTexture);\r\n\r\n // Cache\r\n const engine = this._engine;\r\n engine.cacheStencilState();\r\n\r\n // Stencil operations\r\n engine.setStencilOperationPass(Constants.REPLACE);\r\n engine.setStencilOperationFail(Constants.KEEP);\r\n engine.setStencilOperationDepthFail(Constants.KEEP);\r\n\r\n // Draw order\r\n engine.setStencilMask(0x00);\r\n engine.setStencilBuffer(true);\r\n engine.setStencilFunctionReference(this._instanceGlowingMeshStencilReference);\r\n\r\n // 2 passes inner outer\r\n if (this.outerGlow && renderIndex === 0) {\r\n // the outer glow is rendered the first time _internalRender is called, so when renderIndex == 0 (and only if outerGlow is enabled)\r\n effect.setFloat(\"offset\", 0);\r\n engine.setStencilFunction(Constants.NOTEQUAL);\r\n engine.drawElementsType(Material.TriangleFillMode, 0, 6);\r\n }\r\n if (this.innerGlow && renderIndex === 1) {\r\n // the inner glow is rendered the second time _internalRender is called, so when renderIndex == 1 (and only if innerGlow is enabled)\r\n effect.setFloat(\"offset\", 1);\r\n engine.setStencilFunction(Constants.EQUAL);\r\n engine.drawElementsType(Material.TriangleFillMode, 0, 6);\r\n }\r\n\r\n // Restore Cache\r\n engine.restoreStencilState();\r\n }\r\n\r\n /**\r\n * Returns true if the layer contains information to display, otherwise false.\r\n */\r\n public shouldRender(): boolean {\r\n if (super.shouldRender()) {\r\n return this._meshes ? true : false;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Returns true if the mesh should render, otherwise false.\r\n * @param mesh The mesh to render\r\n * @returns true if it should render otherwise false\r\n */\r\n protected _shouldRenderMesh(mesh: Mesh): boolean {\r\n // Excluded Mesh\r\n if (this._excludedMeshes && this._excludedMeshes[mesh.uniqueId]) {\r\n return false;\r\n }\r\n\r\n if (!super.hasMesh(mesh)) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Returns true if the mesh can be rendered, otherwise false.\r\n * @param mesh The mesh to render\r\n * @param material The material used on the mesh\r\n * @returns true if it can be rendered otherwise false\r\n */\r\n protected _canRenderMesh(mesh: AbstractMesh, material: Material): boolean {\r\n // all meshes can be rendered in the highlight layer, even transparent ones\r\n return true;\r\n }\r\n\r\n /**\r\n * Adds specific effects defines.\r\n * @param defines The defines to add specifics to.\r\n */\r\n protected _addCustomEffectDefines(defines: string[]): void {\r\n defines.push(\"#define HIGHLIGHT\");\r\n }\r\n\r\n /**\r\n * Sets the required values for both the emissive texture and and the main color.\r\n * @param mesh\r\n * @param subMesh\r\n * @param material\r\n */\r\n protected _setEmissiveTextureAndColor(mesh: Mesh, subMesh: SubMesh, material: Material): void {\r\n const highlightLayerMesh = this._meshes![mesh.uniqueId];\r\n if (highlightLayerMesh) {\r\n this._emissiveTextureAndColor.color.set(highlightLayerMesh.color.r, highlightLayerMesh.color.g, highlightLayerMesh.color.b, 1.0);\r\n } else {\r\n this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);\r\n }\r\n\r\n if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {\r\n this._emissiveTextureAndColor.texture = (<any>material).emissiveTexture;\r\n this._emissiveTextureAndColor.color.set(1.0, 1.0, 1.0, 1.0);\r\n } else {\r\n this._emissiveTextureAndColor.texture = null;\r\n }\r\n }\r\n\r\n /**\r\n * Add a mesh in the exclusion list to prevent it to impact or being impacted by the highlight layer.\r\n * @param mesh The mesh to exclude from the highlight layer\r\n */\r\n public addExcludedMesh(mesh: Mesh) {\r\n if (!this._excludedMeshes) {\r\n return;\r\n }\r\n\r\n const meshExcluded = this._excludedMeshes[mesh.uniqueId];\r\n if (!meshExcluded) {\r\n this._excludedMeshes[mesh.uniqueId] = {\r\n mesh: mesh,\r\n beforeBind: mesh.onBeforeBindObservable.add((mesh: Mesh) => {\r\n mesh.getEngine().setStencilBuffer(false);\r\n }),\r\n afterRender: mesh.onAfterRenderObservable.add((mesh: Mesh) => {\r\n mesh.getEngine().setStencilBuffer(true);\r\n }),\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Remove a mesh from the exclusion list to let it impact or being impacted by the highlight layer.\r\n * @param mesh The mesh to highlight\r\n */\r\n public removeExcludedMesh(mesh: Mesh) {\r\n if (!this._excludedMeshes) {\r\n return;\r\n }\r\n\r\n const meshExcluded = this._excludedMeshes[mesh.uniqueId];\r\n if (meshExcluded) {\r\n if (meshExcluded.beforeBind) {\r\n mesh.onBeforeBindObservable.remove(meshExcluded.beforeBind);\r\n }\r\n\r\n if (meshExcluded.afterRender) {\r\n mesh.onAfterRenderObservable.remove(meshExcluded.afterRender);\r\n }\r\n }\r\n\r\n this._excludedMeshes[mesh.uniqueId] = null;\r\n }\r\n\r\n /**\r\n * Determine if a given mesh will be highlighted by the current HighlightLayer\r\n * @param mesh mesh to test\r\n * @returns true if the mesh will be highlighted by the current HighlightLayer\r\n */\r\n public hasMesh(mesh: AbstractMesh): boolean {\r\n if (!this._meshes) {\r\n return false;\r\n }\r\n\r\n if (!super.hasMesh(mesh)) {\r\n return false;\r\n }\r\n\r\n return this._meshes[mesh.uniqueId] !== undefined && this._meshes[mesh.uniqueId] !== null;\r\n }\r\n\r\n /**\r\n * Add a mesh in the highlight layer in order to make it glow with the chosen color.\r\n * @param mesh The mesh to highlight\r\n * @param color The color of the highlight\r\n * @param glowEmissiveOnly Extract the glow from the emissive texture\r\n */\r\n public addMesh(mesh: Mesh, color: Color3, glowEmissiveOnly = false) {\r\n if (!this._meshes) {\r\n return;\r\n }\r\n\r\n const meshHighlight = this._meshes[mesh.uniqueId];\r\n if (meshHighlight) {\r\n meshHighlight.color = color;\r\n } else {\r\n this._meshes[mesh.uniqueId] = {\r\n mesh: mesh,\r\n color: color,\r\n // Lambda required for capture due to Observable this context\r\n observerHighlight: mesh.onBeforeBindObservable.add((mesh: Mesh) => {\r\n if (this.isEnabled) {\r\n if (this._excludedMeshes && this._excludedMeshes[mesh.uniqueId]) {\r\n this._defaultStencilReference(mesh);\r\n } else {\r\n mesh.getScene().getEngine().setStencilFunctionReference(this._instanceGlowingMeshStencilReference);\r\n }\r\n }\r\n }),\r\n observerDefault: mesh.onAfterRenderObservable.add((mesh: Mesh) => {\r\n if (this.isEnabled) {\r\n this._defaultStencilReference(mesh);\r\n }\r\n }),\r\n glowEmissiveOnly: glowEmissiveOnly,\r\n };\r\n\r\n mesh.onDisposeObservable.add(() => {\r\n this._disposeMesh(mesh);\r\n });\r\n }\r\n\r\n this._shouldRender = true;\r\n }\r\n\r\n /**\r\n * Remove a mesh from the highlight layer in order to make it stop glowing.\r\n * @param mesh The mesh to highlight\r\n */\r\n public removeMesh(mesh: Mesh) {\r\n if (!this._meshes) {\r\n return;\r\n }\r\n\r\n const meshHighlight = this._meshes[mesh.uniqueId];\r\n if (meshHighlight) {\r\n if (meshHighlight.observerHighlight) {\r\n mesh.onBeforeBindObservable.remove(meshHighlight.observerHighlight);\r\n }\r\n\r\n if (meshHighlight.observerDefault) {\r\n mesh.onAfterRenderObservable.remove(meshHighlight.observerDefault);\r\n }\r\n delete this._meshes[mesh.uniqueId];\r\n }\r\n\r\n this._shouldRender = false;\r\n for (const meshHighlightToCheck in this._meshes) {\r\n if (this._meshes[meshHighlightToCheck]) {\r\n this._shouldRender = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Remove all the meshes currently referenced in the highlight layer\r\n */\r\n public removeAllMeshes(): void {\r\n if (!this._meshes) {\r\n return;\r\n }\r\n\r\n for (const uniqueId in this._meshes) {\r\n if (Object.prototype.hasOwnProperty.call(this._meshes, uniqueId)) {\r\n const mesh = this._meshes[uniqueId];\r\n if (mesh) {\r\n this.removeMesh(mesh.mesh);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Force the stencil to the normal expected value for none glowing parts\r\n * @param mesh\r\n */\r\n private _defaultStencilReference(mesh: Mesh) {\r\n mesh.getScene().getEngine().setStencilFunctionReference(HighlightLayer.NormalMeshStencilReference);\r\n }\r\n\r\n /**\r\n * Free any resources and references associated to a mesh.\r\n * Internal use\r\n * @param mesh The mesh to free.\r\n * @hidden\r\n */\r\n public _disposeMesh(mesh: Mesh): void {\r\n this.removeMesh(mesh);\r\n this.removeExcludedMesh(mesh);\r\n }\r\n\r\n /**\r\n * Dispose the highlight layer and free resources.\r\n */\r\n public dispose(): void {\r\n if (this._meshes) {\r\n // Clean mesh references\r\n for (const id in this._meshes) {\r\n const meshHighlight = this._meshes[id];\r\n if (meshHighlight && meshHighlight.mesh) {\r\n if (meshHighlight.observerHighlight) {\r\n meshHighlight.mesh.onBeforeBindObservable.remove(meshHighlight.observerHighlight);\r\n }\r\n\r\n if (meshHighlight.observerDefault) {\r\n meshHighlight.mesh.onAfterRenderObservable.remove(meshHighlight.observerDefault);\r\n }\r\n }\r\n }\r\n this._meshes = null;\r\n }\r\n\r\n if (this._excludedMeshes) {\r\n for (const id in this._excludedMeshes) {\r\n const meshHighlight = this._excludedMeshes[id];\r\n if (meshHighlight) {\r\n if (meshHighlight.beforeBind) {\r\n meshHighlight.mesh.onBeforeBindObservable.remove(meshHighlight.beforeBind);\r\n }\r\n\r\n if (meshHighlight.afterRender) {\r\n meshHighlight.mesh.onAfterRenderObservable.remove(meshHighlight.afterRender);\r\n }\r\n }\r\n }\r\n this._excludedMeshes = null;\r\n }\r\n\r\n super.dispose();\r\n }\r\n\r\n /**\r\n * Gets the class name of the effect layer\r\n * @returns the string with the class name of the effect layer\r\n */\r\n public getClassName(): string {\r\n return \"HighlightLayer\";\r\n }\r\n\r\n /**\r\n * Serializes this Highlight layer\r\n * @returns a serialized Highlight layer object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.HighlightLayer\";\r\n\r\n // Highlighted meshes\r\n serializationObject.meshes = [];\r\n\r\n if (this._meshes) {\r\n for (const m in this._meshes) {\r\n const mesh = this._meshes[m];\r\n\r\n if (mesh) {\r\n serializationObject.meshes.push({\r\n glowEmissiveOnly: mesh.glowEmissiveOnly,\r\n color: mesh.color.asArray(),\r\n meshId: mesh.mesh.id,\r\n });\r\n }\r\n }\r\n }\r\n\r\n // Excluded meshes\r\n serializationObject.excludedMeshes = [];\r\n\r\n if (this._excludedMeshes) {\r\n for (const e in this._excludedMeshes) {\r\n const excludedMesh = this._excludedMeshes[e];\r\n\r\n if (excludedMesh) {\r\n serializationObject.excludedMeshes.push(excludedMesh.mesh.id);\r\n }\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Highlight layer from parsed Highlight layer data\r\n * @param parsedHightlightLayer defines the Highlight layer data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing the Highlight layer information\r\n * @returns a parsed Highlight layer\r\n */\r\n public static Parse(parsedHightlightLayer: any, scene: Scene, rootUrl: string): HighlightLayer {\r\n const hl = SerializationHelper.Parse(() => new HighlightLayer(parsedHightlightLayer.name, scene, parsedHightlightLayer.options), parsedHightlightLayer, scene, rootUrl);\r\n let index;\r\n\r\n // Excluded meshes\r\n for (index = 0; index < parsedHightlightLayer.excludedMeshes.length; index++) {\r\n const mesh = scene.getMeshById(parsedHightlightLayer.excludedMeshes[index]);\r\n if (mesh) {\r\n hl.addExcludedMesh(<Mesh>mesh);\r\n }\r\n }\r\n\r\n // Included meshes\r\n for (index = 0; index < parsedHightlightLayer.meshes.length; index++) {\r\n const highlightedMesh = parsedHightlightLayer.meshes[index];\r\n const mesh = scene.getMeshById(highlightedMesh.meshId);\r\n\r\n if (mesh) {\r\n hl.addMesh(<Mesh>mesh, Color3.FromArray(highlightedMesh.color), highlightedMesh.glowEmissiveOnly);\r\n }\r\n }\r\n\r\n return hl;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.HighlightLayer\", HighlightLayer);\r\n"]}
|
|
1
|
+
{"version":3,"file":"highlightLayer.js","sourceRoot":"","sources":["../../../../../lts/core/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CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\r\nimport { serialize, SerializationHelper } from \"../Misc/decorators\";\r\nimport type { Observer } from \"../Misc/observable\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Vector2 } from \"../Maths/math.vector\";\r\nimport { Engine } from \"../Engines/engine\";\r\nimport { VertexBuffer } from \"../Buffers/buffer\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Material } from \"../Materials/material\";\r\nimport { Texture } from \"../Materials/Textures/texture\";\r\nimport { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { PostProcessOptions } from \"../PostProcesses/postProcess\";\r\nimport { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport { PassPostProcess } from \"../PostProcesses/passPostProcess\";\r\nimport { BlurPostProcess } from \"../PostProcesses/blurPostProcess\";\r\nimport { EffectLayer } from \"./effectLayer\";\r\nimport { AbstractScene } from \"../abstractScene\";\r\nimport { Constants } from \"../Engines/constants\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { Color4, Color3 } from \"../Maths/math.color\";\r\n\r\nimport \"../Shaders/glowMapMerge.fragment\";\r\nimport \"../Shaders/glowMapMerge.vertex\";\r\nimport \"../Shaders/glowBlurPostProcess.fragment\";\r\nimport \"../Layers/effectLayerSceneComponent\";\r\n\r\ndeclare module \"../abstractScene\" {\r\n export interface AbstractScene {\r\n /**\r\n * Return a the first highlight layer of the scene with a given name.\r\n * @param name The name of the highlight layer to look for.\r\n * @returns The highlight layer if found otherwise null.\r\n */\r\n getHighlightLayerByName(name: string): Nullable<HighlightLayer>;\r\n }\r\n}\r\n\r\nAbstractScene.prototype.getHighlightLayerByName = function (name: string): Nullable<HighlightLayer> {\r\n for (let index = 0; index < this.effectLayers?.length; index++) {\r\n if (this.effectLayers[index].name === name && this.effectLayers[index].getEffectName() === HighlightLayer.EffectName) {\r\n return (<any>this.effectLayers[index]) as HighlightLayer;\r\n }\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Special Glow Blur post process only blurring the alpha channel\r\n * It enforces keeping the most luminous color in the color channel.\r\n */\r\nclass GlowBlurPostProcess extends PostProcess {\r\n constructor(\r\n name: string,\r\n public direction: Vector2,\r\n public kernel: number,\r\n options: number | PostProcessOptions,\r\n camera: Nullable<Camera>,\r\n samplingMode: number = Texture.BILINEAR_SAMPLINGMODE,\r\n engine?: Engine,\r\n reusable?: boolean\r\n ) {\r\n super(name, \"glowBlurPostProcess\", [\"screenSize\", \"direction\", \"blurWidth\"], null, options, camera, samplingMode, engine, reusable);\r\n\r\n this.onApplyObservable.add((effect: Effect) => {\r\n effect.setFloat2(\"screenSize\", this.width, this.height);\r\n effect.setVector2(\"direction\", this.direction);\r\n effect.setFloat(\"blurWidth\", this.kernel);\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Highlight layer options. This helps customizing the behaviour\r\n * of the highlight layer.\r\n */\r\nexport interface IHighlightLayerOptions {\r\n /**\r\n * Multiplication factor apply to the canvas size to compute the render target size\r\n * used to generated the glowing objects (the smaller the faster).\r\n */\r\n mainTextureRatio: number;\r\n\r\n /**\r\n * Enforces a fixed size texture to ensure resize independent blur.\r\n */\r\n mainTextureFixedSize?: number;\r\n\r\n /**\r\n * Multiplication factor apply to the main texture size in the first step of the blur to reduce the size\r\n * of the picture to blur (the smaller the faster).\r\n */\r\n blurTextureSizeRatio: number;\r\n\r\n /**\r\n * How big in texel of the blur texture is the vertical blur.\r\n */\r\n blurVerticalSize: number;\r\n\r\n /**\r\n * How big in texel of the blur texture is the horizontal blur.\r\n */\r\n blurHorizontalSize: number;\r\n\r\n /**\r\n * Alpha blending mode used to apply the blur. Default is combine.\r\n */\r\n alphaBlendingMode: number;\r\n\r\n /**\r\n * The camera attached to the layer.\r\n */\r\n camera: Nullable<Camera>;\r\n\r\n /**\r\n * Should we display highlight as a solid stroke?\r\n */\r\n isStroke?: boolean;\r\n\r\n /**\r\n * The rendering group to draw the layer in.\r\n */\r\n renderingGroupId: number;\r\n}\r\n\r\n/**\r\n * Storage interface grouping all the information required for glowing a mesh.\r\n */\r\ninterface IHighlightLayerMesh {\r\n /**\r\n * The glowy mesh\r\n */\r\n mesh: Mesh;\r\n /**\r\n * The color of the glow\r\n */\r\n color: Color3;\r\n /**\r\n * The mesh render callback use to insert stencil information\r\n */\r\n observerHighlight: Nullable<Observer<Mesh>>;\r\n /**\r\n * The mesh render callback use to come to the default behavior\r\n */\r\n observerDefault: Nullable<Observer<Mesh>>;\r\n /**\r\n * If it exists, the emissive color of the material will be used to generate the glow.\r\n * Else it falls back to the current color.\r\n */\r\n glowEmissiveOnly: boolean;\r\n}\r\n\r\n/**\r\n * Storage interface grouping all the information required for an excluded mesh.\r\n */\r\ninterface IHighlightLayerExcludedMesh {\r\n /**\r\n * The glowy mesh\r\n */\r\n mesh: Mesh;\r\n /**\r\n * The mesh render callback use to prevent stencil use\r\n */\r\n beforeBind: Nullable<Observer<Mesh>>;\r\n /**\r\n * The mesh render callback use to restore previous stencil use\r\n */\r\n afterRender: Nullable<Observer<Mesh>>;\r\n}\r\n\r\n/**\r\n * The highlight layer Helps adding a glow effect around a mesh.\r\n *\r\n * Once instantiated in a scene, simply use the addMesh or removeMesh method to add or remove\r\n * glowy meshes to your scene.\r\n *\r\n * !!! THIS REQUIRES AN ACTIVE STENCIL BUFFER ON THE CANVAS !!!\r\n */\r\nexport class HighlightLayer extends EffectLayer {\r\n /**\r\n * Effect Name of the highlight layer.\r\n */\r\n public static readonly EffectName = \"HighlightLayer\";\r\n\r\n /**\r\n * The neutral color used during the preparation of the glow effect.\r\n * This is black by default as the blend operation is a blend operation.\r\n */\r\n public static NeutralColor: Color4 = new Color4(0, 0, 0, 0);\r\n\r\n /**\r\n * Stencil value used for glowing meshes.\r\n */\r\n public static GlowingMeshStencilReference = 0x02;\r\n\r\n /**\r\n * Stencil value used for the other meshes in the scene.\r\n */\r\n public static NormalMeshStencilReference = 0x01;\r\n\r\n /**\r\n * Specifies whether or not the inner glow is ACTIVE in the layer.\r\n */\r\n @serialize()\r\n public innerGlow: boolean = true;\r\n\r\n /**\r\n * Specifies whether or not the outer glow is ACTIVE in the layer.\r\n */\r\n @serialize()\r\n public outerGlow: boolean = true;\r\n\r\n /**\r\n * Specifies the horizontal size of the blur.\r\n */\r\n public set blurHorizontalSize(value: number) {\r\n this._horizontalBlurPostprocess.kernel = value;\r\n this._options.blurHorizontalSize = value;\r\n }\r\n\r\n /**\r\n * Specifies the vertical size of the blur.\r\n */\r\n public set blurVerticalSize(value: number) {\r\n this._verticalBlurPostprocess.kernel = value;\r\n this._options.blurVerticalSize = value;\r\n }\r\n\r\n /**\r\n * Gets the horizontal size of the blur.\r\n */\r\n @serialize()\r\n public get blurHorizontalSize(): number {\r\n return this._horizontalBlurPostprocess.kernel;\r\n }\r\n\r\n /**\r\n * Gets the vertical size of the blur.\r\n */\r\n @serialize()\r\n public get blurVerticalSize(): number {\r\n return this._verticalBlurPostprocess.kernel;\r\n }\r\n\r\n /**\r\n * An event triggered when the highlight layer is being blurred.\r\n */\r\n public onBeforeBlurObservable = new Observable<HighlightLayer>();\r\n\r\n /**\r\n * An event triggered when the highlight layer has been blurred.\r\n */\r\n public onAfterBlurObservable = new Observable<HighlightLayer>();\r\n\r\n private _instanceGlowingMeshStencilReference = HighlightLayer.GlowingMeshStencilReference++;\r\n\r\n @serialize(\"options\")\r\n private _options: IHighlightLayerOptions;\r\n private _downSamplePostprocess: PassPostProcess;\r\n private _horizontalBlurPostprocess: GlowBlurPostProcess;\r\n private _verticalBlurPostprocess: GlowBlurPostProcess;\r\n private _blurTexture: RenderTargetTexture;\r\n\r\n private _meshes: Nullable<{ [id: string]: Nullable<IHighlightLayerMesh> }> = {};\r\n private _excludedMeshes: Nullable<{ [id: string]: Nullable<IHighlightLayerExcludedMesh> }> = {};\r\n\r\n /**\r\n * Instantiates a new highlight Layer and references it to the scene..\r\n * @param name The name of the layer\r\n * @param scene The scene to use the layer in\r\n * @param options Sets of none mandatory options to use with the layer (see IHighlightLayerOptions for more information)\r\n */\r\n constructor(public name: string, scene?: Scene, options?: Partial<IHighlightLayerOptions>) {\r\n super(name, scene);\r\n this.neutralColor = HighlightLayer.NeutralColor;\r\n\r\n // Warn on stencil\r\n if (!this._engine.isStencilEnable) {\r\n Logger.Warn(\"Rendering the Highlight Layer requires the stencil to be active on the canvas. var engine = new Engine(canvas, antialias, { stencil: true }\");\r\n }\r\n\r\n // Adapt options\r\n this._options = {\r\n mainTextureRatio: 0.5,\r\n blurTextureSizeRatio: 0.5,\r\n blurHorizontalSize: 1.0,\r\n blurVerticalSize: 1.0,\r\n alphaBlendingMode: Constants.ALPHA_COMBINE,\r\n camera: null,\r\n renderingGroupId: -1,\r\n ...options,\r\n };\r\n\r\n // Initialize the layer\r\n this._init({\r\n alphaBlendingMode: this._options.alphaBlendingMode,\r\n camera: this._options.camera,\r\n mainTextureFixedSize: this._options.mainTextureFixedSize,\r\n mainTextureRatio: this._options.mainTextureRatio,\r\n renderingGroupId: this._options.renderingGroupId,\r\n });\r\n\r\n // Do not render as long as no meshes have been added\r\n this._shouldRender = false;\r\n }\r\n\r\n /**\r\n * Get the effect name of the layer.\r\n * @returns The effect name\r\n */\r\n public getEffectName(): string {\r\n return HighlightLayer.EffectName;\r\n }\r\n\r\n protected _numInternalDraws(): number {\r\n return 2; // we need two rendering, one for the inner glow and the other for the outer glow\r\n }\r\n\r\n /**\r\n * Create the merge effect. This is the shader use to blit the information back\r\n * to the main canvas at the end of the scene rendering.\r\n */\r\n protected _createMergeEffect(): Effect {\r\n // Effect\r\n return this._engine.createEffect(\"glowMapMerge\", [VertexBuffer.PositionKind], [\"offset\"], [\"textureSampler\"], this._options.isStroke ? \"#define STROKE \\n\" : undefined);\r\n }\r\n\r\n /**\r\n * Creates the render target textures and post processes used in the highlight layer.\r\n */\r\n protected _createTextureAndPostProcesses(): void {\r\n let blurTextureWidth = this._mainTextureDesiredSize.width * this._options.blurTextureSizeRatio;\r\n let blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;\r\n blurTextureWidth = this._engine.needPOTTextures ? Engine.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;\r\n blurTextureHeight = this._engine.needPOTTextures ? Engine.GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;\r\n\r\n let textureType = 0;\r\n if (this._engine.getCaps().textureHalfFloatRender) {\r\n textureType = Constants.TEXTURETYPE_HALF_FLOAT;\r\n } else {\r\n textureType = Constants.TEXTURETYPE_UNSIGNED_INT;\r\n }\r\n\r\n this._blurTexture = new RenderTargetTexture(\r\n \"HighlightLayerBlurRTT\",\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n this._scene,\r\n false,\r\n true,\r\n textureType\r\n );\r\n this._blurTexture.wrapU = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture.wrapV = Texture.CLAMP_ADDRESSMODE;\r\n this._blurTexture.anisotropicFilteringLevel = 16;\r\n this._blurTexture.updateSamplingMode(Texture.TRILINEAR_SAMPLINGMODE);\r\n this._blurTexture.renderParticles = false;\r\n this._blurTexture.ignoreCameraViewport = true;\r\n\r\n this._textures = [this._blurTexture];\r\n\r\n if (this._options.alphaBlendingMode === Constants.ALPHA_COMBINE) {\r\n this._downSamplePostprocess = new PassPostProcess(\r\n \"HighlightLayerPPP\",\r\n this._options.blurTextureSizeRatio,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine()\r\n );\r\n this._downSamplePostprocess.externalTextureSamplerBinding = true;\r\n this._downSamplePostprocess.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._mainTexture);\r\n });\r\n\r\n this._horizontalBlurPostprocess = new GlowBlurPostProcess(\r\n \"HighlightLayerHBP\",\r\n new Vector2(1.0, 0),\r\n this._options.blurHorizontalSize,\r\n 1,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine()\r\n );\r\n this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setFloat2(\"screenSize\", blurTextureWidth, blurTextureHeight);\r\n });\r\n\r\n this._verticalBlurPostprocess = new GlowBlurPostProcess(\r\n \"HighlightLayerVBP\",\r\n new Vector2(0, 1.0),\r\n this._options.blurVerticalSize,\r\n 1,\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine()\r\n );\r\n this._verticalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setFloat2(\"screenSize\", blurTextureWidth, blurTextureHeight);\r\n });\r\n\r\n this._postProcesses = [this._downSamplePostprocess, this._horizontalBlurPostprocess, this._verticalBlurPostprocess];\r\n } else {\r\n this._horizontalBlurPostprocess = new BlurPostProcess(\r\n \"HighlightLayerHBP\",\r\n new Vector2(1.0, 0),\r\n this._options.blurHorizontalSize / 2,\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\r\n );\r\n this._horizontalBlurPostprocess.width = blurTextureWidth;\r\n this._horizontalBlurPostprocess.height = blurTextureHeight;\r\n this._horizontalBlurPostprocess.externalTextureSamplerBinding = true;\r\n this._horizontalBlurPostprocess.onApplyObservable.add((effect) => {\r\n effect.setTexture(\"textureSampler\", this._mainTexture);\r\n });\r\n\r\n this._verticalBlurPostprocess = new BlurPostProcess(\r\n \"HighlightLayerVBP\",\r\n new Vector2(0, 1.0),\r\n this._options.blurVerticalSize / 2,\r\n {\r\n width: blurTextureWidth,\r\n height: blurTextureHeight,\r\n },\r\n null,\r\n Texture.BILINEAR_SAMPLINGMODE,\r\n this._scene.getEngine(),\r\n false,\r\n textureType\r\n );\r\n\r\n this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess];\r\n }\r\n\r\n this._mainTexture.onAfterUnbindObservable.add(() => {\r\n this.onBeforeBlurObservable.notifyObservers(this);\r\n\r\n const internalTexture = this._blurTexture.renderTarget;\r\n if (internalTexture) {\r\n this._scene.postProcessManager.directRender(this._postProcesses, internalTexture, true);\r\n this._engine.unBindFramebuffer(internalTexture, true);\r\n }\r\n\r\n this.onAfterBlurObservable.notifyObservers(this);\r\n });\r\n\r\n // Prevent autoClear.\r\n this._postProcesses.map((pp) => {\r\n pp.autoClear = false;\r\n });\r\n }\r\n\r\n /**\r\n * Returns whether or not the layer needs stencil enabled during the mesh rendering.\r\n */\r\n public needStencil(): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Checks for the readiness of the element composing the layer.\r\n * @param subMesh the mesh to check for\r\n * @param useInstances specify whether or not to use instances to render the mesh\r\n * @returns true if ready otherwise, false\r\n */\r\n public isReady(subMesh: SubMesh, useInstances: boolean): boolean {\r\n const material = subMesh.getMaterial();\r\n const mesh = subMesh.getRenderingMesh();\r\n\r\n if (!material || !mesh || !this._meshes) {\r\n return false;\r\n }\r\n\r\n let emissiveTexture: Nullable<Texture> = null;\r\n const highlightLayerMesh = this._meshes[mesh.uniqueId];\r\n\r\n if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {\r\n emissiveTexture = (<any>material).emissiveTexture;\r\n }\r\n return super._isReady(subMesh, useInstances, emissiveTexture);\r\n }\r\n\r\n /**\r\n * Implementation specific of rendering the generating effect on the main canvas.\r\n * @param effect The effect used to render through\r\n * @param renderIndex\r\n */\r\n protected _internalRender(effect: Effect, renderIndex: number): void {\r\n // Texture\r\n effect.setTexture(\"textureSampler\", this._blurTexture);\r\n\r\n // Cache\r\n const engine = this._engine;\r\n engine.cacheStencilState();\r\n\r\n // Stencil operations\r\n engine.setStencilOperationPass(Constants.REPLACE);\r\n engine.setStencilOperationFail(Constants.KEEP);\r\n engine.setStencilOperationDepthFail(Constants.KEEP);\r\n\r\n // Draw order\r\n engine.setStencilMask(0x00);\r\n engine.setStencilBuffer(true);\r\n engine.setStencilFunctionReference(this._instanceGlowingMeshStencilReference);\r\n\r\n // 2 passes inner outer\r\n if (this.outerGlow && renderIndex === 0) {\r\n // the outer glow is rendered the first time _internalRender is called, so when renderIndex == 0 (and only if outerGlow is enabled)\r\n effect.setFloat(\"offset\", 0);\r\n engine.setStencilFunction(Constants.NOTEQUAL);\r\n engine.drawElementsType(Material.TriangleFillMode, 0, 6);\r\n }\r\n if (this.innerGlow && renderIndex === 1) {\r\n // the inner glow is rendered the second time _internalRender is called, so when renderIndex == 1 (and only if innerGlow is enabled)\r\n effect.setFloat(\"offset\", 1);\r\n engine.setStencilFunction(Constants.EQUAL);\r\n engine.drawElementsType(Material.TriangleFillMode, 0, 6);\r\n }\r\n\r\n // Restore Cache\r\n engine.restoreStencilState();\r\n }\r\n\r\n /**\r\n * Returns true if the layer contains information to display, otherwise false.\r\n */\r\n public shouldRender(): boolean {\r\n if (super.shouldRender()) {\r\n return this._meshes ? true : false;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Returns true if the mesh should render, otherwise false.\r\n * @param mesh The mesh to render\r\n * @returns true if it should render otherwise false\r\n */\r\n protected _shouldRenderMesh(mesh: Mesh): boolean {\r\n // Excluded Mesh\r\n if (this._excludedMeshes && this._excludedMeshes[mesh.uniqueId]) {\r\n return false;\r\n }\r\n\r\n if (!super.hasMesh(mesh)) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Returns true if the mesh can be rendered, otherwise false.\r\n * @param mesh The mesh to render\r\n * @param material The material used on the mesh\r\n * @returns true if it can be rendered otherwise false\r\n */\r\n protected _canRenderMesh(mesh: AbstractMesh, material: Material): boolean {\r\n // all meshes can be rendered in the highlight layer, even transparent ones\r\n return true;\r\n }\r\n\r\n /**\r\n * Adds specific effects defines.\r\n * @param defines The defines to add specifics to.\r\n */\r\n protected _addCustomEffectDefines(defines: string[]): void {\r\n defines.push(\"#define HIGHLIGHT\");\r\n }\r\n\r\n /**\r\n * Sets the required values for both the emissive texture and and the main color.\r\n * @param mesh\r\n * @param subMesh\r\n * @param material\r\n */\r\n protected _setEmissiveTextureAndColor(mesh: Mesh, subMesh: SubMesh, material: Material): void {\r\n const highlightLayerMesh = this._meshes![mesh.uniqueId];\r\n if (highlightLayerMesh) {\r\n this._emissiveTextureAndColor.color.set(highlightLayerMesh.color.r, highlightLayerMesh.color.g, highlightLayerMesh.color.b, 1.0);\r\n } else {\r\n this._emissiveTextureAndColor.color.set(this.neutralColor.r, this.neutralColor.g, this.neutralColor.b, this.neutralColor.a);\r\n }\r\n\r\n if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {\r\n this._emissiveTextureAndColor.texture = (<any>material).emissiveTexture;\r\n this._emissiveTextureAndColor.color.set(1.0, 1.0, 1.0, 1.0);\r\n } else {\r\n this._emissiveTextureAndColor.texture = null;\r\n }\r\n }\r\n\r\n /**\r\n * Add a mesh in the exclusion list to prevent it to impact or being impacted by the highlight layer.\r\n * @param mesh The mesh to exclude from the highlight layer\r\n */\r\n public addExcludedMesh(mesh: Mesh) {\r\n if (!this._excludedMeshes) {\r\n return;\r\n }\r\n\r\n const meshExcluded = this._excludedMeshes[mesh.uniqueId];\r\n if (!meshExcluded) {\r\n this._excludedMeshes[mesh.uniqueId] = {\r\n mesh: mesh,\r\n beforeBind: mesh.onBeforeBindObservable.add((mesh: Mesh) => {\r\n mesh.getEngine().setStencilBuffer(false);\r\n }),\r\n afterRender: mesh.onAfterRenderObservable.add((mesh: Mesh) => {\r\n mesh.getEngine().setStencilBuffer(true);\r\n }),\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Remove a mesh from the exclusion list to let it impact or being impacted by the highlight layer.\r\n * @param mesh The mesh to highlight\r\n */\r\n public removeExcludedMesh(mesh: Mesh) {\r\n if (!this._excludedMeshes) {\r\n return;\r\n }\r\n\r\n const meshExcluded = this._excludedMeshes[mesh.uniqueId];\r\n if (meshExcluded) {\r\n if (meshExcluded.beforeBind) {\r\n mesh.onBeforeBindObservable.remove(meshExcluded.beforeBind);\r\n }\r\n\r\n if (meshExcluded.afterRender) {\r\n mesh.onAfterRenderObservable.remove(meshExcluded.afterRender);\r\n }\r\n }\r\n\r\n this._excludedMeshes[mesh.uniqueId] = null;\r\n }\r\n\r\n /**\r\n * Determine if a given mesh will be highlighted by the current HighlightLayer\r\n * @param mesh mesh to test\r\n * @returns true if the mesh will be highlighted by the current HighlightLayer\r\n */\r\n public hasMesh(mesh: AbstractMesh): boolean {\r\n if (!this._meshes) {\r\n return false;\r\n }\r\n\r\n if (!super.hasMesh(mesh)) {\r\n return false;\r\n }\r\n\r\n return this._meshes[mesh.uniqueId] !== undefined && this._meshes[mesh.uniqueId] !== null;\r\n }\r\n\r\n /**\r\n * Add a mesh in the highlight layer in order to make it glow with the chosen color.\r\n * @param mesh The mesh to highlight\r\n * @param color The color of the highlight\r\n * @param glowEmissiveOnly Extract the glow from the emissive texture\r\n */\r\n public addMesh(mesh: Mesh, color: Color3, glowEmissiveOnly = false) {\r\n if (!this._meshes) {\r\n return;\r\n }\r\n\r\n const meshHighlight = this._meshes[mesh.uniqueId];\r\n if (meshHighlight) {\r\n meshHighlight.color = color;\r\n } else {\r\n this._meshes[mesh.uniqueId] = {\r\n mesh: mesh,\r\n color: color,\r\n // Lambda required for capture due to Observable this context\r\n observerHighlight: mesh.onBeforeBindObservable.add((mesh: Mesh) => {\r\n if (this.isEnabled) {\r\n if (this._excludedMeshes && this._excludedMeshes[mesh.uniqueId]) {\r\n this._defaultStencilReference(mesh);\r\n } else {\r\n mesh.getScene().getEngine().setStencilFunctionReference(this._instanceGlowingMeshStencilReference);\r\n }\r\n }\r\n }),\r\n observerDefault: mesh.onAfterRenderObservable.add((mesh: Mesh) => {\r\n if (this.isEnabled) {\r\n this._defaultStencilReference(mesh);\r\n }\r\n }),\r\n glowEmissiveOnly: glowEmissiveOnly,\r\n };\r\n\r\n mesh.onDisposeObservable.add(() => {\r\n this._disposeMesh(mesh);\r\n });\r\n }\r\n\r\n this._shouldRender = true;\r\n }\r\n\r\n /**\r\n * Remove a mesh from the highlight layer in order to make it stop glowing.\r\n * @param mesh The mesh to highlight\r\n */\r\n public removeMesh(mesh: Mesh) {\r\n if (!this._meshes) {\r\n return;\r\n }\r\n\r\n const meshHighlight = this._meshes[mesh.uniqueId];\r\n if (meshHighlight) {\r\n if (meshHighlight.observerHighlight) {\r\n mesh.onBeforeBindObservable.remove(meshHighlight.observerHighlight);\r\n }\r\n\r\n if (meshHighlight.observerDefault) {\r\n mesh.onAfterRenderObservable.remove(meshHighlight.observerDefault);\r\n }\r\n delete this._meshes[mesh.uniqueId];\r\n }\r\n\r\n this._shouldRender = false;\r\n for (const meshHighlightToCheck in this._meshes) {\r\n if (this._meshes[meshHighlightToCheck]) {\r\n this._shouldRender = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Remove all the meshes currently referenced in the highlight layer\r\n */\r\n public removeAllMeshes(): void {\r\n if (!this._meshes) {\r\n return;\r\n }\r\n\r\n for (const uniqueId in this._meshes) {\r\n if (Object.prototype.hasOwnProperty.call(this._meshes, uniqueId)) {\r\n const mesh = this._meshes[uniqueId];\r\n if (mesh) {\r\n this.removeMesh(mesh.mesh);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Force the stencil to the normal expected value for none glowing parts\r\n * @param mesh\r\n */\r\n private _defaultStencilReference(mesh: Mesh) {\r\n mesh.getScene().getEngine().setStencilFunctionReference(HighlightLayer.NormalMeshStencilReference);\r\n }\r\n\r\n /**\r\n * Free any resources and references associated to a mesh.\r\n * Internal use\r\n * @param mesh The mesh to free.\r\n * @hidden\r\n */\r\n public _disposeMesh(mesh: Mesh): void {\r\n this.removeMesh(mesh);\r\n this.removeExcludedMesh(mesh);\r\n }\r\n\r\n /**\r\n * Dispose the highlight layer and free resources.\r\n */\r\n public dispose(): void {\r\n if (this._meshes) {\r\n // Clean mesh references\r\n for (const id in this._meshes) {\r\n const meshHighlight = this._meshes[id];\r\n if (meshHighlight && meshHighlight.mesh) {\r\n if (meshHighlight.observerHighlight) {\r\n meshHighlight.mesh.onBeforeBindObservable.remove(meshHighlight.observerHighlight);\r\n }\r\n\r\n if (meshHighlight.observerDefault) {\r\n meshHighlight.mesh.onAfterRenderObservable.remove(meshHighlight.observerDefault);\r\n }\r\n }\r\n }\r\n this._meshes = null;\r\n }\r\n\r\n if (this._excludedMeshes) {\r\n for (const id in this._excludedMeshes) {\r\n const meshHighlight = this._excludedMeshes[id];\r\n if (meshHighlight) {\r\n if (meshHighlight.beforeBind) {\r\n meshHighlight.mesh.onBeforeBindObservable.remove(meshHighlight.beforeBind);\r\n }\r\n\r\n if (meshHighlight.afterRender) {\r\n meshHighlight.mesh.onAfterRenderObservable.remove(meshHighlight.afterRender);\r\n }\r\n }\r\n }\r\n this._excludedMeshes = null;\r\n }\r\n\r\n super.dispose();\r\n }\r\n\r\n /**\r\n * Gets the class name of the effect layer\r\n * @returns the string with the class name of the effect layer\r\n */\r\n public getClassName(): string {\r\n return \"HighlightLayer\";\r\n }\r\n\r\n /**\r\n * Serializes this Highlight layer\r\n * @returns a serialized Highlight layer object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.customType = \"BABYLON.HighlightLayer\";\r\n\r\n // Highlighted meshes\r\n serializationObject.meshes = [];\r\n\r\n if (this._meshes) {\r\n for (const m in this._meshes) {\r\n const mesh = this._meshes[m];\r\n\r\n if (mesh) {\r\n serializationObject.meshes.push({\r\n glowEmissiveOnly: mesh.glowEmissiveOnly,\r\n color: mesh.color.asArray(),\r\n meshId: mesh.mesh.id,\r\n });\r\n }\r\n }\r\n }\r\n\r\n // Excluded meshes\r\n serializationObject.excludedMeshes = [];\r\n\r\n if (this._excludedMeshes) {\r\n for (const e in this._excludedMeshes) {\r\n const excludedMesh = this._excludedMeshes[e];\r\n\r\n if (excludedMesh) {\r\n serializationObject.excludedMeshes.push(excludedMesh.mesh.id);\r\n }\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Highlight layer from parsed Highlight layer data\r\n * @param parsedHightlightLayer defines the Highlight layer data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing the Highlight layer information\r\n * @returns a parsed Highlight layer\r\n */\r\n public static Parse(parsedHightlightLayer: any, scene: Scene, rootUrl: string): HighlightLayer {\r\n const hl = SerializationHelper.Parse(() => new HighlightLayer(parsedHightlightLayer.name, scene, parsedHightlightLayer.options), parsedHightlightLayer, scene, rootUrl);\r\n let index;\r\n\r\n // Excluded meshes\r\n for (index = 0; index < parsedHightlightLayer.excludedMeshes.length; index++) {\r\n const mesh = scene.getMeshById(parsedHightlightLayer.excludedMeshes[index]);\r\n if (mesh) {\r\n hl.addExcludedMesh(<Mesh>mesh);\r\n }\r\n }\r\n\r\n // Included meshes\r\n for (index = 0; index < parsedHightlightLayer.meshes.length; index++) {\r\n const highlightedMesh = parsedHightlightLayer.meshes[index];\r\n const mesh = scene.getMeshById(highlightedMesh.meshId);\r\n\r\n if (mesh) {\r\n hl.addMesh(<Mesh>mesh, Color3.FromArray(highlightedMesh.color), highlightedMesh.glowEmissiveOnly);\r\n }\r\n }\r\n\r\n return hl;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.HighlightLayer\", HighlightLayer);\r\n"]}
|
|
@@ -80,12 +80,12 @@ export declare class DirectionalLight extends ShadowLight {
|
|
|
80
80
|
constructor(name: string, direction: Vector3, scene: Scene);
|
|
81
81
|
/**
|
|
82
82
|
* Returns the string "DirectionalLight".
|
|
83
|
-
* @
|
|
83
|
+
* @returns The class name
|
|
84
84
|
*/
|
|
85
85
|
getClassName(): string;
|
|
86
86
|
/**
|
|
87
87
|
* Returns the integer 1.
|
|
88
|
-
* @
|
|
88
|
+
* @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
89
89
|
*/
|
|
90
90
|
getTypeID(): number;
|
|
91
91
|
/**
|
|
@@ -113,14 +113,14 @@ export class DirectionalLight extends ShadowLight {
|
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
115
|
* Returns the string "DirectionalLight".
|
|
116
|
-
* @
|
|
116
|
+
* @returns The class name
|
|
117
117
|
*/
|
|
118
118
|
getClassName() {
|
|
119
119
|
return "DirectionalLight";
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Returns the integer 1.
|
|
123
|
-
* @
|
|
123
|
+
* @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
124
124
|
*/
|
|
125
125
|
getTypeID() {
|
|
126
126
|
return Light.LIGHTTYPEID_DIRECTIONALLIGHT;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directionalLight.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Lights/directionalLight.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IACpD,OAAO,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAyG7C;;;;;;;;OAQG;IACH,YAAY,IAAY,EAA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CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;OAQG;IACH,6DAA6D;IACtD,YAAY,CAAC,YAAoB;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC,qBAAqB,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED;;;;OAIG;IACI,2BAA2B,CAAC,OAAY,EAAE,UAAkB;QAC/D,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC;IAC5C,CAAC;CACJ;AAxUG;IADC,SAAS,EAAE;yDAGX;AAgBD;IADC,SAAS,EAAE;wDAGX;AAgBD;IADC,SAAS,EAAE;2DACoB;AAOhC;IADC,SAAS,EAAE;+DACyB;AAIrC;IADC,SAAS,CAAC,WAAW,CAAC;oDACe;AAEtC;IADC,SAAS,CAAC,YAAY,CAAC;qDACe;AAEvC;IADC,SAAS,CAAC,UAAU,CAAC;mDACe;AAErC;IADC,SAAS,CAAC,aAAa,CAAC;sDACe","sourcesContent":["import { serialize } from \"../Misc/decorators\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Matrix, Vector3 } from \"../Maths/math.vector\";\r\nimport { Node } from \"../node\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { Light } from \"./light\";\r\nimport { ShadowLight } from \"./shadowLight\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nNode.AddNodeConstructor(\"Light_Type_1\", (name, scene) => {\r\n return () => new DirectionalLight(name, Vector3.Zero(), scene);\r\n});\r\n\r\n/**\r\n * A directional light is defined by a direction (what a surprise!).\r\n * The light is emitted from everywhere in the specified direction, and has an infinite range.\r\n * An example of a directional light is when a distance planet is lit by the apparently parallel lines of light from its sun. Light in a downward direction will light the top of an object.\r\n * Documentation: https://doc.babylonjs.com/babylon101/lights\r\n */\r\nexport class DirectionalLight extends ShadowLight {\r\n private _shadowFrustumSize = 0;\r\n /**\r\n * Fix frustum size for the shadow generation. This is disabled if the value is 0.\r\n */\r\n @serialize()\r\n public get shadowFrustumSize(): number {\r\n return this._shadowFrustumSize;\r\n }\r\n /**\r\n * Specifies a fix frustum size for the shadow generation.\r\n */\r\n public set shadowFrustumSize(value: number) {\r\n this._shadowFrustumSize = value;\r\n this.forceProjectionMatrixCompute();\r\n }\r\n\r\n private _shadowOrthoScale = 0.1;\r\n /**\r\n * Gets the shadow projection scale against the optimal computed one.\r\n * 0.1 by default which means that the projection window is increase by 10% from the optimal size.\r\n * This does not impact in fixed frustum size (shadowFrustumSize being set)\r\n */\r\n @serialize()\r\n public get shadowOrthoScale(): number {\r\n return this._shadowOrthoScale;\r\n }\r\n /**\r\n * Sets the shadow projection scale against the optimal computed one.\r\n * 0.1 by default which means that the projection window is increase by 10% from the optimal size.\r\n * This does not impact in fixed frustum size (shadowFrustumSize being set)\r\n */\r\n public set shadowOrthoScale(value: number) {\r\n this._shadowOrthoScale = value;\r\n this.forceProjectionMatrixCompute();\r\n }\r\n\r\n /**\r\n * Automatically compute the projection matrix to best fit (including all the casters)\r\n * on each frame.\r\n */\r\n @serialize()\r\n public autoUpdateExtends = true;\r\n\r\n /**\r\n * Automatically compute the shadowMinZ and shadowMaxZ for the projection matrix to best fit (including all the casters)\r\n * on each frame. autoUpdateExtends must be set to true for this to work\r\n */\r\n @serialize()\r\n public autoCalcShadowZBounds = false;\r\n\r\n // Cache\r\n @serialize(\"orthoLeft\")\r\n private _orthoLeft = Number.MAX_VALUE;\r\n @serialize(\"orthoRight\")\r\n private _orthoRight = Number.MIN_VALUE;\r\n @serialize(\"orthoTop\")\r\n private _orthoTop = Number.MIN_VALUE;\r\n @serialize(\"orthoBottom\")\r\n private _orthoBottom = Number.MAX_VALUE;\r\n\r\n /**\r\n * Gets or sets the orthoLeft property used to build the light frustum\r\n */\r\n public get orthoLeft(): number {\r\n return this._orthoLeft;\r\n }\r\n\r\n public set orthoLeft(left: number) {\r\n this._orthoLeft = left;\r\n }\r\n\r\n /**\r\n * Gets or sets the orthoRight property used to build the light frustum\r\n */\r\n public get orthoRight(): number {\r\n return this._orthoRight;\r\n }\r\n\r\n public set orthoRight(right: number) {\r\n this._orthoRight = right;\r\n }\r\n\r\n /**\r\n * Gets or sets the orthoTop property used to build the light frustum\r\n */\r\n public get orthoTop(): number {\r\n return this._orthoTop;\r\n }\r\n\r\n public set orthoTop(top: number) {\r\n this._orthoTop = top;\r\n }\r\n\r\n /**\r\n * Gets or sets the orthoBottom property used to build the light frustum\r\n */\r\n public get orthoBottom(): number {\r\n return this._orthoBottom;\r\n }\r\n\r\n public set orthoBottom(bottom: number) {\r\n this._orthoBottom = bottom;\r\n }\r\n\r\n /**\r\n * Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3).\r\n * The directional light is emitted from everywhere in the given direction.\r\n * It can cast shadows.\r\n * Documentation : https://doc.babylonjs.com/babylon101/lights\r\n * @param name The friendly name of the light\r\n * @param direction The direction of the light\r\n * @param scene The scene the light belongs to\r\n */\r\n constructor(name: string, direction: Vector3, scene: Scene) {\r\n super(name, scene);\r\n this.position = direction.scale(-1.0);\r\n this.direction = direction;\r\n }\r\n\r\n /**\r\n * Returns the string \"DirectionalLight\".\r\n * @return The class name\r\n */\r\n public getClassName(): string {\r\n return \"DirectionalLight\";\r\n }\r\n\r\n /**\r\n * Returns the integer 1.\r\n * @return The light Type id as a constant defines in Light.LIGHTTYPEID_x\r\n */\r\n public getTypeID(): number {\r\n return Light.LIGHTTYPEID_DIRECTIONALLIGHT;\r\n }\r\n\r\n /**\r\n * Sets the passed matrix \"matrix\" as projection matrix for the shadows cast by the light according to the passed view matrix.\r\n * Returns the DirectionalLight Shadow projection matrix.\r\n * @param matrix\r\n * @param viewMatrix\r\n * @param renderList\r\n */\r\n protected _setDefaultShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void {\r\n if (this.shadowFrustumSize > 0) {\r\n this._setDefaultFixedFrustumShadowProjectionMatrix(matrix);\r\n } else {\r\n this._setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the passed matrix \"matrix\" as fixed frustum projection matrix for the shadows cast by the light according to the passed view matrix.\r\n * Returns the DirectionalLight Shadow projection matrix.\r\n * @param matrix\r\n */\r\n protected _setDefaultFixedFrustumShadowProjectionMatrix(matrix: Matrix): void {\r\n const activeCamera = this.getScene().activeCamera;\r\n\r\n if (!activeCamera) {\r\n return;\r\n }\r\n\r\n Matrix.OrthoLHToRef(\r\n this.shadowFrustumSize,\r\n this.shadowFrustumSize,\r\n this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ,\r\n this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ,\r\n matrix,\r\n this.getScene().getEngine().isNDCHalfZRange\r\n );\r\n }\r\n\r\n /**\r\n * Sets the passed matrix \"matrix\" as auto extend projection matrix for the shadows cast by the light according to the passed view matrix.\r\n * Returns the DirectionalLight Shadow projection matrix.\r\n * @param matrix\r\n * @param viewMatrix\r\n * @param renderList\r\n */\r\n protected _setDefaultAutoExtendShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void {\r\n const activeCamera = this.getScene().activeCamera;\r\n\r\n if (!activeCamera) {\r\n return;\r\n }\r\n\r\n // Check extends\r\n if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) {\r\n const tempVector3 = Vector3.Zero();\r\n\r\n this._orthoLeft = Number.MAX_VALUE;\r\n this._orthoRight = Number.MIN_VALUE;\r\n this._orthoTop = Number.MIN_VALUE;\r\n this._orthoBottom = Number.MAX_VALUE;\r\n\r\n let shadowMinZ = Number.MAX_VALUE;\r\n let shadowMaxZ = Number.MIN_VALUE;\r\n\r\n for (let meshIndex = 0; meshIndex < renderList.length; meshIndex++) {\r\n const mesh = renderList[meshIndex];\r\n\r\n if (!mesh) {\r\n continue;\r\n }\r\n\r\n const boundingInfo = mesh.getBoundingInfo();\r\n const boundingBox = boundingInfo.boundingBox;\r\n\r\n for (let index = 0; index < boundingBox.vectorsWorld.length; index++) {\r\n Vector3.TransformCoordinatesToRef(boundingBox.vectorsWorld[index], viewMatrix, tempVector3);\r\n\r\n if (tempVector3.x < this._orthoLeft) {\r\n this._orthoLeft = tempVector3.x;\r\n }\r\n if (tempVector3.y < this._orthoBottom) {\r\n this._orthoBottom = tempVector3.y;\r\n }\r\n\r\n if (tempVector3.x > this._orthoRight) {\r\n this._orthoRight = tempVector3.x;\r\n }\r\n if (tempVector3.y > this._orthoTop) {\r\n this._orthoTop = tempVector3.y;\r\n }\r\n if (this.autoCalcShadowZBounds) {\r\n if (tempVector3.z < shadowMinZ) {\r\n shadowMinZ = tempVector3.z;\r\n }\r\n if (tempVector3.z > shadowMaxZ) {\r\n shadowMaxZ = tempVector3.z;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (this.autoCalcShadowZBounds) {\r\n this._shadowMinZ = shadowMinZ;\r\n this._shadowMaxZ = shadowMaxZ;\r\n }\r\n }\r\n\r\n const xOffset = this._orthoRight - this._orthoLeft;\r\n const yOffset = this._orthoTop - this._orthoBottom;\r\n\r\n const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;\r\n const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;\r\n\r\n const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;\r\n\r\n Matrix.OrthoOffCenterLHToRef(\r\n this._orthoLeft - xOffset * this.shadowOrthoScale,\r\n this._orthoRight + xOffset * this.shadowOrthoScale,\r\n this._orthoBottom - yOffset * this.shadowOrthoScale,\r\n this._orthoTop + yOffset * this.shadowOrthoScale,\r\n useReverseDepthBuffer ? maxZ : minZ,\r\n useReverseDepthBuffer ? minZ : maxZ,\r\n matrix,\r\n this.getScene().getEngine().isNDCHalfZRange\r\n );\r\n }\r\n\r\n protected _buildUniformLayout(): void {\r\n this._uniformBuffer.addUniform(\"vLightData\", 4);\r\n this._uniformBuffer.addUniform(\"vLightDiffuse\", 4);\r\n this._uniformBuffer.addUniform(\"vLightSpecular\", 4);\r\n this._uniformBuffer.addUniform(\"shadowsInfo\", 3);\r\n this._uniformBuffer.addUniform(\"depthValues\", 2);\r\n this._uniformBuffer.create();\r\n }\r\n\r\n /**\r\n * Sets the passed Effect object with the DirectionalLight transformed position (or position if not parented) and the passed name.\r\n * @param effect The effect to update\r\n * @param lightIndex The index of the light in the effect to update\r\n * @returns The directional light\r\n */\r\n public transferToEffect(effect: Effect, lightIndex: string): DirectionalLight {\r\n if (this.computeTransformedInformation()) {\r\n this._uniformBuffer.updateFloat4(\"vLightData\", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, lightIndex);\r\n return this;\r\n }\r\n this._uniformBuffer.updateFloat4(\"vLightData\", this.direction.x, this.direction.y, this.direction.z, 1, lightIndex);\r\n return this;\r\n }\r\n\r\n public transferToNodeMaterialEffect(effect: Effect, lightDataUniformName: string): Light {\r\n if (this.computeTransformedInformation()) {\r\n effect.setFloat3(lightDataUniformName, this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z);\r\n return this;\r\n }\r\n\r\n effect.setFloat3(lightDataUniformName, this.direction.x, this.direction.y, this.direction.z);\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the minZ used for shadow according to both the scene and the light.\r\n *\r\n * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being\r\n * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.\r\n * (when not using reverse depth buffer / NDC half Z range)\r\n * @param activeCamera The camera we are returning the min for\r\n * @returns the depth min z\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getDepthMinZ(activeCamera: Camera): number {\r\n const engine = this._scene.getEngine();\r\n return !engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;\r\n }\r\n\r\n /**\r\n * Gets the maxZ used for shadow according to both the scene and the light.\r\n *\r\n * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being\r\n * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.\r\n * (when not using reverse depth buffer / NDC half Z range)\r\n * @param activeCamera The camera we are returning the max for\r\n * @returns the depth max z\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getDepthMaxZ(activeCamera: Camera): number {\r\n const engine = this._scene.getEngine();\r\n return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;\r\n }\r\n\r\n /**\r\n * Prepares the list of defines specific to the light type.\r\n * @param defines the list of defines\r\n * @param lightIndex defines the index of the light for the effect\r\n */\r\n public prepareLightSpecificDefines(defines: any, lightIndex: number): void {\r\n defines[\"DIRLIGHT\" + lightIndex] = true;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"directionalLight.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Lights/directionalLight.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IACpD,OAAO,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,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AqB,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;;OAQG;IACH,6DAA6D;IACtD,YAAY,CAAC,YAAoB;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC,qBAAqB,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED;;;;OAIG;IACI,2BAA2B,CAAC,OAAY,EAAE,UAAkB;QAC/D,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC;IAC5C,CAAC;CACJ;AAxUG;IADC,SAAS,EAAE;yDAGX;AAgBD;IADC,SAAS,EAAE;wDAGX;AAgBD;IADC,SAAS,EAAE;2DACoB;AAOhC;IADC,SAAS,EAAE;+DACyB;AAIrC;IADC,SAAS,CAAC,WAAW,CAAC;oDACe;AAEtC;IADC,SAAS,CAAC,YAAY,CAAC;qDACe;AAEvC;IADC,SAAS,CAAC,UAAU,CAAC;mDACe;AAErC;IADC,SAAS,CAAC,aAAa,CAAC;sDACe","sourcesContent":["import { serialize } from \"../Misc/decorators\";\r\nimport type { Camera } from \"../Cameras/camera\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Matrix, Vector3 } from \"../Maths/math.vector\";\r\nimport { Node } from \"../node\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport { Light } from \"./light\";\r\nimport { ShadowLight } from \"./shadowLight\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nNode.AddNodeConstructor(\"Light_Type_1\", (name, scene) => {\r\n return () => new DirectionalLight(name, Vector3.Zero(), scene);\r\n});\r\n\r\n/**\r\n * A directional light is defined by a direction (what a surprise!).\r\n * The light is emitted from everywhere in the specified direction, and has an infinite range.\r\n * An example of a directional light is when a distance planet is lit by the apparently parallel lines of light from its sun. Light in a downward direction will light the top of an object.\r\n * Documentation: https://doc.babylonjs.com/babylon101/lights\r\n */\r\nexport class DirectionalLight extends ShadowLight {\r\n private _shadowFrustumSize = 0;\r\n /**\r\n * Fix frustum size for the shadow generation. This is disabled if the value is 0.\r\n */\r\n @serialize()\r\n public get shadowFrustumSize(): number {\r\n return this._shadowFrustumSize;\r\n }\r\n /**\r\n * Specifies a fix frustum size for the shadow generation.\r\n */\r\n public set shadowFrustumSize(value: number) {\r\n this._shadowFrustumSize = value;\r\n this.forceProjectionMatrixCompute();\r\n }\r\n\r\n private _shadowOrthoScale = 0.1;\r\n /**\r\n * Gets the shadow projection scale against the optimal computed one.\r\n * 0.1 by default which means that the projection window is increase by 10% from the optimal size.\r\n * This does not impact in fixed frustum size (shadowFrustumSize being set)\r\n */\r\n @serialize()\r\n public get shadowOrthoScale(): number {\r\n return this._shadowOrthoScale;\r\n }\r\n /**\r\n * Sets the shadow projection scale against the optimal computed one.\r\n * 0.1 by default which means that the projection window is increase by 10% from the optimal size.\r\n * This does not impact in fixed frustum size (shadowFrustumSize being set)\r\n */\r\n public set shadowOrthoScale(value: number) {\r\n this._shadowOrthoScale = value;\r\n this.forceProjectionMatrixCompute();\r\n }\r\n\r\n /**\r\n * Automatically compute the projection matrix to best fit (including all the casters)\r\n * on each frame.\r\n */\r\n @serialize()\r\n public autoUpdateExtends = true;\r\n\r\n /**\r\n * Automatically compute the shadowMinZ and shadowMaxZ for the projection matrix to best fit (including all the casters)\r\n * on each frame. autoUpdateExtends must be set to true for this to work\r\n */\r\n @serialize()\r\n public autoCalcShadowZBounds = false;\r\n\r\n // Cache\r\n @serialize(\"orthoLeft\")\r\n private _orthoLeft = Number.MAX_VALUE;\r\n @serialize(\"orthoRight\")\r\n private _orthoRight = Number.MIN_VALUE;\r\n @serialize(\"orthoTop\")\r\n private _orthoTop = Number.MIN_VALUE;\r\n @serialize(\"orthoBottom\")\r\n private _orthoBottom = Number.MAX_VALUE;\r\n\r\n /**\r\n * Gets or sets the orthoLeft property used to build the light frustum\r\n */\r\n public get orthoLeft(): number {\r\n return this._orthoLeft;\r\n }\r\n\r\n public set orthoLeft(left: number) {\r\n this._orthoLeft = left;\r\n }\r\n\r\n /**\r\n * Gets or sets the orthoRight property used to build the light frustum\r\n */\r\n public get orthoRight(): number {\r\n return this._orthoRight;\r\n }\r\n\r\n public set orthoRight(right: number) {\r\n this._orthoRight = right;\r\n }\r\n\r\n /**\r\n * Gets or sets the orthoTop property used to build the light frustum\r\n */\r\n public get orthoTop(): number {\r\n return this._orthoTop;\r\n }\r\n\r\n public set orthoTop(top: number) {\r\n this._orthoTop = top;\r\n }\r\n\r\n /**\r\n * Gets or sets the orthoBottom property used to build the light frustum\r\n */\r\n public get orthoBottom(): number {\r\n return this._orthoBottom;\r\n }\r\n\r\n public set orthoBottom(bottom: number) {\r\n this._orthoBottom = bottom;\r\n }\r\n\r\n /**\r\n * Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3).\r\n * The directional light is emitted from everywhere in the given direction.\r\n * It can cast shadows.\r\n * Documentation : https://doc.babylonjs.com/babylon101/lights\r\n * @param name The friendly name of the light\r\n * @param direction The direction of the light\r\n * @param scene The scene the light belongs to\r\n */\r\n constructor(name: string, direction: Vector3, scene: Scene) {\r\n super(name, scene);\r\n this.position = direction.scale(-1.0);\r\n this.direction = direction;\r\n }\r\n\r\n /**\r\n * Returns the string \"DirectionalLight\".\r\n * @returns The class name\r\n */\r\n public getClassName(): string {\r\n return \"DirectionalLight\";\r\n }\r\n\r\n /**\r\n * Returns the integer 1.\r\n * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x\r\n */\r\n public getTypeID(): number {\r\n return Light.LIGHTTYPEID_DIRECTIONALLIGHT;\r\n }\r\n\r\n /**\r\n * Sets the passed matrix \"matrix\" as projection matrix for the shadows cast by the light according to the passed view matrix.\r\n * Returns the DirectionalLight Shadow projection matrix.\r\n * @param matrix\r\n * @param viewMatrix\r\n * @param renderList\r\n */\r\n protected _setDefaultShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void {\r\n if (this.shadowFrustumSize > 0) {\r\n this._setDefaultFixedFrustumShadowProjectionMatrix(matrix);\r\n } else {\r\n this._setDefaultAutoExtendShadowProjectionMatrix(matrix, viewMatrix, renderList);\r\n }\r\n }\r\n\r\n /**\r\n * Sets the passed matrix \"matrix\" as fixed frustum projection matrix for the shadows cast by the light according to the passed view matrix.\r\n * Returns the DirectionalLight Shadow projection matrix.\r\n * @param matrix\r\n */\r\n protected _setDefaultFixedFrustumShadowProjectionMatrix(matrix: Matrix): void {\r\n const activeCamera = this.getScene().activeCamera;\r\n\r\n if (!activeCamera) {\r\n return;\r\n }\r\n\r\n Matrix.OrthoLHToRef(\r\n this.shadowFrustumSize,\r\n this.shadowFrustumSize,\r\n this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ,\r\n this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ,\r\n matrix,\r\n this.getScene().getEngine().isNDCHalfZRange\r\n );\r\n }\r\n\r\n /**\r\n * Sets the passed matrix \"matrix\" as auto extend projection matrix for the shadows cast by the light according to the passed view matrix.\r\n * Returns the DirectionalLight Shadow projection matrix.\r\n * @param matrix\r\n * @param viewMatrix\r\n * @param renderList\r\n */\r\n protected _setDefaultAutoExtendShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void {\r\n const activeCamera = this.getScene().activeCamera;\r\n\r\n if (!activeCamera) {\r\n return;\r\n }\r\n\r\n // Check extends\r\n if (this.autoUpdateExtends || this._orthoLeft === Number.MAX_VALUE) {\r\n const tempVector3 = Vector3.Zero();\r\n\r\n this._orthoLeft = Number.MAX_VALUE;\r\n this._orthoRight = Number.MIN_VALUE;\r\n this._orthoTop = Number.MIN_VALUE;\r\n this._orthoBottom = Number.MAX_VALUE;\r\n\r\n let shadowMinZ = Number.MAX_VALUE;\r\n let shadowMaxZ = Number.MIN_VALUE;\r\n\r\n for (let meshIndex = 0; meshIndex < renderList.length; meshIndex++) {\r\n const mesh = renderList[meshIndex];\r\n\r\n if (!mesh) {\r\n continue;\r\n }\r\n\r\n const boundingInfo = mesh.getBoundingInfo();\r\n const boundingBox = boundingInfo.boundingBox;\r\n\r\n for (let index = 0; index < boundingBox.vectorsWorld.length; index++) {\r\n Vector3.TransformCoordinatesToRef(boundingBox.vectorsWorld[index], viewMatrix, tempVector3);\r\n\r\n if (tempVector3.x < this._orthoLeft) {\r\n this._orthoLeft = tempVector3.x;\r\n }\r\n if (tempVector3.y < this._orthoBottom) {\r\n this._orthoBottom = tempVector3.y;\r\n }\r\n\r\n if (tempVector3.x > this._orthoRight) {\r\n this._orthoRight = tempVector3.x;\r\n }\r\n if (tempVector3.y > this._orthoTop) {\r\n this._orthoTop = tempVector3.y;\r\n }\r\n if (this.autoCalcShadowZBounds) {\r\n if (tempVector3.z < shadowMinZ) {\r\n shadowMinZ = tempVector3.z;\r\n }\r\n if (tempVector3.z > shadowMaxZ) {\r\n shadowMaxZ = tempVector3.z;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (this.autoCalcShadowZBounds) {\r\n this._shadowMinZ = shadowMinZ;\r\n this._shadowMaxZ = shadowMaxZ;\r\n }\r\n }\r\n\r\n const xOffset = this._orthoRight - this._orthoLeft;\r\n const yOffset = this._orthoTop - this._orthoBottom;\r\n\r\n const minZ = this.shadowMinZ !== undefined ? this.shadowMinZ : activeCamera.minZ;\r\n const maxZ = this.shadowMaxZ !== undefined ? this.shadowMaxZ : activeCamera.maxZ;\r\n\r\n const useReverseDepthBuffer = this.getScene().getEngine().useReverseDepthBuffer;\r\n\r\n Matrix.OrthoOffCenterLHToRef(\r\n this._orthoLeft - xOffset * this.shadowOrthoScale,\r\n this._orthoRight + xOffset * this.shadowOrthoScale,\r\n this._orthoBottom - yOffset * this.shadowOrthoScale,\r\n this._orthoTop + yOffset * this.shadowOrthoScale,\r\n useReverseDepthBuffer ? maxZ : minZ,\r\n useReverseDepthBuffer ? minZ : maxZ,\r\n matrix,\r\n this.getScene().getEngine().isNDCHalfZRange\r\n );\r\n }\r\n\r\n protected _buildUniformLayout(): void {\r\n this._uniformBuffer.addUniform(\"vLightData\", 4);\r\n this._uniformBuffer.addUniform(\"vLightDiffuse\", 4);\r\n this._uniformBuffer.addUniform(\"vLightSpecular\", 4);\r\n this._uniformBuffer.addUniform(\"shadowsInfo\", 3);\r\n this._uniformBuffer.addUniform(\"depthValues\", 2);\r\n this._uniformBuffer.create();\r\n }\r\n\r\n /**\r\n * Sets the passed Effect object with the DirectionalLight transformed position (or position if not parented) and the passed name.\r\n * @param effect The effect to update\r\n * @param lightIndex The index of the light in the effect to update\r\n * @returns The directional light\r\n */\r\n public transferToEffect(effect: Effect, lightIndex: string): DirectionalLight {\r\n if (this.computeTransformedInformation()) {\r\n this._uniformBuffer.updateFloat4(\"vLightData\", this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z, 1, lightIndex);\r\n return this;\r\n }\r\n this._uniformBuffer.updateFloat4(\"vLightData\", this.direction.x, this.direction.y, this.direction.z, 1, lightIndex);\r\n return this;\r\n }\r\n\r\n public transferToNodeMaterialEffect(effect: Effect, lightDataUniformName: string): Light {\r\n if (this.computeTransformedInformation()) {\r\n effect.setFloat3(lightDataUniformName, this.transformedDirection.x, this.transformedDirection.y, this.transformedDirection.z);\r\n return this;\r\n }\r\n\r\n effect.setFloat3(lightDataUniformName, this.direction.x, this.direction.y, this.direction.z);\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the minZ used for shadow according to both the scene and the light.\r\n *\r\n * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being\r\n * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.\r\n * (when not using reverse depth buffer / NDC half Z range)\r\n * @param activeCamera The camera we are returning the min for\r\n * @returns the depth min z\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getDepthMinZ(activeCamera: Camera): number {\r\n const engine = this._scene.getEngine();\r\n return !engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;\r\n }\r\n\r\n /**\r\n * Gets the maxZ used for shadow according to both the scene and the light.\r\n *\r\n * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being\r\n * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.\r\n * (when not using reverse depth buffer / NDC half Z range)\r\n * @param activeCamera The camera we are returning the max for\r\n * @returns the depth max z\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getDepthMaxZ(activeCamera: Camera): number {\r\n const engine = this._scene.getEngine();\r\n return engine.useReverseDepthBuffer && engine.isNDCHalfZRange ? 0 : 1;\r\n }\r\n\r\n /**\r\n * Prepares the list of defines specific to the light type.\r\n * @param defines the list of defines\r\n * @param lightIndex defines the index of the light for the effect\r\n */\r\n public prepareLightSpecificDefines(defines: any, lightIndex: number): void {\r\n defines[\"DIRLIGHT\" + lightIndex] = true;\r\n }\r\n}\r\n"]}
|
|
@@ -32,14 +32,14 @@ export declare class HemisphericLight extends Light {
|
|
|
32
32
|
protected _buildUniformLayout(): void;
|
|
33
33
|
/**
|
|
34
34
|
* Returns the string "HemisphericLight".
|
|
35
|
-
* @
|
|
35
|
+
* @returns The class name
|
|
36
36
|
*/
|
|
37
37
|
getClassName(): string;
|
|
38
38
|
/**
|
|
39
39
|
* Sets the HemisphericLight direction towards the passed target (Vector3).
|
|
40
40
|
* Returns the updated direction.
|
|
41
41
|
* @param target The target the direction should point to
|
|
42
|
-
* @
|
|
42
|
+
* @returns The computed direction
|
|
43
43
|
*/
|
|
44
44
|
setDirectionToTarget(target: Vector3): Vector3;
|
|
45
45
|
/**
|
|
@@ -62,7 +62,7 @@ export declare class HemisphericLight extends Light {
|
|
|
62
62
|
computeWorldMatrix(): Matrix;
|
|
63
63
|
/**
|
|
64
64
|
* Returns the integer 3.
|
|
65
|
-
* @
|
|
65
|
+
* @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
66
66
|
*/
|
|
67
67
|
getTypeID(): number;
|
|
68
68
|
/**
|
|
@@ -41,7 +41,7 @@ export class HemisphericLight extends Light {
|
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Returns the string "HemisphericLight".
|
|
44
|
-
* @
|
|
44
|
+
* @returns The class name
|
|
45
45
|
*/
|
|
46
46
|
getClassName() {
|
|
47
47
|
return "HemisphericLight";
|
|
@@ -50,7 +50,7 @@ export class HemisphericLight extends Light {
|
|
|
50
50
|
* Sets the HemisphericLight direction towards the passed target (Vector3).
|
|
51
51
|
* Returns the updated direction.
|
|
52
52
|
* @param target The target the direction should point to
|
|
53
|
-
* @
|
|
53
|
+
* @returns The computed direction
|
|
54
54
|
*/
|
|
55
55
|
setDirectionToTarget(target) {
|
|
56
56
|
this.direction = Vector3.Normalize(target.subtract(Vector3.Zero()));
|
|
@@ -92,7 +92,7 @@ export class HemisphericLight extends Light {
|
|
|
92
92
|
}
|
|
93
93
|
/**
|
|
94
94
|
* Returns the integer 3.
|
|
95
|
-
* @
|
|
95
|
+
* @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
96
96
|
*/
|
|
97
97
|
getTypeID() {
|
|
98
98
|
return Light.LIGHTTYPEID_HEMISPHERICLIGHT;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hemisphericLight.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Lights/hemisphericLight.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG3E,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B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;IAC9C,CAAC;IAED;;;;OAIG;IACI,2BAA2B,CAAC,OAAY,EAAE,UAAkB;QAC/D,OAAO,CAAC,WAAW,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC;IAC7C,CAAC;CACJ;AAzGG;IADC,iBAAiB,EAAE;qDAC2B;AAM/C;IADC,kBAAkB,EAAE;mDACK","sourcesContent":["import { serializeAsColor3, serializeAsVector3 } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Matrix, Vector3 } from \"../Maths/math.vector\";\r\nimport { Color3 } from \"../Maths/math.color\";\r\nimport { Node } from \"../node\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Light } from \"./light\";\r\nimport type { IShadowGenerator } from \"./Shadows/shadowGenerator\";\r\n\r\nNode.AddNodeConstructor(\"Light_Type_3\", (name, scene) => {\r\n return () => new HemisphericLight(name, Vector3.Zero(), scene);\r\n});\r\n\r\n/**\r\n * The HemisphericLight simulates the ambient environment light,\r\n * so the passed direction is the light reflection direction, not the incoming direction.\r\n */\r\nexport class HemisphericLight extends Light {\r\n /**\r\n * The groundColor is the light in the opposite direction to the one specified during creation.\r\n * You can think of the diffuse and specular light as coming from the centre of the object in the given direction and the groundColor light in the opposite direction.\r\n */\r\n @serializeAsColor3()\r\n public groundColor = new Color3(0.0, 0.0, 0.0);\r\n\r\n /**\r\n * The light reflection direction, not the incoming direction.\r\n */\r\n @serializeAsVector3()\r\n public direction: Vector3;\r\n\r\n /**\r\n * Creates a HemisphericLight object in the scene according to the passed direction (Vector3).\r\n * The HemisphericLight simulates the ambient environment light, so the passed direction is the light reflection direction, not the incoming direction.\r\n * The HemisphericLight can't cast shadows.\r\n * Documentation : https://doc.babylonjs.com/babylon101/lights\r\n * @param name The friendly name of the light\r\n * @param direction The direction of the light reflection\r\n * @param scene The scene the light belongs to\r\n */\r\n constructor(name: string, direction: Vector3, scene: Scene) {\r\n super(name, scene);\r\n this.direction = direction || Vector3.Up();\r\n }\r\n\r\n protected _buildUniformLayout(): void {\r\n this._uniformBuffer.addUniform(\"vLightData\", 4);\r\n this._uniformBuffer.addUniform(\"vLightDiffuse\", 4);\r\n this._uniformBuffer.addUniform(\"vLightSpecular\", 4);\r\n this._uniformBuffer.addUniform(\"vLightGround\", 3);\r\n this._uniformBuffer.addUniform(\"shadowsInfo\", 3);\r\n this._uniformBuffer.addUniform(\"depthValues\", 2);\r\n this._uniformBuffer.create();\r\n }\r\n\r\n /**\r\n * Returns the string \"HemisphericLight\".\r\n * @
|
|
1
|
+
{"version":3,"file":"hemisphericLight.js","sourceRoot":"","sources":["../../../../../lts/core/generated/Lights/hemisphericLight.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAG3E,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IACpD,OAAO,GAAG,EAAE,CAAC,IAAI,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAcvC;;;;;;;;OAQG;IACH,YAAY,IAAY,EAAE,SAAkB,EAAE,KAAY;QACtD,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAvBvB;;;WAGG;QAEI,gBAAW,GAAG,IAAI,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAmB3C,IAAI,CAAC,SAAS,GAAG,SAAS,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AAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;QACrG,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,4BAA4B,CAAC,MAAc,EAAE,oBAA4B;QAC5E,MAAM,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7D,MAAM,CAAC,SAAS,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;QACzG,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,kBAAkB;QACrB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YACpB,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;SACzC;QACD,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACI,SAAS;QACZ,OAAO,KAAK,CAAC,4BAA4B,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACI,2BAA2B,CAAC,OAAY,EAAE,UAAkB;QAC/D,OAAO,CAAC,WAAW,GAAG,UAAU,CAAC,GAAG,IAAI,CAAC;IAC7C,CAAC;CACJ;AAzGG;IADC,iBAAiB,EAAE;qDAC2B;AAM/C;IADC,kBAAkB,EAAE;mDACK","sourcesContent":["import { serializeAsColor3, serializeAsVector3 } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Matrix, Vector3 } from \"../Maths/math.vector\";\r\nimport { Color3 } from \"../Maths/math.color\";\r\nimport { Node } from \"../node\";\r\nimport type { Effect } from \"../Materials/effect\";\r\nimport { Light } from \"./light\";\r\nimport type { IShadowGenerator } from \"./Shadows/shadowGenerator\";\r\n\r\nNode.AddNodeConstructor(\"Light_Type_3\", (name, scene) => {\r\n return () => new HemisphericLight(name, Vector3.Zero(), scene);\r\n});\r\n\r\n/**\r\n * The HemisphericLight simulates the ambient environment light,\r\n * so the passed direction is the light reflection direction, not the incoming direction.\r\n */\r\nexport class HemisphericLight extends Light {\r\n /**\r\n * The groundColor is the light in the opposite direction to the one specified during creation.\r\n * You can think of the diffuse and specular light as coming from the centre of the object in the given direction and the groundColor light in the opposite direction.\r\n */\r\n @serializeAsColor3()\r\n public groundColor = new Color3(0.0, 0.0, 0.0);\r\n\r\n /**\r\n * The light reflection direction, not the incoming direction.\r\n */\r\n @serializeAsVector3()\r\n public direction: Vector3;\r\n\r\n /**\r\n * Creates a HemisphericLight object in the scene according to the passed direction (Vector3).\r\n * The HemisphericLight simulates the ambient environment light, so the passed direction is the light reflection direction, not the incoming direction.\r\n * The HemisphericLight can't cast shadows.\r\n * Documentation : https://doc.babylonjs.com/babylon101/lights\r\n * @param name The friendly name of the light\r\n * @param direction The direction of the light reflection\r\n * @param scene The scene the light belongs to\r\n */\r\n constructor(name: string, direction: Vector3, scene: Scene) {\r\n super(name, scene);\r\n this.direction = direction || Vector3.Up();\r\n }\r\n\r\n protected _buildUniformLayout(): void {\r\n this._uniformBuffer.addUniform(\"vLightData\", 4);\r\n this._uniformBuffer.addUniform(\"vLightDiffuse\", 4);\r\n this._uniformBuffer.addUniform(\"vLightSpecular\", 4);\r\n this._uniformBuffer.addUniform(\"vLightGround\", 3);\r\n this._uniformBuffer.addUniform(\"shadowsInfo\", 3);\r\n this._uniformBuffer.addUniform(\"depthValues\", 2);\r\n this._uniformBuffer.create();\r\n }\r\n\r\n /**\r\n * Returns the string \"HemisphericLight\".\r\n * @returns The class name\r\n */\r\n public getClassName(): string {\r\n return \"HemisphericLight\";\r\n }\r\n\r\n /**\r\n * Sets the HemisphericLight direction towards the passed target (Vector3).\r\n * Returns the updated direction.\r\n * @param target The target the direction should point to\r\n * @returns The computed direction\r\n */\r\n public setDirectionToTarget(target: Vector3): Vector3 {\r\n this.direction = Vector3.Normalize(target.subtract(Vector3.Zero()));\r\n return this.direction;\r\n }\r\n\r\n /**\r\n * Returns the shadow generator associated to the light.\r\n * @returns Always null for hemispheric lights because it does not support shadows.\r\n */\r\n public getShadowGenerator(): Nullable<IShadowGenerator> {\r\n return null;\r\n }\r\n\r\n /**\r\n * Sets the passed Effect object with the HemisphericLight normalized direction and color and the passed name (string).\r\n * @param _effect The effect to update\r\n * @param lightIndex The index of the light in the effect to update\r\n * @returns The hemispheric light\r\n */\r\n public transferToEffect(_effect: Effect, lightIndex: string): HemisphericLight {\r\n const normalizeDirection = Vector3.Normalize(this.direction);\r\n this._uniformBuffer.updateFloat4(\"vLightData\", normalizeDirection.x, normalizeDirection.y, normalizeDirection.z, 0.0, lightIndex);\r\n this._uniformBuffer.updateColor3(\"vLightGround\", this.groundColor.scale(this.intensity), lightIndex);\r\n return this;\r\n }\r\n\r\n public transferToNodeMaterialEffect(effect: Effect, lightDataUniformName: string) {\r\n const normalizeDirection = Vector3.Normalize(this.direction);\r\n effect.setFloat3(lightDataUniformName, normalizeDirection.x, normalizeDirection.y, normalizeDirection.z);\r\n return this;\r\n }\r\n\r\n /**\r\n * Computes the world matrix of the node\r\n * @returns the world matrix\r\n */\r\n public computeWorldMatrix(): Matrix {\r\n if (!this._worldMatrix) {\r\n this._worldMatrix = Matrix.Identity();\r\n }\r\n return this._worldMatrix;\r\n }\r\n\r\n /**\r\n * Returns the integer 3.\r\n * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x\r\n */\r\n public getTypeID(): number {\r\n return Light.LIGHTTYPEID_HEMISPHERICLIGHT;\r\n }\r\n\r\n /**\r\n * Prepares the list of defines specific to the light type.\r\n * @param defines the list of defines\r\n * @param lightIndex defines the index of the light for the effect\r\n */\r\n public prepareLightSpecificDefines(defines: any, lightIndex: number): void {\r\n defines[\"HEMILIGHT\" + lightIndex] = true;\r\n }\r\n}\r\n"]}
|
package/Lights/light.d.ts
CHANGED
|
@@ -298,7 +298,7 @@ export declare abstract class Light extends Node implements ISortableLight {
|
|
|
298
298
|
setEnabled(value: boolean): void;
|
|
299
299
|
/**
|
|
300
300
|
* Returns the Light associated shadow generator if any.
|
|
301
|
-
* @
|
|
301
|
+
* @returns the associated shadow generator.
|
|
302
302
|
*/
|
|
303
303
|
getShadowGenerator(): Nullable<IShadowGenerator>;
|
|
304
304
|
/**
|
|
@@ -309,7 +309,7 @@ export declare abstract class Light extends Node implements ISortableLight {
|
|
|
309
309
|
/**
|
|
310
310
|
* Specifies if the light will affect the passed mesh.
|
|
311
311
|
* @param mesh The mesh to test against the light
|
|
312
|
-
* @
|
|
312
|
+
* @returns true the mesh is affected otherwise, false.
|
|
313
313
|
*/
|
|
314
314
|
canAffectMesh(mesh: AbstractMesh): boolean;
|
|
315
315
|
/**
|
package/Lights/light.js
CHANGED
|
@@ -304,7 +304,7 @@ export class Light extends Node {
|
|
|
304
304
|
}
|
|
305
305
|
/**
|
|
306
306
|
* Returns the Light associated shadow generator if any.
|
|
307
|
-
* @
|
|
307
|
+
* @returns the associated shadow generator.
|
|
308
308
|
*/
|
|
309
309
|
getShadowGenerator() {
|
|
310
310
|
return this._shadowGenerator;
|
|
@@ -319,7 +319,7 @@ export class Light extends Node {
|
|
|
319
319
|
/**
|
|
320
320
|
* Specifies if the light will affect the passed mesh.
|
|
321
321
|
* @param mesh The mesh to test against the light
|
|
322
|
-
* @
|
|
322
|
+
* @returns true the mesh is affected otherwise, false.
|
|
323
323
|
*/
|
|
324
324
|
canAffectMesh(mesh) {
|
|
325
325
|
if (!mesh) {
|