Bitbybit Docs
    Preparing search index...

    Class DirectionalLightDto (Inputs.BabylonScene)

    Feeds babylon.scene.drawDirectionalLight: the direction the sun-like light shines in, its colors and brightness and the shadow settings.

    Index

    Constructors

    • Parameters

      • Optionaldirection: Vector3
      • Optionalintensity: number
      • Optionaldiffuse: string
      • Optionalspecular: string
      • OptionalshadowGeneratorMapSize: number
      • OptionalenableShadows: boolean
      • OptionalshadowDarkness: number
      • OptionalshadowUsePercentageCloserFiltering: boolean
      • OptionalshadowContactHardeningLightSizeUVRatio: number
      • OptionalshadowBias: number
      • OptionalshadowNormalBias: number
      • OptionalshadowMaxZ: number
      • OptionalshadowMinZ: number
      • OptionalshadowRefreshRate: number

      Returns DirectionalLightDto

    Properties

    direction: Vector3

    The direction the light travels in; [-100, -100, -100] shines down and diagonally, and only the direction matters, not the length

    [-100, -100, -100]
    
    intensity: number

    Brightness as a plain factor, 1 being full strength

    0.5
    

    0

    Infinity

    0.1

    diffuse: string

    Hex color of the light on surfaces

    #ffffff
    
    specular: string

    Hex color of the highlights the light makes on shiny surfaces

    #ffffff
    
    shadowGeneratorMapSize?: number

    Resolution of the shadow map in pixels; higher gives sharper shadows at more GPU cost

    1024
    

    0

    Infinity

    1

    enableShadows?: boolean

    When true, the light casts shadows from every mesh in the scene

    true
    
    shadowDarkness?: number

    How light the shadows are, from 0 for fully dark to 1 for invisible

    0
    

    0

    1

    0.1

    shadowUsePercentageCloserFiltering: boolean

    When true, shadow edges are softened by sampling the map several times

    true
    
    transparencyShadow: boolean

    When true, transparent parts of meshes let light through the shadow, which Gaussian splats need

    false
    
    shadowContactHardeningLightSizeUVRatio: number

    How much shadow edges blur with distance from the caster when filtering is on; larger blurs more

    0.2
    

    0

    Infinity

    0.1

    shadowBias: number

    Small depth offset that stops surfaces from shadowing themselves in stripes; raise it if stripes appear

    0.0001
    

    0

    Infinity

    0.00001

    shadowNormalBias: number

    Extra offset along surface normals against self-shadowing, in scene units

    0.002
    

    0

    Infinity

    0.0001

    shadowMaxZ: number

    The farthest distance from the light that shadows are computed for, in scene units

    1000
    

    0

    Infinity

    50

    shadowMinZ: number

    The nearest distance from the light that shadows are computed for, in scene units

    0
    

    0

    Infinity

    50

    shadowRefreshRate: number

    How often the shadow map is redrawn: 1 every frame, 0 once only, 2 every second frame

    1
    

    0

    Infinity

    1