/** * The Screen Space Ambient Occlusion (SSAO) effect, a postprocessing technique that approximates * ambient occlusion by calculating how exposed each point in the screen space is to ambient light, * enhancing depth perception and adding subtle shadowing in crevices and between objects. * * The occlusion is generated from the scene depth by a pass the effect owns. With * {@link SSAOTYPE_LIGHTING} it is applied by the lit materials as the scene renders, and with * {@link SSAOTYPE_COMBINE} it is applied to the rendered scene in linear HDR space, before tone * mapping. * * Every {@link CameraFrame} constructs and registers one, available as {@link CameraFrame#ssao}. * * @category Graphics */ export class SsaoEffect extends CameraFrameEffect { /** * @param {GraphicsDevice} device - The graphics device. */ constructor(device: GraphicsDevice); /** * The type of the SSAO, which determines how it is applied in the rendering process. Defaults * to {@link SSAOTYPE_NONE}, making it disabled. Can be: * * - {@link SSAOTYPE_NONE} * - {@link SSAOTYPE_LIGHTING} * - {@link SSAOTYPE_COMBINE} * * @type {string} */ type: string; /** * Whether the SSAO effect is blurred. Defaults to true. * * @type {boolean} */ blurEnabled: boolean; /** * Whether the SSAO sampling is randomized. Useful when used instead of blur effect together * with TAA. Defaults to false. * * @type {boolean} */ randomize: boolean; /** * The intensity of the SSAO effect, 0-1 range. Defaults to 0.5. * * @type {number} */ intensity: number; /** * The radius of the SSAO effect, 0-100 range. Defaults to 30. * * @type {number} */ radius: number; /** * The number of samples of the SSAO effect, 1-64 range. Defaults to 12. * * @type {number} */ samples: number; /** * The power of the SSAO effect, 0.1-10 range. Defaults to 6. * * @type {number} */ power: number; /** * The minimum angle of the SSAO effect, 1-90 range. Defaults to 10. * * @type {number} */ minAngle: number; /** * The scale of the SSAO effect, 0.5-1 range. Defaults to 1. * * @type {number} */ scale: number; /** * The pass generating the occlusion, while the effect's passes exist. * * @type {RenderPassSsao|null} * @private */ private _pass; /** * Whether the existing pass generates the occlusion for the lit materials to apply. * * @type {boolean} * @private */ private _lighting; } import { CameraFrameEffect } from '../../render-passes/camera-frame-effect.js'; import type { GraphicsDevice } from '../../../platform/graphics/graphics-device.js';