- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1
Light
        Josh Stovall edited this page Dec 19, 2020 
        ·
        8 revisions
      
    Create a light.
See the live demo.
var options = {
   type: "ambient",
   color: 0xFF0000,
   intensity: 1, 
   distance: 100,
   decay: 1
}
var light = new XR.Light(options);| Name | Type | Options | Default | Description | 
|---|---|---|---|---|
| type | string | ambientdirectionalhemispherepointrectAreaspotlight  | point | type of light | 
| color | color  | white | light color | |
| intensity | float  | 0to1 | 1 | The light's intensity, or strength | 
| distance | int  | > 0 | 0 | Maximum range of the light | 
| decay | float  | 0to1 | 0 | The amount the light dims along the distance of the light | 
| position | array | [0,0,0] | position of light | 
ambient, directional, hemisphere, point, rectArea, spotlight 
Color of the light.
The light's intensity, or strength.
Maximum range of the light. Default is 0 (no limit).
The amount the light dims along the distance of the light