/** * @import { CameraFrameEffectContext, CameraFrameEffectPasses, CameraFrameEffectResources } from '../../render-passes/camera-frame-effect.js' * @import { GraphicsDevice } from '../../../platform/graphics/graphics-device.js' */ /** * The Depth of Field (DOF) effect, a technique used to simulate the optical effect where objects * at certain distances appear sharp while others are blurred, enhancing the perception of focus * and depth in the rendered scene. * * The blur is generated by passes the effect owns, from the scene depth and the scene color, and * mixed into the scene in linear HDR space, before tone mapping. * * Every {@link CameraFrame} constructs and registers one, available as {@link CameraFrame#dof}. * * @category Graphics */ export class DofEffect extends CameraFrameEffect { /** * @param {GraphicsDevice} device - The graphics device. */ constructor(device: GraphicsDevice); /** * Whether the near blur is enabled. Defaults to false. * * @type {boolean} */ nearBlur: boolean; /** * The distance at which the focus is set. Defaults to 100. * * @type {number} */ focusDistance: number; /** * The range around the focus distance where the focus is sharp. Defaults to 10. * * @type {number} */ focusRange: number; /** * The radius of the blur effect, typically 2-10 range. Defaults to 3. * * @type {number} */ blurRadius: number; /** * The number of rings in the blur effect, typically 3-8 range. Defaults to 4. * * @type {number} */ blurRings: number; /** * The number of points in each ring of the blur effect, typically 3-8 range. Defaults to 5. * * @type {number} */ blurRingPoints: number; /** * Whether the high quality implementation is used, which blurs the full resolution scene * instead of a half resolution copy of it. This will have a higher performance cost, but will * produce better quality results. Defaults to true. * * @type {boolean} */ highQuality: boolean; /** * The passes generating the blur, while the effect's passes exist. * * @type {FramePassDof|null} * @private */ private _pass; /** * Whether the existing passes blur the full resolution scene. * * @type {boolean} * @private */ private _highQuality; } import { CameraFrameEffect } from '../../render-passes/camera-frame-effect.js'; import type { GraphicsDevice } from '../../../platform/graphics/graphics-device.js';