/** * The HDR bloom effect, a postprocessing technique that simulates the natural glow of bright light * sources by spreading their intensity beyond their boundaries, creating a soft and realistic * blooming effect. * * The bloom is generated from the scene by passes the effect owns, from a half resolution copy of * it or, with {@link BloomEffect#highQuality}, from the full resolution scene, and added to the * scene in linear HDR space, before tone mapping. It requires an HDR scene format, and is * disabled when the camera frame renders to {@link PIXELFORMAT_RGBA8}. * * Every {@link CameraFrame} constructs and registers one, available as {@link CameraFrame#bloom}. * * @category Graphics */ export class BloomEffect extends CameraFrameEffect { /** * @param {GraphicsDevice} device - The graphics device. */ constructor(device: GraphicsDevice); /** * The intensity of the bloom effect, 0-0.1 range. Defaults to 0, making it disabled. * * @type {number} */ intensity: number; /** * The number of iterations for blurring the bloom effect, with each level doubling the blur * size. Once the blur size matches the dimensions of the render target, further blur passes are * skipped. Defaults to 16. * * @type {number} */ blurLevel: number; /** * The brightness below which the scene does not contribute to bloom. Zero, the default, blooms * the whole scene, which is the physically based behavior; raising it restricts the glow to the * brightest parts, with a soft transition below the threshold. The value is in the * scene-referred units the scene is rendered in, before the exposure and tone mapping applied * when the bloom is composited, so a scene lit for an exposure far from 1 needs the threshold * scaled to match. * * @type {number} */ threshold: number; /** * Whether the bloom is generated from the full resolution scene instead of a half resolution * copy of it. This gives a sharper and more stable glow around small bright features, with a * slightly stronger core, at a higher performance cost. Defaults to false. * * @type {boolean} */ highQuality: boolean; /** * The pass generating the bloom, while the effect's passes exist. * * @type {FramePassBloom|null} * @private */ private _pass; /** * Whether the existing pass generates the bloom from the full resolution scene. * * @type {boolean} * @private */ private _fullResolution; } import { CameraFrameEffect } from '../../render-passes/camera-frame-effect.js'; import type { GraphicsDevice } from '../../../platform/graphics/graphics-device.js';