Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShadowCastingLight

Contains the required components used for rendering a shadow casted by a light.

Hierarchy

  • ShadowCastingLight

Index

Constructors

constructor

  • Creates a new shadow casting light used for rendering a shadow texture.

    Parameters

    • renderer: Renderer

      The renderer to use.

    • light: Light

      The light which is casting the shadow.

    • shadowTextureSize: number

      The size (width/height) in pixels for the shadow texture. Increasing the size will improve the quality of the shadow.

    • shadowArea: number

      The area in units of the shadow when using directional lights. Reducing the area will improve the quality of the shadow.

    • Default value softness: number = 0

      The softness of the edges of the shadow.

    • Default value quality: ShadowQuality = ShadowQuality.medium

      The quality (precision) of the shadow. If the quality is not supported by current platform, a lower quality will be selected instead.

    Returns ShadowCastingLight

Properties

Private _filterTexture

_filterTexture: RenderTexture

Private _lightViewProjection

_lightViewProjection: Float32Array = new Float32Array(16)

Private _shadowTexture

_shadowTexture: RenderTexture

Optional camera

camera: Camera

The camera to follow when using directional lights.

followCamera

followCamera: boolean = true

Value indicating if the shadow should follow the specified camera. If the camera is not set, the main camera will be used as default. Only available when using directional lights.

light

light: Light

The light which is casting the shadow.

renderer

renderer: Renderer

The renderer to use.

shadowArea

shadowArea: number

The area in units of the shadow when using directional lights. Reducing the area will improve the quality of the shadow.

softness

softness: number

The softness of the edges of the shadow.

Accessors

filterTexture

  • get filterTexture(): RenderTexture

lightViewProjection

  • get lightViewProjection(): Float32Array

shadowTexture

  • get shadowTexture(): RenderTexture

Methods

clear

  • clear(): void

destroy

  • destroy(): void

updateLightViewProjection

  • updateLightViewProjection(): void

Static isHighQualitySupported

  • isHighQualitySupported(renderer: Renderer): boolean
  • Returns a value indicating if high quality (32-bit precision) shadows is supported by current platform.

    Parameters

    • renderer: Renderer

      The renderer to use.

    Returns boolean

Static isMediumQualitySupported

  • isMediumQualitySupported(renderer: Renderer): boolean
  • Returns a value indicating if medium quality (16-bit precision) shadows is supported by current platform.

    Parameters

    • renderer: Renderer

      The renderer to use.

    Returns boolean

Generated using TypeDoc