/** * @import { GraphicsDevice } from '../../../platform/graphics/graphics-device.js' */ /** * The vignette effect, a postprocessing technique that darkens the image edges, creating a gradual * falloff in brightness from the center outward. The effect can be also reversed, making the center * of the image darker than the edges, by specifying the outer distance smaller than the inner * distance. * * Applied in display-referred space, after tone mapping, so that the vignette color is reached * exactly regardless of the tone mapping in use. * * Every {@link CameraFrame} constructs and registers one, available as {@link CameraFrame#vignette}. * * @category Graphics */ export class VignetteEffect extends CameraFrameEffect { /** * @param {GraphicsDevice} device - The graphics device. */ constructor(device: GraphicsDevice); /** * The intensity of the vignette effect, 0-1 range. Defaults to 0, making it disabled. * * @type {number} */ intensity: number; /** * The inner distance of the vignette effect measured from the center of the screen, 0-3 range. * This is where the vignette effect starts. Value larger than 1 represents the value off * screen, which allows more control. Defaults to 0.5, representing half the distance from * center. * * @type {number} */ inner: number; /** * The outer distance of the vignette effect measured from the center of the screen, 0-3 range. * This is where the vignette reaches full intensity. Value larger than 1 represents the value * off screen, which allows more control. Defaults to 1, representing the full screen. * * @type {number} */ outer: number; /** * The curvature of the vignette effect, 0.01-10 range. The vignette is rendered using a * rectangle with rounded corners, and this parameter controls the curvature of the corners. * Value of 1 represents a circle. Smaller values make the corners more square, while larger * values make them more rounded. Defaults to 0.5. * * @type {number} */ curvature: number; /** * The color of the vignette effect. Defaults to black. * * @type {Color} */ color: Color; /** @private */ private _params; /** @private */ private _color; } import { CameraFrameEffect } from '../../render-passes/camera-frame-effect.js'; import { Color } from '../../../core/math/color.js'; import type { GraphicsDevice } from '../../../platform/graphics/graphics-device.js';