Class

IlluminationScope

The receiver of the block passed to illuminate, used to configure the lighting drawn over the content.

Source set: Common
public class IlluminationScope internal constructor()

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.

Properties

lights

Source set: Common
public var lights: List<Light> = emptyList()

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.

surfaceMaterial

Source set: Common
public var surfaceMaterial: SurfaceMaterial = SurfaceMaterial.None

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.

surfaceGeometrySpec

Source set: Common
public var surfaceGeometrySpec: SurfaceGeometrySpec = DefaultSurfaceGeometrySpec

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.

Members

Companion

Source set: Common
public companion object

Properties

MaxLightsAllowed

Source set: Common
public 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.

Functions

isSupported

Source set: Common
public 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.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: