Class ShadowSettings

Various options that control shadow rendering for a specific view.

Constructors

  • Parameters

    • OptionalisEnabled: boolean
    • OptionaldirectionalShadowDistance: number
    • OptionalcascadeCount: number
    • OptionalcascadeDistributionExponent: number
    • OptionalshadowFilteringQuality: number
    • OptionalshadowMapResolutionScale: number

    Returns ShadowSettings

Properties

_cascadeCount: number
_cascadeDistributionExponent: number
_directionalShadowDistance: number
_isEnabled: boolean
_shadowFilteringQuality: number
_shadowMapResolutionScale: number

Accessors

  • get cascadeCount(): number
  • Number of cascades to use for directional shadows. Higher number of cascades increases shadow quality as each individual cascade has less area to cover, but can significantly increase performance cost, as well as a minor increase in memory cost. Valid range is roughly [1, 6].

    Returns number

  • set cascadeCount(value): void
  • Parameters

    • value: number

    Returns void

  • get cascadeDistributionExponent(): number
  • Allows you to control how are directional shadow cascades distributed. Value of 1 means the cascades will be linearly split, each cascade taking up the same amount of space. Value of 2 means each subsequent split will be twice the size of the previous one (meaning cascades closer to the viewer cover a smaller area, and therefore yield higher resolution shadows). Higher values increase the size disparity between near and far cascades at an exponential rate. Valid range is roughly [1, 4].

    Returns number

  • set cascadeDistributionExponent(value): void
  • Parameters

    • value: number

    Returns void

  • get directionalShadowDistance(): number
  • Maximum distance that directional light shadows are allowed to render at. Decreasing the distance can yield higher quality shadows nearer to the viewer, as the shadow map resolution isn't being used up on far away portions of the scene. In world units (meters).

    Returns number

  • set directionalShadowDistance(value): void
  • Parameters

    • value: number

    Returns void

  • get isEnabled(): boolean
  • Determines if shadows cast by lights should be rendered. Only relevant if lighting is turned on.

    Returns boolean

  • set isEnabled(value): void
  • Parameters

    • value: boolean

    Returns void

  • get shadowFilteringQuality(): number
  • Determines the number of samples used for percentage closer shadow map filtering. Higher values yield higher quality shadows, at the cost of performance. Valid range is [1, 4].

    Returns number

  • set shadowFilteringQuality(value): void
  • Parameters

    • value: number

    Returns void

  • get shadowMapResolutionScale(): number
  • Scales the resolution of the shadow maps up or down. Only relevant for shadows that have dynamic (i.e. non-fixed) resolution enabled.

    Returns number

  • set shadowMapResolutionScale(value): void
  • Parameters

    • value: number

    Returns void

Methods