Selva Compute API Reference - v1.1.2
    Preparing search index...

    Class LightShadow<TCamera>

    Serves as a base class for the other shadow classes.

    Type Parameters

    Index

    Constructors

    Properties

    autoUpdate: boolean

    Enables automatic updates of the light's shadow. If you do not require dynamic lighting / shadows, you may set this to false.

    true

    bias: number

    Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.

    The Very tiny adjustments here (in the order of 0.0001) may help reduce artifacts in shadows.

    Expects a Float

    0

    blurSamples: number

    The amount of samples to use when blurring a VSM shadow map.

    Expects a Integer

    8

    camera: TCamera

    The light's view of the world.

    This is used to generate a depth map of the scene; objects behind other objects from the light's perspective will be in shadow.

    intensity: number

    The intensity of the shadow. The default is 1. Valid values are in the range [0, 1].

    map: WebGLRenderTarget<Texture<unknown>> | null

    The depth map generated using the internal camera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.

    null
    
    mapPass: WebGLRenderTarget<Texture<unknown>> | null

    The distribution map generated using the internal camera; an occlusion is calculated based on the distribution of depths. Computed internally during rendering.

    null
    
    mapSize: Vector2

    A THREE.Vector2 | Vector2 defining the width and height of the shadow map.

    Higher values give better quality shadows at the cost of computation time.

    new THREE.Vector2(512, 512)

    The type of shadow texture. The default is UnsignedByteType.

    UnsignedByteType
    
    matrix: Matrix4

    Model to shadow camera space, to compute location and depth in shadow map. Stored in a Matrix4.

    This is computed internally during rendering.

    new THREE.Matrix4()
    
    needsUpdate: boolean

    When set to true, shadow maps will be updated in the next render call. If you have set autoUpdate to false, you will need to set this property to true and then make a render call to update the light's shadow.

    false

    normalBias: number

    Defines how much the position used to query the shadow map is offset along the object normal.

    The Increasing this value can be used to reduce shadow acne especially in large scenes where light shines onto geometry at a shallow angle.

    The cost is that shadows may appear distorted.

    Expects a Float

    0

    radius: number

    Setting this to values greater than 1 will blur the edges of the shadow.toi

    High values will cause unwanted banding effects in the shadows - a greater mapSize is set to Renderer | PCFSoftShadowMap, radius has no effect and it is recommended to increase softness by decreasing mapSize instead.

    Note that this has no effect if the THREE.WebGLRenderer.shadowMap | WebGLRenderer.shadowMap.THREE.WebGLShadowMap.type | type is set to THREE.BasicShadowMap | BasicShadowMap.

    Expects a Float

    1

    Methods

    • Creates a new LightShadow with the same properties as this one.

      Parameters

      • Optionalrecursive: boolean

      Returns this

    • Copies value of all the properties from the {@link LightShadow | source} to this Light.

      Parameters

      Returns this

    • Frees the GPU-related resources allocated by this instance

      Returns void

      Call this method whenever this instance is no longer used in your app.

    • Used internally by the renderer to extend the shadow map to contain all viewports

      Returns Vector2

    • Gets the shadow cameras frustum

      Returns Frustum

      Used internally by the renderer to cull objects.

    • Parameters

      • viewportIndex: number

      Returns Vector4

    • Used internally by the renderer to get the number of viewports that need to be rendered for this shadow.

      Returns number

    • Serialize this LightShadow.

      Returns LightShadowJSON

    • Update the matrices for the camera and shadow, used internally by the renderer.

      Parameters

      • light: Light

        The light for which the shadow is being rendered.

      Returns void