class ShadowGenerator
Creates a ShadowGenerator object.
A ShadowGenerator is the required tool to use the shadows.
Each light casting shadows needs to use its own ShadowGenerator.
Required parameters :
mapSize
(integer): the size of the texture what stores the shadows. Example : 1024.
light
: the light object generating the shadows.
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.
Documentation : http://doc.babylonjs.com/tutorials/shadows
Name | Type | Description | |
---|---|---|---|
mapSize | number | ||
light | IShadowLight | ||
optional | useFullFloatFirst | boolean |
Controls the extent to which the shadows fade out at the edge of the frustum
Used only by directionals and spots
Returns the darkness value (float).
Sets the ShadowGenerator darkness value (float <= 1.0).
Returns the ShadowGenerator.
Name | Type | Description | |
---|---|---|---|
darkness | number |
Sets the ability to have transparent shadow (boolean).
Returns the ShadowGenerator.
Name | Type | Description | |
---|---|---|---|
hasShadow | boolean |
Returns a RenderTargetTexture object : the shadow map texture.
Returns the most ready computed shadow map as a RenderTargetTexture object.
Helper function to add a mesh and its descendants to the list of shadow casters
Name | Type | Description | |
---|---|---|---|
mesh | AbstractMesh | Mesh to add | |
optional | includeDescendants | boolean | boolean indicating if the descendants should be added. Default to true |
Helper function to remove a mesh and its descendants from the list of shadow casters
Name | Type | Description | |
---|---|---|---|
mesh | AbstractMesh | Mesh to remove | |
optional | includeDescendants | boolean | boolean indicating if the descendants should be removed. Default to true |
Returns the associated light object.
Force shader compilation including textures ready check
Name | Type | Description | |||
---|---|---|---|---|---|
optional | onCompiled | generator | ShadowGenerator |
|
Boolean : true when the ShadowGenerator is finally computed.
Name | Type | Description | |
---|---|---|---|
subMesh | SubMesh | ||
useInstances | boolean |
This creates the defines related to the standard BJS materials.
Name | Type | Description | |
---|---|---|---|
defines | any | ||
lightIndex | number |
This binds shadow lights related to the standard BJS materials.
It implies the unifroms available on the materials are the standard BJS ones.
Name | Type | Description | |
---|---|---|---|
lightIndex | string | ||
effect | Effect |
Returns a Matrix object : the updated transformation matrix.
Disposes the ShadowGenerator.
Returns nothing.
Serializes the ShadowGenerator and returns a serializationObject.
Parses a serialized ShadowGenerator and returns a new ShadowGenerator.
Name | Type | Description | |
---|---|---|---|
parsedShadowGenerator | any | ||
scene | Scene |