Light

The light tag creates a single light in the scene. There are three types of lights – directional, point, and spot. The details are described below. The number of lights may be limited by the resources available to the browser and the content of your scene.

  • on – A boolean value indication if the light is on or off. The default is on.
  • color – The color of the light. See Data Types -> Color for details. The default is white.
  • intensity – The intensity of the light in the interval [0.0, 1.0].
  • type – The type of light. Depending on this value, various other attributes may be relevant. The default is ‘directional’.
    directional – A directional light uniformly illuminates all objects lighting towards the direction from the origin as indicated.
    point – A point light illuminates all objects within radius from the origin. It is positioned at the origin and uniformly illuminates all objects at the same distance.
    spot – A spot light is a point light with limited angular illumination.
  • radius – The maximum radius of the light. This only applies to type=’spot’ or type=’point’. Default is 100.
  • attenuation – A 3-element vector that defines the parameters used to determine the fall-off of light intensity with distance. The default is [1, 0, 0] – linear attenuation with 0 intensity at radius. This only applies to type=’spot’ or type=’point’.
  • direction – The direction to the light destination. This is opposite of the direction to the light source. type=’directional’ or type=’spot’. The default is [0, 0, -1] – in the -Z direction.
  • cutoffangle – The widest angle that is illuminated by a spot light. This is the total angular measurement centered at direction. The default is 3.14 radians.
  • beamwidth – The angular width of the central illuminated region. Light within this region is only attenuated by distance. This is the total angular measurement centered at direction. The default is 1.57 radians. Objects by angular measurement greater than beamwidth and less than cutoffangle are illuminated with linear attenuation in angle and the supplied attenuation in distance.