Skip to content

MapDynamicSpotlight

Class Documentation

Edit documentation

A spotlight placed on the map. It lights a frustum that starts at the position in its transform, and its shape and colour come from a projected texture.

Direction. The light looks along the negative Z axis of its transform, with the Y axis as up. The frustum itself is described by the MapFrustum properties.

The projected texture is the cone. There is no cone angle falloff. A lit pixel is projected into the light's frustum and the light is multiplied by the texture sample at that point, so a white disc on black gives a round pool and a plain white texture gives a square one. A spotlight whose ProjectedTexture does not resolve is not drawn at all.

Range. Brightness falls off linearly with distance from the light and is zero at far.

It is drawn only on a map that has a MapDynamicLighting component. That page describes which surfaces take the light, the masks and the light types.

Several spotlights. When every visible spotlight uses the same texture and none has a material, that texture is used directly. Otherwise each distinct texture is copied into one tile of a shared atlas of 16 tiles, and each light samples its own tile.

Properties

HdrScale

F32 = 5
Edit documentation

Extra multiplier on the colour, used only by PBR-style shaders. Non-PBR environment and character shaders ignore it.

LightChannels

U8 = 1
15.21
Edit documentation

Bitmask of light channels. The light reaches an object only when the object's own light channels share a bit with it.

VisibilityController

Link<IMapVisibilityController> = "0x0"
13.20
Edit documentation

Ties the light to a map visibility state. The light is registered only if the controller reports visible when the object loads, and while it is drawn its colour is scaled by the controller's fade weight.