@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
644 lines (643 loc) • 28.6 kB
TypeScript
import type { SmartArray } from "../../Misc/smartArray.js";
import type { Nullable } from "../../types.js";
import type { Scene } from "../../scene.js";
import { Matrix, Vector3 } from "../../Maths/math.vector.js";
import type { SubMesh } from "../../Meshes/subMesh.js";
import type { AbstractMesh } from "../../Meshes/abstractMesh.js";
import type { Mesh } from "../../Meshes/mesh.js";
import type { IShadowLight } from "../../Lights/shadowLight.js";
import type { MaterialDefines } from "../../Materials/materialDefines.js";
import type { Effect } from "../../Materials/effect.js";
import { RenderTargetTexture } from "../../Materials/Textures/renderTargetTexture.js";
import { PostProcess } from "../../PostProcesses/postProcess.js";
import { Observable } from "../../Misc/observable.js";
import type { UniformBuffer } from "../../Materials/uniformBuffer.js";
import type { Camera } from "../../Cameras/camera.js";
import type { BaseTexture } from "../../Materials/Textures/baseTexture.js";
import { ShaderLanguage } from "../../Materials/shaderLanguage.js";
/**
* Defines the options associated with the creation of a custom shader for a shadow generator.
*/
export interface ICustomShaderOptions {
/**
* Gets or sets the custom shader name to use
*/
shaderName: string;
/**
* The list of attribute names used in the shader
*/
attributes?: string[];
/**
* The list of uniform names used in the shader
*/
uniforms?: string[];
/**
* The list of sampler names used in the shader
*/
samplers?: string[];
/**
* The list of defines used in the shader
*/
defines?: string[];
}
/**
* Interface to implement to create a shadow generator compatible with BJS.
*/
export interface IShadowGenerator {
/** Gets or set the id of the shadow generator. It will be the one from the light if not defined */
id: string;
/**
* Specifies if the `ShadowGenerator` should be serialized, `true` to skip serialization.
* Note a `ShadowGenerator` will not be serialized if its light has `doNotSerialize=true`
*/
doNotSerialize?: boolean;
/**
* Gets the main RTT containing the shadow map (usually storing depth from the light point of view).
* @returns The render target texture if present otherwise, null
*/
getShadowMap(): Nullable<RenderTargetTexture>;
/**
* Determine whether the shadow generator is ready or not (mainly all effects and related post processes needs to be ready).
* @param subMesh The submesh we want to render in the shadow map
* @param useInstances Defines whether will draw in the map using instances
* @param isTransparent Indicates that isReady is called for a transparent subMesh
* @returns true if ready otherwise, false
*/
isReady(subMesh: SubMesh, useInstances: boolean, isTransparent: boolean): boolean;
/**
* Prepare all the defines in a material relying on a shadow map at the specified light index.
* @param defines Defines of the material we want to update
* @param lightIndex Index of the light in the enabled light list of the material
*/
prepareDefines(defines: MaterialDefines, lightIndex: number): void;
/**
* Binds the shadow related information inside of an effect (information like near, far, darkness...
* defined in the generator but impacting the effect).
* It implies the uniforms available on the materials are the standard BJS ones.
* @param lightIndex Index of the light in the enabled light list of the material owning the effect
* @param effect The effect we are binding the information for
*/
bindShadowLight(lightIndex: string, effect: Effect): void;
/**
* Gets the transformation matrix used to project the meshes into the map from the light point of view.
* (eq to shadow projection matrix * light transform matrix)
* @returns The transform matrix used to create the shadow map
*/
getTransformMatrix(): Matrix;
/**
* Recreates the shadow map dependencies like RTT and post processes. This can be used during the switch between
* Cube and 2D textures for instance.
*/
recreateShadowMap(): void;
/**
* Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.
* @param onCompiled Callback triggered at the and of the effects compilation
* @param options Sets of optional options forcing the compilation with different modes
*/
forceCompilation(onCompiled?: (generator: IShadowGenerator) => void, options?: Partial<{
useInstances: boolean;
}>): void;
/**
* Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.
* @param options Sets of optional options forcing the compilation with different modes
* @returns A promise that resolves when the compilation completes
*/
forceCompilationAsync(options?: Partial<{
useInstances: boolean;
}>): Promise<void>;
/**
* Serializes the shadow generator setup to a json object.
* @returns The serialized JSON object
*/
serialize(): any;
/**
* Disposes the Shadow map and related Textures and effects.
*/
dispose(): void;
}
/**
* Default implementation IShadowGenerator.
* This is the main object responsible of generating shadows in the framework.
* Documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
* @see [WebGL](https://playground.babylonjs.com/#IFYDRS#0)
* @see [WebGPU](https://playground.babylonjs.com/#IFYDRS#835)
*/
export declare class ShadowGenerator implements IShadowGenerator {
/**
* Name of the shadow generator class
*/
static CLASSNAME: string;
/**
* Force all the shadow generators to compile to glsl even on WebGPU engines.
* False by default. This is mostly meant for backward compatibility.
*/
static ForceGLSL: boolean;
/**
* Shadow generator mode None: no filtering applied.
*/
static readonly FILTER_NONE = 0;
/**
* Shadow generator mode ESM: Exponential Shadow Mapping.
* (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)
*/
static readonly FILTER_EXPONENTIALSHADOWMAP = 1;
/**
* Shadow generator mode Poisson Sampling: Percentage Closer Filtering.
* (Multiple Tap around evenly distributed around the pixel are used to evaluate the shadow strength)
*/
static readonly FILTER_POISSONSAMPLING = 2;
/**
* Shadow generator mode ESM: Blurred Exponential Shadow Mapping.
* (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)
*/
static readonly FILTER_BLUREXPONENTIALSHADOWMAP = 3;
/**
* Shadow generator mode ESM: Exponential Shadow Mapping using the inverse of the exponential preventing
* edge artifacts on steep falloff.
* (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)
*/
static readonly FILTER_CLOSEEXPONENTIALSHADOWMAP = 4;
/**
* Shadow generator mode ESM: Blurred Exponential Shadow Mapping using the inverse of the exponential preventing
* edge artifacts on steep falloff.
* (http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf)
*/
static readonly FILTER_BLURCLOSEEXPONENTIALSHADOWMAP = 5;
/**
* Shadow generator mode PCF: Percentage Closer Filtering
* benefits from Webgl 2 shadow samplers. Fallback to Poisson Sampling in Webgl 1
* (https://developer.nvidia.com/gpugems/GPUGems/gpugems_ch11.html)
*/
static readonly FILTER_PCF = 6;
/**
* Shadow generator mode PCSS: Percentage Closering Soft Shadow.
* benefits from Webgl 2 shadow samplers. Fallback to Poisson Sampling in Webgl 1
* Contact Hardening
*/
static readonly FILTER_PCSS = 7;
/**
* Reserved for PCF and PCSS
* Highest Quality.
*
* Execute PCF on a 5*5 kernel improving a lot the shadow aliasing artifacts.
*
* Execute PCSS with 32 taps blocker search and 64 taps PCF.
*/
static readonly QUALITY_HIGH = 0;
/**
* Reserved for PCF and PCSS
* Good tradeoff for quality/perf cross devices
*
* Execute PCF on a 3*3 kernel.
*
* Execute PCSS with 16 taps blocker search and 32 taps PCF.
*/
static readonly QUALITY_MEDIUM = 1;
/**
* Reserved for PCF and PCSS
* The lowest quality but the fastest.
*
* Execute PCF on a 1*1 kernel.
*
* Execute PCSS with 16 taps blocker search and 16 taps PCF.
*/
static readonly QUALITY_LOW = 2;
/**
* Defines the default alpha cutoff value used for transparent alpha tested materials.
*/
static DEFAULT_ALPHA_CUTOFF: number;
/** Gets or set the id of the shadow generator. It will be the one from the light if not defined */
id: string;
/** Gets or sets the custom shader name to use */
customShaderOptions: ICustomShaderOptions;
/** Gets or sets a custom function to allow/disallow rendering a sub mesh in the shadow map */
customAllowRendering: (subMesh: SubMesh) => boolean;
/**
* Observable triggered before the shadow is rendered. Can be used to update internal effect state
*/
onBeforeShadowMapRenderObservable: Observable<Effect>;
/**
* Observable triggered after the shadow is rendered. Can be used to restore internal effect state
*/
onAfterShadowMapRenderObservable: Observable<Effect>;
/**
* Observable triggered before a mesh is rendered in the shadow map.
* Can be used to update internal effect state (that you can get from the onBeforeShadowMapRenderObservable)
*/
onBeforeShadowMapRenderMeshObservable: Observable<Mesh>;
/**
* Observable triggered after a mesh is rendered in the shadow map.
* Can be used to update internal effect state (that you can get from the onAfterShadowMapRenderObservable)
*/
onAfterShadowMapRenderMeshObservable: Observable<Mesh>;
/**
* Specifies if the `ShadowGenerator` should be serialized, `true` to skip serialization.
* Note a `ShadowGenerator` will not be serialized if its light has `doNotSerialize=true`
*/
doNotSerialize: boolean;
protected _bias: number;
/**
* Gets the bias: offset applied on the depth preventing acnea (in light direction).
*/
get bias(): number;
/**
* Sets the bias: offset applied on the depth preventing acnea (in light direction).
*/
set bias(bias: number);
protected _normalBias: number;
/**
* Gets the normalBias: offset applied on the depth preventing acnea (along side the normal direction and proportional to the light/normal angle).
*/
get normalBias(): number;
/**
* Sets the normalBias: offset applied on the depth preventing acnea (along side the normal direction and proportional to the light/normal angle).
*/
set normalBias(normalBias: number);
protected _blurBoxOffset: number;
/**
* Gets the blur box offset: offset applied during the blur pass.
* Only useful if useKernelBlur = false
*/
get blurBoxOffset(): number;
/**
* Sets the blur box offset: offset applied during the blur pass.
* Only useful if useKernelBlur = false
*/
set blurBoxOffset(value: number);
protected _blurScale: number;
/**
* Gets the blur scale: scale of the blurred texture compared to the main shadow map.
* 2 means half of the size.
*/
get blurScale(): number;
/**
* Sets the blur scale: scale of the blurred texture compared to the main shadow map.
* 2 means half of the size.
*/
set blurScale(value: number);
protected _blurKernel: number;
/**
* Gets the blur kernel: kernel size of the blur pass.
* Only useful if useKernelBlur = true
*/
get blurKernel(): number;
/**
* Sets the blur kernel: kernel size of the blur pass.
* Only useful if useKernelBlur = true
*/
set blurKernel(value: number);
protected _useKernelBlur: boolean;
/**
* Gets whether the blur pass is a kernel blur (if true) or box blur.
* Only useful in filtered mode (useBlurExponentialShadowMap...)
*/
get useKernelBlur(): boolean;
/**
* Sets whether the blur pass is a kernel blur (if true) or box blur.
* Only useful in filtered mode (useBlurExponentialShadowMap...)
*/
set useKernelBlur(value: boolean);
protected _depthScale: number;
/**
* Gets the depth scale used in ESM mode.
*/
get depthScale(): number;
/**
* Sets the depth scale used in ESM mode.
* This can override the scale stored on the light.
*/
set depthScale(value: number);
protected _validateFilter(filter: number): number;
protected _filter: number;
/**
* Gets the current mode of the shadow generator (normal, PCF, ESM...).
* The returned value is a number equal to one of the available mode defined in ShadowMap.FILTER_x like _FILTER_NONE
*/
get filter(): number;
/**
* Sets the current mode of the shadow generator (normal, PCF, ESM...).
* The returned value is a number equal to one of the available mode defined in ShadowMap.FILTER_x like _FILTER_NONE
*/
set filter(value: number);
/**
* Gets if the current filter is set to Poisson Sampling.
*/
get usePoissonSampling(): boolean;
/**
* Sets the current filter to Poisson Sampling.
*/
set usePoissonSampling(value: boolean);
/**
* Gets if the current filter is set to ESM.
*/
get useExponentialShadowMap(): boolean;
/**
* Sets the current filter is to ESM.
*/
set useExponentialShadowMap(value: boolean);
/**
* Gets if the current filter is set to filtered ESM.
*/
get useBlurExponentialShadowMap(): boolean;
/**
* Gets if the current filter is set to filtered ESM.
*/
set useBlurExponentialShadowMap(value: boolean);
/**
* Gets if the current filter is set to "close ESM" (using the inverse of the
* exponential to prevent steep falloff artifacts).
*/
get useCloseExponentialShadowMap(): boolean;
/**
* Sets the current filter to "close ESM" (using the inverse of the
* exponential to prevent steep falloff artifacts).
*/
set useCloseExponentialShadowMap(value: boolean);
/**
* Gets if the current filter is set to filtered "close ESM" (using the inverse of the
* exponential to prevent steep falloff artifacts).
*/
get useBlurCloseExponentialShadowMap(): boolean;
/**
* Sets the current filter to filtered "close ESM" (using the inverse of the
* exponential to prevent steep falloff artifacts).
*/
set useBlurCloseExponentialShadowMap(value: boolean);
/**
* Gets if the current filter is set to "PCF" (percentage closer filtering).
*/
get usePercentageCloserFiltering(): boolean;
/**
* Sets the current filter to "PCF" (percentage closer filtering).
*/
set usePercentageCloserFiltering(value: boolean);
protected _filteringQuality: number;
/**
* Gets the PCF or PCSS Quality.
* Only valid if usePercentageCloserFiltering or usePercentageCloserFiltering is true.
*/
get filteringQuality(): number;
/**
* Sets the PCF or PCSS Quality.
* Only valid if usePercentageCloserFiltering or usePercentageCloserFiltering is true.
*/
set filteringQuality(filteringQuality: number);
/**
* Gets if the current filter is set to "PCSS" (contact hardening).
*/
get useContactHardeningShadow(): boolean;
/**
* Sets the current filter to "PCSS" (contact hardening).
*/
set useContactHardeningShadow(value: boolean);
protected _contactHardeningLightSizeUVRatio: number;
/**
* Gets the Light Size (in shadow map uv unit) used in PCSS to determine the blocker search area and the penumbra size.
* Using a ratio helps keeping shape stability independently of the map size.
*
* It does not account for the light projection as it was having too much
* instability during the light setup or during light position changes.
*
* Only valid if useContactHardeningShadow is true.
*/
get contactHardeningLightSizeUVRatio(): number;
/**
* Sets the Light Size (in shadow map uv unit) used in PCSS to determine the blocker search area and the penumbra size.
* Using a ratio helps keeping shape stability independently of the map size.
*
* It does not account for the light projection as it was having too much
* instability during the light setup or during light position changes.
*
* Only valid if useContactHardeningShadow is true.
*/
set contactHardeningLightSizeUVRatio(contactHardeningLightSizeUVRatio: number);
protected _darkness: number;
/** Gets or sets the actual darkness of a shadow */
get darkness(): number;
set darkness(value: number);
/**
* Returns the darkness value (float). This can only decrease the actual darkness of a shadow.
* 0 means strongest and 1 would means no shadow.
* @returns the darkness.
*/
getDarkness(): number;
/**
* Sets the darkness value (float). This can only decrease the actual darkness of a shadow.
* @param darkness The darkness value 0 means strongest and 1 would means no shadow.
* @returns the shadow generator allowing fluent coding.
*/
setDarkness(darkness: number): ShadowGenerator;
protected _transparencyShadow: boolean;
/** Gets or sets the ability to have transparent shadow */
get transparencyShadow(): boolean;
set transparencyShadow(value: boolean);
/**
* Sets the ability to have transparent shadow (boolean).
* @param transparent True if transparent else False
* @returns the shadow generator allowing fluent coding
*/
setTransparencyShadow(transparent: boolean): ShadowGenerator;
/**
* Enables or disables shadows with varying strength based on the transparency
* When it is enabled, the strength of the shadow is taken equal to mesh.visibility
* If you enabled an alpha texture on your material, the alpha value red from the texture is also combined to compute the strength:
* mesh.visibility * alphaTexture.a
* The texture used is the diffuse by default, but it can be set to the opacity by setting useOpacityTextureForTransparentShadow
* Note that by definition transparencyShadow must be set to true for enableSoftTransparentShadow to work!
*/
enableSoftTransparentShadow: boolean;
/**
* If this is true, use the opacity texture's alpha channel for transparent shadows instead of the diffuse one
*/
useOpacityTextureForTransparentShadow: boolean;
protected _shadowMap: Nullable<RenderTargetTexture>;
protected _shadowMap2: Nullable<RenderTargetTexture>;
/**
* Gets the main RTT containing the shadow map (usually storing depth from the light point of view).
* @returns The render target texture if present otherwise, null
*/
getShadowMap(): Nullable<RenderTargetTexture>;
/**
* Gets the RTT used during rendering (can be a blurred version of the shadow map or the shadow map itself).
* @returns The render target texture if the shadow map is present otherwise, null
*/
getShadowMapForRendering(): Nullable<RenderTargetTexture>;
/**
* Gets the class name of that object
* @returns "ShadowGenerator"
*/
getClassName(): string;
/**
* Helper function to add a mesh and its descendants to the list of shadow casters.
* @param mesh Mesh to add
* @param includeDescendants boolean indicating if the descendants should be added. Default to true
* @returns the Shadow Generator itself
*/
addShadowCaster(mesh: AbstractMesh, includeDescendants?: boolean): ShadowGenerator;
/**
* Helper function to remove a mesh and its descendants from the list of shadow casters
* @param mesh Mesh to remove
* @param includeDescendants boolean indicating if the descendants should be removed. Default to true
* @returns the Shadow Generator itself
*/
removeShadowCaster(mesh: AbstractMesh, includeDescendants?: boolean): ShadowGenerator;
/**
* Controls the extent to which the shadows fade out at the edge of the frustum
*/
frustumEdgeFalloff: number;
protected _light: IShadowLight;
/**
* Returns the associated light object.
* @returns the light generating the shadow
*/
getLight(): IShadowLight;
/** Shader language used by the generator */
protected _shaderLanguage: ShaderLanguage;
/**
* Gets the shader language used in this generator.
*/
get shaderLanguage(): ShaderLanguage;
/**
* If true the shadow map is generated by rendering the back face of the mesh instead of the front face.
* This can help with self-shadowing as the geometry making up the back of objects is slightly offset.
* It might on the other hand introduce peter panning.
*/
forceBackFacesOnly: boolean;
protected _camera: Nullable<Camera>;
protected _getCamera(): Nullable<Camera>;
protected _scene: Scene;
protected _useRedTextureType: boolean;
protected _lightDirection: Vector3;
protected _viewMatrix: Matrix;
protected _projectionMatrix: Matrix;
protected _transformMatrix: Matrix;
protected _cachedPosition: Vector3;
protected _cachedDirection: Vector3;
protected _cachedDefines: string;
protected _currentRenderId: number;
protected _boxBlurPostprocess: Nullable<PostProcess>;
protected _kernelBlurXPostprocess: Nullable<PostProcess>;
protected _kernelBlurYPostprocess: Nullable<PostProcess>;
protected _blurPostProcesses: PostProcess[];
protected _mapSize: number;
protected _currentFaceIndex: number;
protected _currentFaceIndexCache: number;
protected _textureType: number;
protected _defaultTextureMatrix: Matrix;
protected _storedUniqueId: Nullable<number>;
protected _useUBO: boolean;
protected _sceneUBOs: UniformBuffer[];
protected _currentSceneUBO: UniformBuffer;
protected _opacityTexture: Nullable<BaseTexture>;
/**
* @internal
*/
static _SceneComponentInitialization: (scene: Scene) => void;
/**
* Gets or sets the size of the texture what stores the shadows
*/
get mapSize(): number;
set mapSize(size: number);
/**
* Creates a ShadowGenerator object.
* A ShadowGenerator is the required tool to use the shadows.
* Each light casting shadows needs to use its own ShadowGenerator.
* Documentation : https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
* @param mapSize The size of the texture what stores the shadows. Example : 1024.
* @param light The light object generating the shadows.
* @param usefullFloatFirst By default the generator will try to use half float textures but if you need precision (for self shadowing for instance), you can use this option to enforce full float texture.
* @param camera Camera associated with this shadow generator (default: null). If null, takes the scene active camera at the time we need to access it
* @param useRedTextureType Forces the generator to use a Red instead of a RGBA type for the shadow map texture format (default: false)
* @param forceGLSL defines a boolean indicating if the shader must be compiled in GLSL even if we are using WebGPU
*/
constructor(mapSize: number, light: IShadowLight, usefullFloatFirst?: boolean, camera?: Nullable<Camera>, useRedTextureType?: boolean, forceGLSL?: boolean);
protected _initializeGenerator(): void;
protected _createTargetRenderTexture(): void;
protected _initializeShadowMap(): void;
private _shadersLoaded;
private _initShaderSourceAsync;
protected _initializeBlurRTTAndPostProcesses(): void;
protected _renderForShadowMap(opaqueSubMeshes: SmartArray<SubMesh>, alphaTestSubMeshes: SmartArray<SubMesh>, transparentSubMeshes: SmartArray<SubMesh>, depthOnlySubMeshes: SmartArray<SubMesh>): void;
protected _bindCustomEffectForRenderSubMeshForShadowMap(subMesh: SubMesh, effect: Effect, mesh: AbstractMesh): void;
protected _renderSubMeshForShadowMap(subMesh: SubMesh, isTransparent?: boolean): void;
protected _applyFilterValues(): void;
/**
* Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.
* @param onCompiled Callback triggered at the and of the effects compilation
* @param options Sets of optional options forcing the compilation with different modes
*/
forceCompilation(onCompiled?: (generator: IShadowGenerator) => void, options?: Partial<{
useInstances: boolean;
}>): void;
/**
* Forces all the attached effect to compile to enable rendering only once ready vs. lazily compiling effects.
* @param options Sets of optional options forcing the compilation with different modes
* @returns A promise that resolves when the compilation completes
*/
forceCompilationAsync(options?: Partial<{
useInstances: boolean;
}>): Promise<void>;
protected _isReadyCustomDefines(defines: any, subMesh: SubMesh, useInstances: boolean): void;
private _prepareShadowDefines;
/**
* Determine whether the shadow generator is ready or not (mainly all effects and related post processes needs to be ready).
* @param subMesh The submesh we want to render in the shadow map
* @param useInstances Defines whether will draw in the map using instances
* @param isTransparent Indicates that isReady is called for a transparent subMesh
* @returns true if ready otherwise, false
*/
isReady(subMesh: SubMesh, useInstances: boolean, isTransparent: boolean): boolean;
/**
* Prepare all the defines in a material relying on a shadow map at the specified light index.
* @param defines Defines of the material we want to update
* @param lightIndex Index of the light in the enabled light list of the material
*/
prepareDefines(defines: any, lightIndex: number): void;
/**
* Binds the shadow related information inside of an effect (information like near, far, darkness...
* defined in the generator but impacting the effect).
* @param lightIndex Index of the light in the enabled light list of the material owning the effect
* @param effect The effect we are binding the information for
*/
bindShadowLight(lightIndex: string, effect: Effect): void;
/**
* Gets the view matrix used to render the shadow map.
*/
get viewMatrix(): Matrix;
/**
* Gets the projection matrix used to render the shadow map.
*/
get projectionMatrix(): Matrix;
/**
* Gets the transformation matrix used to project the meshes into the map from the light point of view.
* (eq to shadow projection matrix * light transform matrix)
* @returns The transform matrix used to create the shadow map
*/
getTransformMatrix(): Matrix;
/**
* Recreates the shadow map dependencies like RTT and post processes. This can be used during the switch between
* Cube and 2D textures for instance.
*/
recreateShadowMap(): void;
protected _disposeBlurPostProcesses(): void;
protected _disposeRTTandPostProcesses(): void;
protected _disposeSceneUBOs(): void;
/**
* Disposes the ShadowGenerator.
* Returns nothing.
*/
dispose(): void;
/**
* Serializes the shadow generator setup to a json object.
* @returns The serialized JSON object
*/
serialize(): any;
/**
* Parses a serialized ShadowGenerator and returns a new ShadowGenerator.
* @param parsedShadowGenerator The JSON object to parse
* @param scene The scene to create the shadow map for
* @param constr A function that builds a shadow generator or undefined to create an instance of the default shadow generator
* @returns The parsed shadow generator
*/
static Parse(parsedShadowGenerator: any, scene: Scene, constr?: (mapSize: number, light: IShadowLight, camera: Nullable<Camera>) => ShadowGenerator): ShadowGenerator;
}