Class ShadowDepthWrapper
Constructors
constructor
-
new ShadowDepthWrapper(
baseMaterial: Material,
scene?: Scene,
options?: IIOptionShadowDepthMaterial,
): ShadowDepthWrapperInstantiate a new shadow depth wrapper. It works by injecting some specific code in the vertex/fragment shaders of the base material and is used by a shadow generator to generate the shadow depth map. For more information, please refer to the documentation: https://doc.babylonjs.com/features/featuresDeepDive/lights/shadows
Parameters
- baseMaterial: Material
Material to wrap
Optionalscene: SceneDefine the scene the material belongs to
Optionaloptions: IIOptionShadowDepthMaterialOptions used to create the wrapper
Returns ShadowDepthWrapper
- baseMaterial: Material
Accessors
base Material
-
Gets the base material the wrapper is built upon
Returns Material
do Not Inject Code
-
get doNotInjectCode(): boolean
Gets the doNotInjectCode status of the wrapper
Returns boolean
standalone
-
get standalone(): boolean
Gets the standalone status of the wrapper
Returns boolean
Methods
dispose
-
Disposes the resources
Returns void
get Effect
-
getEffect(
subMesh: Nullable<SubMesh>,
shadowGenerator: ShadowGenerator,
passIdForDrawWrapper: number,
): Nullable<DrawWrapper>Gets the effect to use to generate the depth map
Parameters
- subMesh: Nullable<SubMesh>
subMesh to get the effect for
- shadowGenerator: ShadowGenerator
shadow generator to get the effect for
- passIdForDrawWrapper: number
Id of the pass for which the effect from the draw wrapper must be retrieved from
Returns Nullable<DrawWrapper>
the effect to use to generate the depth map for the subMesh + shadow generator specified
- subMesh: Nullable<SubMesh>
is Ready For Sub Mesh
-
isReadyForSubMesh(
subMesh: SubMesh,
defines: string[],
shadowGenerator: ShadowGenerator,
useInstances: boolean,
passIdForDrawWrapper: number,
): booleanSpecifies that the submesh is ready to be used for depth rendering
Parameters
- subMesh: SubMesh
submesh to check
- defines: string[]
the list of defines to take into account when checking the effect
- shadowGenerator: ShadowGenerator
combined with subMesh, it defines the effect to check
- useInstances: boolean
specifies that instances should be used
- passIdForDrawWrapper: number
Id of the pass for which the draw wrapper should be created
Returns boolean
a boolean indicating that the submesh is ready or not
- subMesh: SubMesh
Class that can be used to wrap a base material to generate accurate shadows when using custom vertex/fragment code in the base material