PointShadow constructor
CameraRenderer used to create this PointShadow.
parameters used to create this PointShadow.
PointLight associated with this PointShadow.
Perspective shadow camera to use for shadow calculations.
Options used to create this PointShadow.
Array of Vec3 representing each cube face up directions to compute the .viewMatrices | camera view matrices.
Array of Vec3 representing each cube face directions to compute the .viewMatrices | camera view matrices.
Private
#tempVec3 used to calculate the actual current direction based on the PointLight position.
The CameraRenderer used to create this Shadow.
Index of this Shadow used in the corresponding CameraRenderer shadow buffer binding.
Sample count of the depthTexture. Only 1
is accepted for now.
Size of the depth Texture to use. Default to Vec2(512)
.
Format of the depth Texture to use. Default to depth24plus
.
Depth Texture used to create the shadow map.
Depth RenderTarget onto which the meshes will be rendered.
Depth comparison Sampler used to compare depth in the shaders.
All the current meshes rendered to the shadow map.
Private
#materialsPrivate
#depthCameraRenderer corresponding BufferBinding that holds all the bindings for this type of shadow to send to the shaders.
Get this Shadow intensity.
Set this Shadow intensity and update the CameraRenderer corresponding BufferBinding.
The new Shadow intensity.
Get this Shadow bias.
Set this Shadow bias and update the CameraRenderer corresponding BufferBinding.
The new Shadow bias.
Get this Shadow normal bias.
Set this Shadow normal bias and update the CameraRenderer corresponding BufferBinding.
The new Shadow normal bias.
Get this Shadow PCF samples count.
Set this Shadow PCF samples count and update the CameraRenderer corresponding BufferBinding.
The new Shadow PCF samples count.
Set or reset this PointShadow CameraRenderer corresponding BufferBinding.
Set the parameters and start casting shadows by setting the isActive setter to true
.
Called internally by the associated PointLight if any shadow parameters are specified when creating it. Can also be called directly.
parameters to use for this PointShadow.
Set the depthComparisonSampler, depthTexture, depthPassTarget, compute the .projectionMatrix | camera projection matrix and start rendering to the shadow map.
Resend all properties to the CameraRenderer corresponding BufferBinding. Called when the maximum number of corresponding PointLight has been overflowed.
Update the .projectionMatrix | camera perspective projection matrix and update the CameraRenderer corresponding BufferBinding.
Update the .viewMatrices | camera view matrices and update the CameraRenderer corresponding BufferBinding.
Vec3 to use as position for the .viewMatrices | camera view matrices, based on the light position.
Set or resize the depthTexture and eventually resize the depthPassTarget as well.
Create the cube depthTexture.
Remove the depth pass from its task queue manager.
Task queue manager ID to use for removal.
Render the depth pass. This happens before creating the CameraRenderer command encoder.
Whether to render it only once or not.
Get the default depth pass vertex shader for this PointShadow.
Get the default depth pass fragment shader options for this PointShadow.
Private
#setPrivate
Set the Shadow parameters.
parameters to use for this Shadow.
Reset the depthTexture when the depthTextureSize changes.
Create the depthPassTarget.
Update the CameraRenderer corresponding BufferBinding input value and tell the renderer camera, lights and shadows bind group to update.
name of the property to update.
new value of the property.
Render all the meshes into the depthPassTarget.
GPUCommandEncoder to use.
Patch the given mesh material parameters to create the depth material.
original mesh to use.
Optional additional parameters to use for the depth material.
Add a mesh to the shadow map. Internally called by the mesh if its castShadows
parameters has been set to true
, but can also be called externally to selectively cast shadows or to add specific parameters (such as custom depth pass shaders).
mesh to add to the shadow map.
Optional parameters to use for the depth material.
Force all the meshes to use the depth material.
Force all the meshes to use their original material.
Remove a mesh from the shadow map and destroy its depth material.
mesh to remove.
Destroy the Shadow.
Create a shadow map from a PointLight by rendering to a depth cube texture using an array of view Mat4 based on the PointLight position and a perspective shadow camera Mat4.
This type of shadow is more expensive than DirectionalShadow since its scene needs to be rendered 6 times to each face of a depth cube texture instead of once.