Renderer · interface

BloomResponse

How a frame's bloom answers the light it is given, beside the strength and threshold setBloom already takes. Absent, or a field absent, is the response every frame had before 4.8.6.

Explained in Hello world.

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

In depth

Why it exists: one band over the colour less the threshold washes a stage built for another engine. A ramped bloom keeps saturate((L − threshold) / 2) of a colour rather than the colour less the threshold, and spreads it over six bands, each in a tint of its own. A stage authored against that — a threshold of 0.1 and tints summing below one — came out white here, because subtracting so low a threshold keeps nearly every light in the frame at full strength. These are the two things that differ, as numbers.

Properties

NameTypeDescription
rampreadonlyoptionalnumberScene units over which a colour comes in, from none of it at the threshold to all of it this far past. 0, the default, subtracts instead: a colour keeps what it has past the threshold, the response since bloom shipped. A ramped bloom's is 2 after exposure, so a frame exposed by e that wants it passes 2 / e, as it passes the threshold over the exposure.
More

Brightness is still the largest channel rather than luminance, for the reason shaders/bloom.ts gives; on a neutral colour the two are equal.

tintsreadonlyoptionalArrayLike<number>Each level's colour, three numbers a level, finest first: the halo at a few pixels first and at a twentieth of the frame last. White, the default, is the identity; a level not named takes white. Not clamped above one, which is how a tint carries a strength past the 0..1 the dial gives — a stage asking for twice the light names tints twice as bright.
More

At most BLOOM_LEVELS levels. A frame too small for that many uses the first it has room for.