Renderer · interface

SurfaceLayerEffect

Explained in Hello world.

interface SurfaceLayerEffect
import type { SurfaceLayerEffect } from '@driftengine/core';

Properties

NameTypeDescription
windowsreadonlyoptional{ readonly cells: readonly [number, number]; readonly glass?: boolean; /** Varies which windows light and which rooms show, between facades wearing one layer. */ readonly seed?: number; /** How bright a lit window glows, 0 for none. */ readonly glow?: number; /** * The light a window shows where there is no room behind it. **A vertex that names an emissive * colour overrides it** — the window's colour, or a tint on the room where there is one — which * is how buildings sharing a layer each keep their own light: a window layer's vertex emissive * is otherwise unused, so the colour there, strength folded in, is free to say it. */ readonly colour?: readonly [number, number, number]; }Windows across and up one repeat of the layer, for everything that works window by window: rooms, lit windows. With glass, a window is a hole in the albedo — glass where its alpha is 0, wall where it is 1 — which is how a facade is drawn, and the other way round would lose the wall's colour, which does not survive an upload at alpha 0.
interiorreadonlyoptional{ readonly roomLayer: number; /** How deep a room is, as a share of a window's width. 0.5 unless stated. */ readonly depth?: number; /** The share of rooms lit, 0 to 1. 1 unless stated. */ readonly lit?: number; }A room seen in parallax behind each window, drawn from another layer of the same array.
wearreadonlyoptional{ readonly dust?: number; readonly grime?: number; readonly streaks?: number; readonly fade?: number; }Procedural wear, each 0 to 1, fading out past fade metres (never, unless stated).
animationreadonlyoptional{ /** Repeats a second along u and v. */ readonly scroll?: readonly [number, number]; /** Emission rising and falling: hertz, and how far it falls, 0 to 1. */ readonly pulse?: readonly [number, number]; /** Emission stuttering, 0 to 1. */ readonly flicker?: number; /** Successive layers as frames: how many from this one, and how fast. */ readonly flipbook?: readonly [number, number]; /** Metres past which emission fades out, 0 for never. */ readonly fade?: number; }Motion on the caller's clock (Environment.surfaceTime), so a held clock holds it.
dryreadonlyoptionalbooleanRain leaves it dry: a covered walkway, an interior floor.