IlluminationScope


The receiver of the block passed to illuminate, used to configure the lighting drawn over the content. Each run of the block starts with every property at its default.

Lighting is computed with local illumination, which shades each point of the surface using only the light that reaches it directly from lights, the direction the surface faces at that point according to surfaceGeometrySpec, and how surfaceMaterial reflects light. Nothing else on screen is taken into account, so other composables neither cast shadows onto the surface nor reflect light onto it.

Summary

Public companion functions

Boolean

Capability query to determine if illuminate can draw lighting on the current platform.

Cmn

Public companion properties

Int

The most lights illuminate can apply to a surface, with either overload.

Cmn

Public properties

List<Light>

The lights illuminating the surface, empty to draw only the content.

Cmn
SurfaceGeometrySpec

The virtual three-dimensional shape the surface is treated as having.

Cmn
SurfaceMaterial

How the surface reflects lights.

Cmn

Public companion functions

isSupported

fun isSupported(): Boolean

Capability query to determine if illuminate can draw lighting on the current platform. When this returns false, only the content is drawn. On Android, lighting requires API 33.

Public companion properties

MaxLightsAllowed

val MaxLightsAllowed: Int

The most lights illuminate can apply to a surface, with either overload. Drawing a surface lit by more lights throws an IllegalArgumentException.

Public properties

lights

var lights: List<Light>

The lights illuminating the surface, empty to draw only the content. A light positioned with LightPosition.Anchored contributes nothing until its anchor has been placed.

surfaceGeometrySpec

var surfaceGeometrySpec: SurfaceGeometrySpec

The virtual three-dimensional shape the surface is treated as having. It decides which way each point of the surface faces, and so which parts catch lights. The default is a flat rectangle with no thickness.

Shapes that lighting does not support throw an IllegalArgumentException when the surface is drawn. See SurfaceGeometrySpec for the supported shapes.

surfaceMaterial

var surfaceMaterial: SurfaceMaterial

How the surface reflects lights. The default SurfaceMaterial.None reflects nothing, so no light is drawn until at least one of its components is set.