PointShadow constructor
CameraRenderer or GPUCurtains used to create this PointShadow.
PointShadowParams used to create this PointShadow.
PointLight associated with this PointShadow.
PerspectiveCamera to use for shadow calculations.
Options used to create this PointShadow.
Array of Vec3 representing each cube face up directions to compute the #viewMatrices.
Array of Vec3 representing each cube face directions to compute the #viewMatrices.
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
.
Optional RenderBundle to use for rendering the depth meshes.
Depth Texture used to create the shadow map.
Depth RenderTarget onto which the castingMeshes will be rendered.
Depth comparison Sampler used to compare depth in the shaders.
Map of all the parent Mesh casting shadows used to create the depth meshes.
Map of all the depth Mesh rendered to the shadow map.
CameraRenderer 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. Force not using a RenderBundle since we'll need to swap faces bind groups during render.
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 or when the renderer has changed.
Copy the PointLight actual position and update binding.
Called whenever the camera projectionMatrix changed (or on reset) to update the CameraRenderer corresponding BufferBinding.
Update the #viewMatrices and update the CameraRenderer corresponding BufferBinding.
Called whenever the #viewMatrices changed (or on reset) to update the CameraRenderer corresponding BufferBinding.
Set or resize the depthTexture and eventually resize the depthPassTarget as well.
Create the cube depthTexture.
Clear the content of the depth texture. Called whenever the castingMeshes Map is empty after having removed a mesh, or if all castingMeshes visible
properties are false
.
Render the depth pass. Called by the scene when rendering the depthPassTarget render pass entry, or by the renderOnce method.
GPUCommandEncoder to use.
Render all the castingMeshes into the depthPassTarget. Before rendering them, we swap the cube face bind group with the renderer pointShadowsCubeFaceBindGroups at the index containing the current face onto which we'll draw.
GPUCommandEncoder to use.
Current cube map face onto which we're drawing.
Get the default depth pass vertex shader for this PointShadow.
parameters - VertexShaderInputBaseParams used to compute the output worldPosition
and normal
vectors.
Get the default depth pass fragment shader options for this PointShadow.
Patch the given Mesh material parameters to create the depth mesh. Here we'll be adding the first renderer pointShadowsCubeFaceBindGroups bind group containing the face index onto which we'll be drawing. This bind group will be swapped when rendering using renderDepthPass.
original Mesh to use.
Optional additional parameters to use for the depth mesh.
Set or reset this shadow CameraRenderer.
New CameraRenderer or GPUCurtains instance to use.
Update the CameraRenderer corresponding BufferBinding input value and tell the renderer camera, lights and shadows bind group to update.
Reset the depthTexture when the depthTextureSize changes.
Destroy the depthTexture.
Create the depthPassTarget.
Set our depthPassTarget corresponding scene render pass entry custom render pass.
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 mesh.
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 Camera projectionMatrix.
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.