• Cmn
    abstract class Light
Known direct subclasses
DirectionalLight

A light that is infinitely far away, such as the sun.

PointLight

A light that radiates equally in every direction from a single point in front of the surface, like a bare bulb.

SpotLight

A light that sits in front of the surface like a PointLight, but emits only within a cone, so it lights a bounded pool of the surface rather than all of it.


Represents a source of light.

Choose DirectionalLight for light arriving from infinitely far away, PointLight for a bulb at a fixed spot, and SpotLight for a bulb that only lights a cone.

Summary

Public properties

abstract Color

Color emitted by this light.

Cmn
abstract Float

Multiplier applied to the strength of this light.

Cmn
open LightPosition

Where the light sits.

Cmn

Public properties

color

abstract val color: Color

Color emitted by this light.

The color's alpha channel scales the emitted light alongside intensity, so a fully transparent color (alpha of 0, such as Color.Transparent) emits no light.

intensity

abstract val intensity: Float

Multiplier applied to the strength of this light.

This scales the light's contribution alongside color's alpha channel (color.alpha * intensity). A light with an intensity of 0 contributes nothing, 1 applies color at its base strength, values between 0 and 1 make the light more faint, and values greater than 1 overdrive the light, brightening its reflection towards white.

position

open val position: LightPosition

Where the light sits. Position-less lights such as DirectionalLight report an unspecified local position.