SpotShadow constructor
CameraRenderer or GPUCurtains used to create this SpotShadow.
SpotShadowParams used to create this SpotShadow.
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.
SpotLight associated with this SpotShadow.
Options used to create this SpotShadow.
Shadow PerspectiveCamera used for shadow calculations.
Focus of the camera. Default to 1
.
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 shadow CameraRenderer.
New CameraRenderer or GPUCurtains instance to use.
Set the parameters and start casting shadows by setting the isActive setter to true
.
Called internally by the associated Light if any shadow parameters are specified when creating it. Can also be called directly.
Parameters to use for this Shadow.
Update the CameraRenderer corresponding BufferBinding input value and tell the renderer camera, lights and shadows bind group to update.
Set the depthComparisonSampler, depthTexture, depthPassTarget and start rendering to the shadow map.
Set or resize the depthTexture and eventually resize the depthPassTarget as well.
Destroy the 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
.
Create the depthPassTarget.
Set our depthPassTarget corresponding scene render pass entry custom render pass.
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.
GPUCommandEncoder to use.
Get the default depth pass fragment shader for this Shadow.
false
otherwise.Patch the given mesh material parameters to create the depth mesh.
original mesh to use.
Optional additional parameters to use for the depth mesh.
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.
Set or reset this SpotShadow CameraRenderer corresponding BufferBinding.
Resend all properties to the CameraRenderer corresponding BufferBinding. Called when the maximum number of corresponding SpotLight has been overflowed or when the renderer has changed.
Copy the SpotLight actual position and update binding.
Set the camera fov based on the SpotLight angle.
Reset the depthTexture when the depthTextureSize changes and update camera ratio.
Create the depthTexture.
Get the default depth pass vertex shader for this SpotShadow.
parameters - VertexShaderInputBaseParams used to compute the output worldPosition
and normal
vectors.
Create a shadow map from a SpotLight by rendering to a depth texture using a PerspectiveCamera.