|
@@ -11563,9 +11563,9 @@ declare module "babylonjs/sceneComponent" {
|
|
|
static readonly STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW: number;
|
|
|
static readonly STEP_AFTERCAMERADRAW_LAYER: number;
|
|
|
static readonly STEP_AFTERRENDER_AUDIO: number;
|
|
|
- static readonly STEP_GATHERRENDERTARGETS_SHADOWGENERATOR: number;
|
|
|
- static readonly STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER: number;
|
|
|
static readonly STEP_GATHERRENDERTARGETS_DEPTHRENDERER: number;
|
|
|
+ static readonly STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER: number;
|
|
|
+ static readonly STEP_GATHERRENDERTARGETS_SHADOWGENERATOR: number;
|
|
|
static readonly STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER: number;
|
|
|
static readonly STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER: number;
|
|
|
static readonly STEP_POINTERMOVE_SPRITE: number;
|
|
@@ -19909,7 +19909,7 @@ declare module "babylonjs/Meshes/instancedMesh" {
|
|
|
*
|
|
|
* Returns the clone.
|
|
|
*/
|
|
|
- clone(name: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean): Nullable<AbstractMesh>;
|
|
|
+ clone(name: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean): InstancedMesh;
|
|
|
/**
|
|
|
* Disposes the InstancedMesh.
|
|
|
* Returns nothing.
|
|
@@ -20310,7 +20310,6 @@ declare module "babylonjs/Meshes/linesMesh" {
|
|
|
import { Material } from "babylonjs/Materials/material";
|
|
|
import "babylonjs/Shaders/color.fragment";
|
|
|
import "babylonjs/Shaders/color.vertex";
|
|
|
- import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
/**
|
|
|
* Line mesh
|
|
|
* @see https://doc.babylonjs.com/babylon101/parametric_shapes
|
|
@@ -20392,7 +20391,7 @@ declare module "babylonjs/Meshes/linesMesh" {
|
|
|
/**
|
|
|
* Returns a new LineMesh object cloned from the current one.
|
|
|
*/
|
|
|
- clone(name: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean): Nullable<AbstractMesh>;
|
|
|
+ clone(name: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean): LinesMesh;
|
|
|
/**
|
|
|
* Creates a new InstancedLinesMesh object from the mesh model.
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_instances
|
|
@@ -25455,7 +25454,7 @@ declare module "babylonjs/Meshes/mesh" {
|
|
|
* @param clonePhysicsImpostor allows/denies the cloning in the same time of the original mesh `body` used by the physics engine, if any (default `true`)
|
|
|
* @returns a new mesh
|
|
|
*/
|
|
|
- clone(name?: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean, clonePhysicsImpostor?: boolean): Nullable<AbstractMesh>;
|
|
|
+ clone(name?: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean, clonePhysicsImpostor?: boolean): Mesh;
|
|
|
/**
|
|
|
* Releases resources associated with this mesh.
|
|
|
* @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
|
|
@@ -45280,7 +45279,6 @@ declare module "babylonjs/Cameras/XR/webXRController" {
|
|
|
* Pointer which can be used to select objects or attach a visible laser to
|
|
|
*/
|
|
|
pointer: AbstractMesh;
|
|
|
- private _gamepadMode;
|
|
|
/**
|
|
|
* If available, this is the gamepad object related to this controller.
|
|
|
* Using this object it is possible to get click events and trackpad changes of the
|
|
@@ -45406,6 +45404,8 @@ declare module "babylonjs/Cameras/XR/features/WebXRControllerPointerSelection" {
|
|
|
import { IWebXRFeature } from "babylonjs/Cameras/XR/webXRFeaturesManager";
|
|
|
import { WebXRSessionManager } from "babylonjs/Cameras/XR/webXRSessionManager";
|
|
|
import { WebXRInput } from "babylonjs/Cameras/XR/webXRInput";
|
|
|
+ import { WebXRController } from "babylonjs/Cameras/XR/webXRController";
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
import { Color3 } from "babylonjs/Maths/math.color";
|
|
|
/**
|
|
|
* Options interface for the pointer selection module
|
|
@@ -45419,6 +45419,29 @@ declare module "babylonjs/Cameras/XR/features/WebXRControllerPointerSelection" {
|
|
|
* Different button type to use instead of the main component
|
|
|
*/
|
|
|
overrideButtonId?: string;
|
|
|
+ /**
|
|
|
+ * The amount of time in miliseconds it takes between pick found something to a pointer down event.
|
|
|
+ * Used in gaze modes. Tracked pointer uses the trigger, screen uses touch events
|
|
|
+ * 3000 means 3 seconds between pointing at something and selecting it
|
|
|
+ */
|
|
|
+ timeToSelect?: number;
|
|
|
+ /**
|
|
|
+ * Disable the pointer up event when the xr controller in screen and gaze mode is disposed (meaning - when the user removed the finger from the screen)
|
|
|
+ * If not disabled, the last picked point will be used to execute a pointer up event
|
|
|
+ * If disabled, pointer up event will be triggered right after the pointer down event.
|
|
|
+ * Used in screen and gaze target ray mode only
|
|
|
+ */
|
|
|
+ disablePointerUpOnTouchOut: boolean;
|
|
|
+ /**
|
|
|
+ * For gaze mode (time to select instead of press)
|
|
|
+ */
|
|
|
+ forceGazeMode: boolean;
|
|
|
+ /**
|
|
|
+ * Factor to be applied to the pointer-moved function in the gaze mode. How sensitive should the gaze mode be when checking if the pointer moved
|
|
|
+ * to start a new countdown to the pointer down event.
|
|
|
+ * Defaults to 1.
|
|
|
+ */
|
|
|
+ gazeModePointerMovedFactor?: number;
|
|
|
}
|
|
|
/**
|
|
|
* A module that will enable pointer selection for motion controllers of XR Input Sources
|
|
@@ -45439,11 +45462,11 @@ declare module "babylonjs/Cameras/XR/features/WebXRControllerPointerSelection" {
|
|
|
/**
|
|
|
* This color will be set to the laser pointer when selection is triggered
|
|
|
*/
|
|
|
- onPickedLaserPointerColor: Color3;
|
|
|
+ laserPointerPickedColor: Color3;
|
|
|
/**
|
|
|
* This color will be applied to the selection ring when selection is triggered
|
|
|
*/
|
|
|
- onPickedSelectionMeshColor: Color3;
|
|
|
+ selectionMeshPickedColor: Color3;
|
|
|
/**
|
|
|
* default color of the selection ring
|
|
|
*/
|
|
@@ -45482,7 +45505,19 @@ declare module "babylonjs/Cameras/XR/features/WebXRControllerPointerSelection" {
|
|
|
* @returns true if successful.
|
|
|
*/
|
|
|
detach(): boolean;
|
|
|
+ /**
|
|
|
+ * Get the xr controller that correlates to the pointer id in the pointer event
|
|
|
+ *
|
|
|
+ * @param id the pointer id to search for
|
|
|
+ * @returns the controller that correlates to this id or null if not found
|
|
|
+ */
|
|
|
+ getXRControllerByPointerId(id: number): Nullable<WebXRController>;
|
|
|
private _attachController;
|
|
|
+ private _attachScreenRayMode;
|
|
|
+ private _attachGazeMode;
|
|
|
+ private _tmpVectorForPickCompare;
|
|
|
+ private _pickingMoved;
|
|
|
+ private _attachTrackedPointerRayMode;
|
|
|
private _detachController;
|
|
|
private _generateNewMeshPair;
|
|
|
private _convertNormalToDirectionOfRay;
|
|
@@ -45722,6 +45757,15 @@ declare module "babylonjs/Cameras/XR/features/WebXRControllerTeleportation" {
|
|
|
*/
|
|
|
disableAnimation?: boolean;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Disable using the thumbstick and use the main component (usuallly trigger) on long press.
|
|
|
+ * This will be automatically true if the controller doesnt have a thumbstick or touchpad.
|
|
|
+ */
|
|
|
+ useMainComponentOnly?: boolean;
|
|
|
+ /**
|
|
|
+ * If main component is used (no thumbstick), how long should the "long press" take before teleporting
|
|
|
+ */
|
|
|
+ timeToTeleport?: number;
|
|
|
}
|
|
|
/**
|
|
|
* This is a teleportation feature to be used with webxr-enabled motion controllers.
|
|
@@ -45824,6 +45868,7 @@ declare module "babylonjs/Cameras/XR/features/WebXRControllerTeleportation" {
|
|
|
dispose(): void;
|
|
|
private _currentTeleportationControllerId;
|
|
|
private _attachController;
|
|
|
+ private _teleportForward;
|
|
|
private _detachController;
|
|
|
private createDefaultTargetMesh;
|
|
|
private setTargetMeshVisibility;
|
|
@@ -56396,6 +56441,219 @@ declare module "babylonjs/LensFlares/index" {
|
|
|
export * from "babylonjs/LensFlares/lensFlareSystem";
|
|
|
export * from "babylonjs/LensFlares/lensFlareSystemSceneComponent";
|
|
|
}
|
|
|
+declare module "babylonjs/Shaders/depth.fragment" {
|
|
|
+ import "babylonjs/Shaders/ShadersInclude/packingFunctions";
|
|
|
+ /** @hidden */
|
|
|
+ export var depthPixelShader: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module "babylonjs/Shaders/depth.vertex" {
|
|
|
+ import "babylonjs/Shaders/ShadersInclude/bonesDeclaration";
|
|
|
+ import "babylonjs/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration";
|
|
|
+ import "babylonjs/Shaders/ShadersInclude/morphTargetsVertexDeclaration";
|
|
|
+ import "babylonjs/Shaders/ShadersInclude/instancesDeclaration";
|
|
|
+ import "babylonjs/Shaders/ShadersInclude/morphTargetsVertex";
|
|
|
+ import "babylonjs/Shaders/ShadersInclude/instancesVertex";
|
|
|
+ import "babylonjs/Shaders/ShadersInclude/bonesVertex";
|
|
|
+ /** @hidden */
|
|
|
+ export var depthVertexShader: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module "babylonjs/Rendering/depthRenderer" {
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
+ import { SubMesh } from "babylonjs/Meshes/subMesh";
|
|
|
+ import { Scene } from "babylonjs/scene";
|
|
|
+ import { RenderTargetTexture } from "babylonjs/Materials/Textures/renderTargetTexture";
|
|
|
+ import { Camera } from "babylonjs/Cameras/camera";
|
|
|
+ import "babylonjs/Shaders/depth.fragment";
|
|
|
+ import "babylonjs/Shaders/depth.vertex";
|
|
|
+ /**
|
|
|
+ * This represents a depth renderer in Babylon.
|
|
|
+ * A depth renderer will render to it's depth map every frame which can be displayed or used in post processing
|
|
|
+ */
|
|
|
+ export class DepthRenderer {
|
|
|
+ private _scene;
|
|
|
+ private _depthMap;
|
|
|
+ private _effect;
|
|
|
+ private readonly _storeNonLinearDepth;
|
|
|
+ private readonly _clearColor;
|
|
|
+ /** Get if the depth renderer is using packed depth or not */
|
|
|
+ readonly isPacked: boolean;
|
|
|
+ private _cachedDefines;
|
|
|
+ private _camera;
|
|
|
+ /** Enable or disable the depth renderer. When disabled, the depth texture is not updated */
|
|
|
+ enabled: boolean;
|
|
|
+ /**
|
|
|
+ * Specifiess that the depth renderer will only be used within
|
|
|
+ * the camera it is created for.
|
|
|
+ * This can help forcing its rendering during the camera processing.
|
|
|
+ */
|
|
|
+ useOnlyInActiveCamera: boolean;
|
|
|
+ /** @hidden */
|
|
|
+ static _SceneComponentInitialization: (scene: Scene) => void;
|
|
|
+ /**
|
|
|
+ * Instantiates a depth renderer
|
|
|
+ * @param scene The scene the renderer belongs to
|
|
|
+ * @param type The texture type of the depth map (default: Engine.TEXTURETYPE_FLOAT)
|
|
|
+ * @param camera The camera to be used to render the depth map (default: scene's active camera)
|
|
|
+ * @param storeNonLinearDepth Defines whether the depth is stored linearly like in Babylon Shadows or directly like glFragCoord.z
|
|
|
+ */
|
|
|
+ constructor(scene: Scene, type?: number, camera?: Nullable<Camera>, storeNonLinearDepth?: boolean);
|
|
|
+ /**
|
|
|
+ * Creates the depth rendering effect and checks if the effect is ready.
|
|
|
+ * @param subMesh The submesh to be used to render the depth map of
|
|
|
+ * @param useInstances If multiple world instances should be used
|
|
|
+ * @returns if the depth renderer is ready to render the depth map
|
|
|
+ */
|
|
|
+ isReady(subMesh: SubMesh, useInstances: boolean): boolean;
|
|
|
+ /**
|
|
|
+ * Gets the texture which the depth map will be written to.
|
|
|
+ * @returns The depth map texture
|
|
|
+ */
|
|
|
+ getDepthMap(): RenderTargetTexture;
|
|
|
+ /**
|
|
|
+ * Disposes of the depth renderer.
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs/Shaders/minmaxRedux.fragment" {
|
|
|
+ /** @hidden */
|
|
|
+ export var minmaxReduxPixelShader: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module "babylonjs/Misc/minMaxReducer" {
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
+ import { RenderTargetTexture } from "babylonjs/Materials/Textures/renderTargetTexture";
|
|
|
+ import { Camera } from "babylonjs/Cameras/camera";
|
|
|
+ import { Observer } from "babylonjs/Misc/observable";
|
|
|
+ import { PostProcess } from "babylonjs/PostProcesses/postProcess";
|
|
|
+ import { PostProcessManager } from "babylonjs/PostProcesses/postProcessManager";
|
|
|
+ import { Observable } from "babylonjs/Misc/observable";
|
|
|
+ import "babylonjs/Shaders/minmaxRedux.fragment";
|
|
|
+ /**
|
|
|
+ * This class computes a min/max reduction from a texture: it means it computes the minimum
|
|
|
+ * and maximum values from all values of the texture.
|
|
|
+ * It is performed on the GPU for better performances, thanks to a succession of post processes.
|
|
|
+ * The source values are read from the red channel of the texture.
|
|
|
+ */
|
|
|
+ export class MinMaxReducer {
|
|
|
+ /**
|
|
|
+ * Observable triggered when the computation has been performed
|
|
|
+ */
|
|
|
+ onAfterReductionPerformed: Observable<{
|
|
|
+ min: number;
|
|
|
+ max: number;
|
|
|
+ }>;
|
|
|
+ protected _camera: Camera;
|
|
|
+ protected _sourceTexture: Nullable<RenderTargetTexture>;
|
|
|
+ protected _reductionSteps: Nullable<Array<PostProcess>>;
|
|
|
+ protected _postProcessManager: PostProcessManager;
|
|
|
+ protected _onAfterUnbindObserver: Nullable<Observer<RenderTargetTexture>>;
|
|
|
+ protected _forceFullscreenViewport: boolean;
|
|
|
+ /**
|
|
|
+ * Creates a min/max reducer
|
|
|
+ * @param camera The camera to use for the post processes
|
|
|
+ */
|
|
|
+ constructor(camera: Camera);
|
|
|
+ /**
|
|
|
+ * Gets the texture used to read the values from.
|
|
|
+ */
|
|
|
+ get sourceTexture(): Nullable<RenderTargetTexture>;
|
|
|
+ /**
|
|
|
+ * Sets the source texture to read the values from.
|
|
|
+ * One must indicate if the texture is a depth texture or not through the depthRedux parameter
|
|
|
+ * because in such textures '1' value must not be taken into account to compute the maximum
|
|
|
+ * as this value is used to clear the texture.
|
|
|
+ * Note that the computation is not activated by calling this function, you must call activate() for that!
|
|
|
+ * @param sourceTexture The texture to read the values from. The values should be in the red channel.
|
|
|
+ * @param depthRedux Indicates if the texture is a depth texture or not
|
|
|
+ * @param type The type of the textures created for the reduction (defaults to TEXTURETYPE_HALF_FLOAT)
|
|
|
+ * @param forceFullscreenViewport Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)
|
|
|
+ */
|
|
|
+ setSourceTexture(sourceTexture: RenderTargetTexture, depthRedux: boolean, type?: number, forceFullscreenViewport?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Defines the refresh rate of the computation.
|
|
|
+ * Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...
|
|
|
+ */
|
|
|
+ get refreshRate(): number;
|
|
|
+ set refreshRate(value: number);
|
|
|
+ protected _activated: boolean;
|
|
|
+ /**
|
|
|
+ * Gets the activation status of the reducer
|
|
|
+ */
|
|
|
+ get activated(): boolean;
|
|
|
+ /**
|
|
|
+ * Activates the reduction computation.
|
|
|
+ * When activated, the observers registered in onAfterReductionPerformed are
|
|
|
+ * called after the compuation is performed
|
|
|
+ */
|
|
|
+ activate(): void;
|
|
|
+ /**
|
|
|
+ * Deactivates the reduction computation.
|
|
|
+ */
|
|
|
+ deactivate(): void;
|
|
|
+ /**
|
|
|
+ * Disposes the min/max reducer
|
|
|
+ * @param disposeAll true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.
|
|
|
+ */
|
|
|
+ dispose(disposeAll?: boolean): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs/Misc/depthReducer" {
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
+ import { RenderTargetTexture } from "babylonjs/Materials/Textures/renderTargetTexture";
|
|
|
+ import { Camera } from "babylonjs/Cameras/camera";
|
|
|
+ import { DepthRenderer } from "babylonjs/Rendering/depthRenderer";
|
|
|
+ import { MinMaxReducer } from "babylonjs/Misc/minMaxReducer";
|
|
|
+ /**
|
|
|
+ * This class is a small wrapper around the MinMaxReducer class to compute the min/max values of a depth texture
|
|
|
+ */
|
|
|
+ export class DepthReducer extends MinMaxReducer {
|
|
|
+ private _depthRenderer;
|
|
|
+ private _depthRendererId;
|
|
|
+ /**
|
|
|
+ * Gets the depth renderer used for the computation.
|
|
|
+ * Note that the result is null if you provide your own renderer when calling setDepthRenderer.
|
|
|
+ */
|
|
|
+ get depthRenderer(): Nullable<DepthRenderer>;
|
|
|
+ /**
|
|
|
+ * Creates a depth reducer
|
|
|
+ * @param camera The camera used to render the depth texture
|
|
|
+ */
|
|
|
+ constructor(camera: Camera);
|
|
|
+ /**
|
|
|
+ * Sets the depth renderer to use to generate the depth map
|
|
|
+ * @param depthRenderer The depth renderer to use. If not provided, a new one will be created automatically
|
|
|
+ * @param type The texture type of the depth map (default: TEXTURETYPE_HALF_FLOAT)
|
|
|
+ * @param forceFullscreenViewport Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)
|
|
|
+ */
|
|
|
+ setDepthRenderer(depthRenderer?: Nullable<DepthRenderer>, type?: number, forceFullscreenViewport?: boolean): void;
|
|
|
+ /** @hidden */
|
|
|
+ setSourceTexture(sourceTexture: RenderTargetTexture, depthRedux: boolean, type?: number, forceFullscreenViewport?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Activates the reduction computation.
|
|
|
+ * When activated, the observers registered in onAfterReductionPerformed are
|
|
|
+ * called after the compuation is performed
|
|
|
+ */
|
|
|
+ activate(): void;
|
|
|
+ /**
|
|
|
+ * Deactivates the reduction computation.
|
|
|
+ */
|
|
|
+ deactivate(): void;
|
|
|
+ /**
|
|
|
+ * Disposes the depth reducer
|
|
|
+ * @param disposeAll true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.
|
|
|
+ */
|
|
|
+ dispose(disposeAll?: boolean): void;
|
|
|
+ }
|
|
|
+}
|
|
|
declare module "babylonjs/Lights/Shadows/cascadedShadowGenerator" {
|
|
|
import { Nullable } from "babylonjs/types";
|
|
|
import { Scene } from "babylonjs/scene";
|
|
@@ -56412,6 +56670,7 @@ declare module "babylonjs/Lights/Shadows/cascadedShadowGenerator" {
|
|
|
import { IShadowGenerator } from "babylonjs/Lights/Shadows/shadowGenerator";
|
|
|
import { DirectionalLight } from "babylonjs/Lights/directionalLight";
|
|
|
import { BoundingInfo } from "babylonjs/Culling/boundingInfo";
|
|
|
+ import { DepthRenderer } from "babylonjs/Rendering/depthRenderer";
|
|
|
/**
|
|
|
* A CSM implementation allowing casting shadows on large scenes.
|
|
|
* Documentation : https://doc.babylonjs.com/babylon101/cascadedShadows
|
|
@@ -56770,6 +57029,38 @@ declare module "babylonjs/Lights/Shadows/cascadedShadowGenerator" {
|
|
|
* @returns the cascade view matrix
|
|
|
*/
|
|
|
getCascadeViewMatrix(cascadeNum: number): Nullable<Matrix>;
|
|
|
+ private _depthRenderer;
|
|
|
+ /**
|
|
|
+ * Sets the depth renderer to use when autoCalcDepthBounds is enabled.
|
|
|
+ *
|
|
|
+ * Note that if no depth renderer is set, a new one will be automatically created internally when necessary.
|
|
|
+ *
|
|
|
+ * You should call this function if you already have a depth renderer enabled in your scene, to avoid
|
|
|
+ * doing multiple depth rendering each frame. If you provide your own depth renderer, make sure it stores linear depth!
|
|
|
+ * @param depthRenderer The depth renderer to use when autoCalcDepthBounds is enabled. If you pass null or don't call this function at all, a depth renderer will be automatically created
|
|
|
+ */
|
|
|
+ setDepthRenderer(depthRenderer: Nullable<DepthRenderer>): void;
|
|
|
+ private _depthReducer;
|
|
|
+ private _autoCalcDepthBounds;
|
|
|
+ /**
|
|
|
+ * Gets or sets the autoCalcDepthBounds property.
|
|
|
+ *
|
|
|
+ * When enabled, a depth rendering pass is first performed (with an internally created depth renderer or with the one
|
|
|
+ * you provide by calling setDepthRenderer). Then, a min/max reducing is applied on the depth map to compute the
|
|
|
+ * minimal and maximal depth of the map and those values are used as inputs for the setMinMaxDistance() function.
|
|
|
+ * It can greatly enhance the shadow quality, at the expense of more GPU works.
|
|
|
+ * When using this option, you should increase the value of the lambda parameter, and even set it to 1 for best results.
|
|
|
+ */
|
|
|
+ get autoCalcDepthBounds(): boolean;
|
|
|
+ set autoCalcDepthBounds(value: boolean);
|
|
|
+ /**
|
|
|
+ * Defines the refresh rate of the min/max computation used when autoCalcDepthBounds is set to true
|
|
|
+ * Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...
|
|
|
+ * Note that if you provided your own depth renderer through a call to setDepthRenderer, you are responsible
|
|
|
+ * for setting the refresh rate on the renderer yourself!
|
|
|
+ */
|
|
|
+ get autoCalcDepthBoundsRefreshRate(): number;
|
|
|
+ set autoCalcDepthBoundsRefreshRate(value: number);
|
|
|
/**
|
|
|
* Create the cascade breaks according to the lambda, shadowMaxZ and min/max distance properties, as well as the camera near and far planes.
|
|
|
* This function is automatically called when updating lambda, shadowMaxZ and min/max distances, however you should call it yourself if
|
|
@@ -69461,20 +69752,6 @@ declare module "babylonjs/PostProcesses/tonemapPostProcess" {
|
|
|
exposureAdjustment: number, camera: Camera, samplingMode?: number, engine?: Engine, textureFormat?: number);
|
|
|
}
|
|
|
}
|
|
|
-declare module "babylonjs/Shaders/depth.vertex" {
|
|
|
- import "babylonjs/Shaders/ShadersInclude/bonesDeclaration";
|
|
|
- import "babylonjs/Shaders/ShadersInclude/morphTargetsVertexGlobalDeclaration";
|
|
|
- import "babylonjs/Shaders/ShadersInclude/morphTargetsVertexDeclaration";
|
|
|
- import "babylonjs/Shaders/ShadersInclude/instancesDeclaration";
|
|
|
- import "babylonjs/Shaders/ShadersInclude/morphTargetsVertex";
|
|
|
- import "babylonjs/Shaders/ShadersInclude/instancesVertex";
|
|
|
- import "babylonjs/Shaders/ShadersInclude/bonesVertex";
|
|
|
- /** @hidden */
|
|
|
- export var depthVertexShader: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
declare module "babylonjs/Shaders/volumetricLightScattering.fragment" {
|
|
|
/** @hidden */
|
|
|
export var volumetricLightScatteringPixelShader: {
|
|
@@ -69769,70 +70046,6 @@ declare module "babylonjs/Rendering/boundingBoxRenderer" {
|
|
|
dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
-declare module "babylonjs/Shaders/depth.fragment" {
|
|
|
- import "babylonjs/Shaders/ShadersInclude/packingFunctions";
|
|
|
- /** @hidden */
|
|
|
- export var depthPixelShader: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
-declare module "babylonjs/Rendering/depthRenderer" {
|
|
|
- import { Nullable } from "babylonjs/types";
|
|
|
- import { SubMesh } from "babylonjs/Meshes/subMesh";
|
|
|
- import { Scene } from "babylonjs/scene";
|
|
|
- import { RenderTargetTexture } from "babylonjs/Materials/Textures/renderTargetTexture";
|
|
|
- import { Camera } from "babylonjs/Cameras/camera";
|
|
|
- import "babylonjs/Shaders/depth.fragment";
|
|
|
- import "babylonjs/Shaders/depth.vertex";
|
|
|
- /**
|
|
|
- * This represents a depth renderer in Babylon.
|
|
|
- * A depth renderer will render to it's depth map every frame which can be displayed or used in post processing
|
|
|
- */
|
|
|
- export class DepthRenderer {
|
|
|
- private _scene;
|
|
|
- private _depthMap;
|
|
|
- private _effect;
|
|
|
- private readonly _storeNonLinearDepth;
|
|
|
- private readonly _clearColor;
|
|
|
- /** Get if the depth renderer is using packed depth or not */
|
|
|
- readonly isPacked: boolean;
|
|
|
- private _cachedDefines;
|
|
|
- private _camera;
|
|
|
- /**
|
|
|
- * Specifiess that the depth renderer will only be used within
|
|
|
- * the camera it is created for.
|
|
|
- * This can help forcing its rendering during the camera processing.
|
|
|
- */
|
|
|
- useOnlyInActiveCamera: boolean;
|
|
|
- /** @hidden */
|
|
|
- static _SceneComponentInitialization: (scene: Scene) => void;
|
|
|
- /**
|
|
|
- * Instantiates a depth renderer
|
|
|
- * @param scene The scene the renderer belongs to
|
|
|
- * @param type The texture type of the depth map (default: Engine.TEXTURETYPE_FLOAT)
|
|
|
- * @param camera The camera to be used to render the depth map (default: scene's active camera)
|
|
|
- * @param storeNonLinearDepth Defines whether the depth is stored linearly like in Babylon Shadows or directly like glFragCoord.z
|
|
|
- */
|
|
|
- constructor(scene: Scene, type?: number, camera?: Nullable<Camera>, storeNonLinearDepth?: boolean);
|
|
|
- /**
|
|
|
- * Creates the depth rendering effect and checks if the effect is ready.
|
|
|
- * @param subMesh The submesh to be used to render the depth map of
|
|
|
- * @param useInstances If multiple world instances should be used
|
|
|
- * @returns if the depth renderer is ready to render the depth map
|
|
|
- */
|
|
|
- isReady(subMesh: SubMesh, useInstances: boolean): boolean;
|
|
|
- /**
|
|
|
- * Gets the texture which the depth map will be written to.
|
|
|
- * @returns The depth map texture
|
|
|
- */
|
|
|
- getDepthMap(): RenderTargetTexture;
|
|
|
- /**
|
|
|
- * Disposes of the depth renderer.
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
declare module "babylonjs/Rendering/depthRendererSceneComponent" {
|
|
|
import { Nullable } from "babylonjs/types";
|
|
|
import { Scene } from "babylonjs/scene";
|
|
@@ -72077,6 +72290,8 @@ declare module "babylonjs/Misc/index" {
|
|
|
export * from "babylonjs/Misc/fileTools";
|
|
|
export * from "babylonjs/Misc/stringTools";
|
|
|
export * from "babylonjs/Misc/dataReader";
|
|
|
+ export * from "babylonjs/Misc/minMaxReducer";
|
|
|
+ export * from "babylonjs/Misc/depthReducer";
|
|
|
}
|
|
|
declare module "babylonjs/index" {
|
|
|
export * from "babylonjs/abstractScene";
|
|
@@ -83593,9 +83808,9 @@ declare module BABYLON {
|
|
|
static readonly STEP_AFTERCAMERADRAW_EFFECTLAYER_DRAW: number;
|
|
|
static readonly STEP_AFTERCAMERADRAW_LAYER: number;
|
|
|
static readonly STEP_AFTERRENDER_AUDIO: number;
|
|
|
- static readonly STEP_GATHERRENDERTARGETS_SHADOWGENERATOR: number;
|
|
|
- static readonly STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER: number;
|
|
|
static readonly STEP_GATHERRENDERTARGETS_DEPTHRENDERER: number;
|
|
|
+ static readonly STEP_GATHERRENDERTARGETS_GEOMETRYBUFFERRENDERER: number;
|
|
|
+ static readonly STEP_GATHERRENDERTARGETS_SHADOWGENERATOR: number;
|
|
|
static readonly STEP_GATHERRENDERTARGETS_POSTPROCESSRENDERPIPELINEMANAGER: number;
|
|
|
static readonly STEP_GATHERACTIVECAMERARENDERTARGETS_DEPTHRENDERER: number;
|
|
|
static readonly STEP_POINTERMOVE_SPRITE: number;
|
|
@@ -91601,7 +91816,7 @@ declare module BABYLON {
|
|
|
*
|
|
|
* Returns the clone.
|
|
|
*/
|
|
|
- clone(name: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean): Nullable<AbstractMesh>;
|
|
|
+ clone(name: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean): InstancedMesh;
|
|
|
/**
|
|
|
* Disposes the InstancedMesh.
|
|
|
* Returns nothing.
|
|
@@ -92051,7 +92266,7 @@ declare module BABYLON {
|
|
|
/**
|
|
|
* Returns a new LineMesh object cloned from the current one.
|
|
|
*/
|
|
|
- clone(name: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean): Nullable<AbstractMesh>;
|
|
|
+ clone(name: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean): LinesMesh;
|
|
|
/**
|
|
|
* Creates a new InstancedLinesMesh object from the mesh model.
|
|
|
* @see http://doc.babylonjs.com/how_to/how_to_use_instances
|
|
@@ -96951,7 +97166,7 @@ declare module BABYLON {
|
|
|
* @param clonePhysicsImpostor allows/denies the cloning in the same time of the original mesh `body` used by the physics engine, if any (default `true`)
|
|
|
* @returns a new mesh
|
|
|
*/
|
|
|
- clone(name?: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean, clonePhysicsImpostor?: boolean): Nullable<AbstractMesh>;
|
|
|
+ clone(name?: string, newParent?: Nullable<Node>, doNotCloneChildren?: boolean, clonePhysicsImpostor?: boolean): Mesh;
|
|
|
/**
|
|
|
* Releases resources associated with this mesh.
|
|
|
* @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
|
|
@@ -115989,7 +116204,6 @@ declare module BABYLON {
|
|
|
* Pointer which can be used to select objects or attach a visible laser to
|
|
|
*/
|
|
|
pointer: AbstractMesh;
|
|
|
- private _gamepadMode;
|
|
|
/**
|
|
|
* If available, this is the gamepad object related to this controller.
|
|
|
* Using this object it is possible to get click events and trackpad changes of the
|
|
@@ -116119,6 +116333,29 @@ declare module BABYLON {
|
|
|
* Different button type to use instead of the main component
|
|
|
*/
|
|
|
overrideButtonId?: string;
|
|
|
+ /**
|
|
|
+ * The amount of time in miliseconds it takes between pick found something to a pointer down event.
|
|
|
+ * Used in gaze modes. Tracked pointer uses the trigger, screen uses touch events
|
|
|
+ * 3000 means 3 seconds between pointing at something and selecting it
|
|
|
+ */
|
|
|
+ timeToSelect?: number;
|
|
|
+ /**
|
|
|
+ * Disable the pointer up event when the xr controller in screen and gaze mode is disposed (meaning - when the user removed the finger from the screen)
|
|
|
+ * If not disabled, the last picked point will be used to execute a pointer up event
|
|
|
+ * If disabled, pointer up event will be triggered right after the pointer down event.
|
|
|
+ * Used in screen and gaze target ray mode only
|
|
|
+ */
|
|
|
+ disablePointerUpOnTouchOut: boolean;
|
|
|
+ /**
|
|
|
+ * For gaze mode (time to select instead of press)
|
|
|
+ */
|
|
|
+ forceGazeMode: boolean;
|
|
|
+ /**
|
|
|
+ * Factor to be applied to the pointer-moved function in the gaze mode. How sensitive should the gaze mode be when checking if the pointer moved
|
|
|
+ * to start a new countdown to the pointer down event.
|
|
|
+ * Defaults to 1.
|
|
|
+ */
|
|
|
+ gazeModePointerMovedFactor?: number;
|
|
|
}
|
|
|
/**
|
|
|
* A module that will enable pointer selection for motion controllers of XR Input Sources
|
|
@@ -116139,11 +116376,11 @@ declare module BABYLON {
|
|
|
/**
|
|
|
* This color will be set to the laser pointer when selection is triggered
|
|
|
*/
|
|
|
- onPickedLaserPointerColor: Color3;
|
|
|
+ laserPointerPickedColor: Color3;
|
|
|
/**
|
|
|
* This color will be applied to the selection ring when selection is triggered
|
|
|
*/
|
|
|
- onPickedSelectionMeshColor: Color3;
|
|
|
+ selectionMeshPickedColor: Color3;
|
|
|
/**
|
|
|
* default color of the selection ring
|
|
|
*/
|
|
@@ -116182,7 +116419,19 @@ declare module BABYLON {
|
|
|
* @returns true if successful.
|
|
|
*/
|
|
|
detach(): boolean;
|
|
|
+ /**
|
|
|
+ * Get the xr controller that correlates to the pointer id in the pointer event
|
|
|
+ *
|
|
|
+ * @param id the pointer id to search for
|
|
|
+ * @returns the controller that correlates to this id or null if not found
|
|
|
+ */
|
|
|
+ getXRControllerByPointerId(id: number): Nullable<WebXRController>;
|
|
|
private _attachController;
|
|
|
+ private _attachScreenRayMode;
|
|
|
+ private _attachGazeMode;
|
|
|
+ private _tmpVectorForPickCompare;
|
|
|
+ private _pickingMoved;
|
|
|
+ private _attachTrackedPointerRayMode;
|
|
|
private _detachController;
|
|
|
private _generateNewMeshPair;
|
|
|
private _convertNormalToDirectionOfRay;
|
|
@@ -116407,6 +116656,15 @@ declare module BABYLON {
|
|
|
*/
|
|
|
disableAnimation?: boolean;
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Disable using the thumbstick and use the main component (usuallly trigger) on long press.
|
|
|
+ * This will be automatically true if the controller doesnt have a thumbstick or touchpad.
|
|
|
+ */
|
|
|
+ useMainComponentOnly?: boolean;
|
|
|
+ /**
|
|
|
+ * If main component is used (no thumbstick), how long should the "long press" take before teleporting
|
|
|
+ */
|
|
|
+ timeToTeleport?: number;
|
|
|
}
|
|
|
/**
|
|
|
* This is a teleportation feature to be used with webxr-enabled motion controllers.
|
|
@@ -116509,6 +116767,7 @@ declare module BABYLON {
|
|
|
dispose(): void;
|
|
|
private _currentTeleportationControllerId;
|
|
|
private _attachController;
|
|
|
+ private _teleportForward;
|
|
|
private _detachController;
|
|
|
private createDefaultTargetMesh;
|
|
|
private setTargetMeshVisibility;
|
|
@@ -126221,6 +126480,191 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export var depthPixelShader: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export var depthVertexShader: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * This represents a depth renderer in Babylon.
|
|
|
+ * A depth renderer will render to it's depth map every frame which can be displayed or used in post processing
|
|
|
+ */
|
|
|
+ export class DepthRenderer {
|
|
|
+ private _scene;
|
|
|
+ private _depthMap;
|
|
|
+ private _effect;
|
|
|
+ private readonly _storeNonLinearDepth;
|
|
|
+ private readonly _clearColor;
|
|
|
+ /** Get if the depth renderer is using packed depth or not */
|
|
|
+ readonly isPacked: boolean;
|
|
|
+ private _cachedDefines;
|
|
|
+ private _camera;
|
|
|
+ /** Enable or disable the depth renderer. When disabled, the depth texture is not updated */
|
|
|
+ enabled: boolean;
|
|
|
+ /**
|
|
|
+ * Specifiess that the depth renderer will only be used within
|
|
|
+ * the camera it is created for.
|
|
|
+ * This can help forcing its rendering during the camera processing.
|
|
|
+ */
|
|
|
+ useOnlyInActiveCamera: boolean;
|
|
|
+ /** @hidden */
|
|
|
+ static _SceneComponentInitialization: (scene: Scene) => void;
|
|
|
+ /**
|
|
|
+ * Instantiates a depth renderer
|
|
|
+ * @param scene The scene the renderer belongs to
|
|
|
+ * @param type The texture type of the depth map (default: Engine.TEXTURETYPE_FLOAT)
|
|
|
+ * @param camera The camera to be used to render the depth map (default: scene's active camera)
|
|
|
+ * @param storeNonLinearDepth Defines whether the depth is stored linearly like in Babylon Shadows or directly like glFragCoord.z
|
|
|
+ */
|
|
|
+ constructor(scene: Scene, type?: number, camera?: Nullable<Camera>, storeNonLinearDepth?: boolean);
|
|
|
+ /**
|
|
|
+ * Creates the depth rendering effect and checks if the effect is ready.
|
|
|
+ * @param subMesh The submesh to be used to render the depth map of
|
|
|
+ * @param useInstances If multiple world instances should be used
|
|
|
+ * @returns if the depth renderer is ready to render the depth map
|
|
|
+ */
|
|
|
+ isReady(subMesh: SubMesh, useInstances: boolean): boolean;
|
|
|
+ /**
|
|
|
+ * Gets the texture which the depth map will be written to.
|
|
|
+ * @returns The depth map texture
|
|
|
+ */
|
|
|
+ getDepthMap(): RenderTargetTexture;
|
|
|
+ /**
|
|
|
+ * Disposes of the depth renderer.
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export var minmaxReduxPixelShader: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * This class computes a min/max reduction from a texture: it means it computes the minimum
|
|
|
+ * and maximum values from all values of the texture.
|
|
|
+ * It is performed on the GPU for better performances, thanks to a succession of post processes.
|
|
|
+ * The source values are read from the red channel of the texture.
|
|
|
+ */
|
|
|
+ export class MinMaxReducer {
|
|
|
+ /**
|
|
|
+ * Observable triggered when the computation has been performed
|
|
|
+ */
|
|
|
+ onAfterReductionPerformed: Observable<{
|
|
|
+ min: number;
|
|
|
+ max: number;
|
|
|
+ }>;
|
|
|
+ protected _camera: Camera;
|
|
|
+ protected _sourceTexture: Nullable<RenderTargetTexture>;
|
|
|
+ protected _reductionSteps: Nullable<Array<PostProcess>>;
|
|
|
+ protected _postProcessManager: PostProcessManager;
|
|
|
+ protected _onAfterUnbindObserver: Nullable<Observer<RenderTargetTexture>>;
|
|
|
+ protected _forceFullscreenViewport: boolean;
|
|
|
+ /**
|
|
|
+ * Creates a min/max reducer
|
|
|
+ * @param camera The camera to use for the post processes
|
|
|
+ */
|
|
|
+ constructor(camera: Camera);
|
|
|
+ /**
|
|
|
+ * Gets the texture used to read the values from.
|
|
|
+ */
|
|
|
+ get sourceTexture(): Nullable<RenderTargetTexture>;
|
|
|
+ /**
|
|
|
+ * Sets the source texture to read the values from.
|
|
|
+ * One must indicate if the texture is a depth texture or not through the depthRedux parameter
|
|
|
+ * because in such textures '1' value must not be taken into account to compute the maximum
|
|
|
+ * as this value is used to clear the texture.
|
|
|
+ * Note that the computation is not activated by calling this function, you must call activate() for that!
|
|
|
+ * @param sourceTexture The texture to read the values from. The values should be in the red channel.
|
|
|
+ * @param depthRedux Indicates if the texture is a depth texture or not
|
|
|
+ * @param type The type of the textures created for the reduction (defaults to TEXTURETYPE_HALF_FLOAT)
|
|
|
+ * @param forceFullscreenViewport Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)
|
|
|
+ */
|
|
|
+ setSourceTexture(sourceTexture: RenderTargetTexture, depthRedux: boolean, type?: number, forceFullscreenViewport?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Defines the refresh rate of the computation.
|
|
|
+ * Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...
|
|
|
+ */
|
|
|
+ get refreshRate(): number;
|
|
|
+ set refreshRate(value: number);
|
|
|
+ protected _activated: boolean;
|
|
|
+ /**
|
|
|
+ * Gets the activation status of the reducer
|
|
|
+ */
|
|
|
+ get activated(): boolean;
|
|
|
+ /**
|
|
|
+ * Activates the reduction computation.
|
|
|
+ * When activated, the observers registered in onAfterReductionPerformed are
|
|
|
+ * called after the compuation is performed
|
|
|
+ */
|
|
|
+ activate(): void;
|
|
|
+ /**
|
|
|
+ * Deactivates the reduction computation.
|
|
|
+ */
|
|
|
+ deactivate(): void;
|
|
|
+ /**
|
|
|
+ * Disposes the min/max reducer
|
|
|
+ * @param disposeAll true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.
|
|
|
+ */
|
|
|
+ dispose(disposeAll?: boolean): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * This class is a small wrapper around the MinMaxReducer class to compute the min/max values of a depth texture
|
|
|
+ */
|
|
|
+ export class DepthReducer extends MinMaxReducer {
|
|
|
+ private _depthRenderer;
|
|
|
+ private _depthRendererId;
|
|
|
+ /**
|
|
|
+ * Gets the depth renderer used for the computation.
|
|
|
+ * Note that the result is null if you provide your own renderer when calling setDepthRenderer.
|
|
|
+ */
|
|
|
+ get depthRenderer(): Nullable<DepthRenderer>;
|
|
|
+ /**
|
|
|
+ * Creates a depth reducer
|
|
|
+ * @param camera The camera used to render the depth texture
|
|
|
+ */
|
|
|
+ constructor(camera: Camera);
|
|
|
+ /**
|
|
|
+ * Sets the depth renderer to use to generate the depth map
|
|
|
+ * @param depthRenderer The depth renderer to use. If not provided, a new one will be created automatically
|
|
|
+ * @param type The texture type of the depth map (default: TEXTURETYPE_HALF_FLOAT)
|
|
|
+ * @param forceFullscreenViewport Forces the post processes used for the reduction to be applied without taking into account viewport (defaults to true)
|
|
|
+ */
|
|
|
+ setDepthRenderer(depthRenderer?: Nullable<DepthRenderer>, type?: number, forceFullscreenViewport?: boolean): void;
|
|
|
+ /** @hidden */
|
|
|
+ setSourceTexture(sourceTexture: RenderTargetTexture, depthRedux: boolean, type?: number, forceFullscreenViewport?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Activates the reduction computation.
|
|
|
+ * When activated, the observers registered in onAfterReductionPerformed are
|
|
|
+ * called after the compuation is performed
|
|
|
+ */
|
|
|
+ activate(): void;
|
|
|
+ /**
|
|
|
+ * Deactivates the reduction computation.
|
|
|
+ */
|
|
|
+ deactivate(): void;
|
|
|
+ /**
|
|
|
+ * Disposes the depth reducer
|
|
|
+ * @param disposeAll true to dispose all the resources. You should always call this function with true as the parameter (or without any parameter as it is the default one). This flag is meant to be used internally.
|
|
|
+ */
|
|
|
+ dispose(disposeAll?: boolean): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
/**
|
|
|
* A CSM implementation allowing casting shadows on large scenes.
|
|
|
* Documentation : https://doc.babylonjs.com/babylon101/cascadedShadows
|
|
@@ -126579,6 +127023,38 @@ declare module BABYLON {
|
|
|
* @returns the cascade view matrix
|
|
|
*/
|
|
|
getCascadeViewMatrix(cascadeNum: number): Nullable<Matrix>;
|
|
|
+ private _depthRenderer;
|
|
|
+ /**
|
|
|
+ * Sets the depth renderer to use when autoCalcDepthBounds is enabled.
|
|
|
+ *
|
|
|
+ * Note that if no depth renderer is set, a new one will be automatically created internally when necessary.
|
|
|
+ *
|
|
|
+ * You should call this function if you already have a depth renderer enabled in your scene, to avoid
|
|
|
+ * doing multiple depth rendering each frame. If you provide your own depth renderer, make sure it stores linear depth!
|
|
|
+ * @param depthRenderer The depth renderer to use when autoCalcDepthBounds is enabled. If you pass null or don't call this function at all, a depth renderer will be automatically created
|
|
|
+ */
|
|
|
+ setDepthRenderer(depthRenderer: Nullable<DepthRenderer>): void;
|
|
|
+ private _depthReducer;
|
|
|
+ private _autoCalcDepthBounds;
|
|
|
+ /**
|
|
|
+ * Gets or sets the autoCalcDepthBounds property.
|
|
|
+ *
|
|
|
+ * When enabled, a depth rendering pass is first performed (with an internally created depth renderer or with the one
|
|
|
+ * you provide by calling setDepthRenderer). Then, a min/max reducing is applied on the depth map to compute the
|
|
|
+ * minimal and maximal depth of the map and those values are used as inputs for the setMinMaxDistance() function.
|
|
|
+ * It can greatly enhance the shadow quality, at the expense of more GPU works.
|
|
|
+ * When using this option, you should increase the value of the lambda parameter, and even set it to 1 for best results.
|
|
|
+ */
|
|
|
+ get autoCalcDepthBounds(): boolean;
|
|
|
+ set autoCalcDepthBounds(value: boolean);
|
|
|
+ /**
|
|
|
+ * Defines the refresh rate of the min/max computation used when autoCalcDepthBounds is set to true
|
|
|
+ * Use 0 to compute just once, 1 to compute on every frame, 2 to compute every two frames and so on...
|
|
|
+ * Note that if you provided your own depth renderer through a call to setDepthRenderer, you are responsible
|
|
|
+ * for setting the refresh rate on the renderer yourself!
|
|
|
+ */
|
|
|
+ get autoCalcDepthBoundsRefreshRate(): number;
|
|
|
+ set autoCalcDepthBoundsRefreshRate(value: number);
|
|
|
/**
|
|
|
* Create the cascade breaks according to the lambda, shadowMaxZ and min/max distance properties, as well as the camera near and far planes.
|
|
|
* This function is automatically called when updating lambda, shadowMaxZ and min/max distances, however you should call it yourself if
|
|
@@ -138195,13 +138671,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/** @hidden */
|
|
|
- export var depthVertexShader: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /** @hidden */
|
|
|
export var volumetricLightScatteringPixelShader: {
|
|
|
name: string;
|
|
|
shader: string;
|
|
@@ -138426,62 +138895,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
- /** @hidden */
|
|
|
- export var depthPixelShader: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
- * This represents a depth renderer in Babylon.
|
|
|
- * A depth renderer will render to it's depth map every frame which can be displayed or used in post processing
|
|
|
- */
|
|
|
- export class DepthRenderer {
|
|
|
- private _scene;
|
|
|
- private _depthMap;
|
|
|
- private _effect;
|
|
|
- private readonly _storeNonLinearDepth;
|
|
|
- private readonly _clearColor;
|
|
|
- /** Get if the depth renderer is using packed depth or not */
|
|
|
- readonly isPacked: boolean;
|
|
|
- private _cachedDefines;
|
|
|
- private _camera;
|
|
|
- /**
|
|
|
- * Specifiess that the depth renderer will only be used within
|
|
|
- * the camera it is created for.
|
|
|
- * This can help forcing its rendering during the camera processing.
|
|
|
- */
|
|
|
- useOnlyInActiveCamera: boolean;
|
|
|
- /** @hidden */
|
|
|
- static _SceneComponentInitialization: (scene: Scene) => void;
|
|
|
- /**
|
|
|
- * Instantiates a depth renderer
|
|
|
- * @param scene The scene the renderer belongs to
|
|
|
- * @param type The texture type of the depth map (default: Engine.TEXTURETYPE_FLOAT)
|
|
|
- * @param camera The camera to be used to render the depth map (default: scene's active camera)
|
|
|
- * @param storeNonLinearDepth Defines whether the depth is stored linearly like in Babylon Shadows or directly like glFragCoord.z
|
|
|
- */
|
|
|
- constructor(scene: Scene, type?: number, camera?: Nullable<Camera>, storeNonLinearDepth?: boolean);
|
|
|
- /**
|
|
|
- * Creates the depth rendering effect and checks if the effect is ready.
|
|
|
- * @param subMesh The submesh to be used to render the depth map of
|
|
|
- * @param useInstances If multiple world instances should be used
|
|
|
- * @returns if the depth renderer is ready to render the depth map
|
|
|
- */
|
|
|
- isReady(subMesh: SubMesh, useInstances: boolean): boolean;
|
|
|
- /**
|
|
|
- * Gets the texture which the depth map will be written to.
|
|
|
- * @returns The depth map texture
|
|
|
- */
|
|
|
- getDepthMap(): RenderTargetTexture;
|
|
|
- /**
|
|
|
- * Disposes of the depth renderer.
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
interface Scene {
|
|
|
/** @hidden (Backing field) */
|
|
|
_depthRenderer: {
|