Skip to content
Josh Stovall edited this page Dec 3, 2020 · 8 revisions

Light()

Create a light.
See the live demo.

var options = {
   type: "ambient",
   color: 0xFF0000,
   intensity : 1, 
   distance : 0.0,
   decay : 1
}
var light = new XR.Light()

Parameters

Name Type Options Default Description
type string ambient directional hemisphere point rectArea spotlight point type of light
color color white light color
intensity float 0 to 1 1 The light's intensity, or strength
distance int > 0 0 Maximum range of the light
decay float 0 to 1 0 The amount the light dims along the distance of the light
position array [0,0,0] position of light

type

ambient, directional, hemisphere, point, rectArea, spotlight

color

Color of the light.

intensity

The light's intensity, or strength.

distance

Maximum range of the light. Default is 0 (no limit).

decay

The amount the light dims along the distance of the light

Clone this wiki locally