/** * @import { CameraComponent } from '../../../../framework/components/camera/component.js' * @import { CameraFrameEffectDepth } from '../../../render-passes/camera-frame-effect.js' * @import { GraphicsDevice } from '../../../../platform/graphics/graphics-device.js' */ /** * A render pass implementation of Temporal Anti-Aliasing (TAA). * * @category Graphics * @ignore */ export class RenderPassTAA extends RenderPassShaderQuad { /** * @param {GraphicsDevice} device - The graphics device. * @param {CameraComponent} cameraComponent - The camera, whose jitter and matrices the * resolve reprojects the history with. * @param {object} [options] - The options. * @param {boolean} [options.upscale] - Whether the history has the resolution of the camera's * render target, see {@link RenderPassTAA#upscale}. Defaults to false. * @param {number} [options.format] - The format of the history on a device which cannot render * to a half float format, normally the format of the scene. Defaults to * {@link PIXELFORMAT_RGBA8}. * @param {CameraFrameEffectDepth|null} [options.depth] - The scene depth the resolve reads. When * not given, the defines describing how it is stored are taken from the camera. */ constructor(device: GraphicsDevice, cameraComponent: CameraComponent, options?: { upscale?: boolean; format?: number; depth?: CameraFrameEffectDepth | null; }); /** * The index of the history texture to render to. */ historyIndex: number; /** * @type {Texture} */ historyTexture: Texture; /** * @type {Texture[]} */ historyTextures: Texture[]; /** * @type {RenderTarget[]} */ historyRenderTargets: RenderTarget[]; /** * The texture the pass resolves, the scene of the frame. Use * {@link RenderPassTAA#setSourceTexture} to change it, which also sizes the history from it * when not upscaling. * * @type {Texture|null} */ sourceTexture: Texture | null; /** * Whether the history has the resolution of the camera's render target rather than of the * source texture, accumulating the jittered frames rendered at a lower resolution into it. * * @type {boolean} */ upscale: boolean; /** * The tone mapping the composition displays the resolved scene with. The history and the * current frame are blended at the exposure the scene is displayed with, and without tone * mapping, the composition applies no exposure. * * @type {number} */ toneMapping: number; cameraComponent: CameraComponent; sourceTextureId: import("../../../../index.js").ScopeId; textureSizeId: import("../../../../index.js").ScopeId; textureSize: Float32Array; historySizeId: import("../../../../index.js").ScopeId; historySize: Float32Array; historyTextureId: import("../../../../index.js").ScopeId; viewProjPrevId: import("../../../../index.js").ScopeId; viewProjInvId: import("../../../../index.js").ScopeId; jittersId: import("../../../../index.js").ScopeId; cameraParams: Float32Array; cameraParamsId: import("../../../../index.js").ScopeId; exposureId: import("../../../../index.js").ScopeId; taaExposureId: import("../../../../index.js").ScopeId; /** * @param {number} fallbackFormat - The format of the history when the device cannot render to * a half float format. * @private */ private setup; /** * Sets the texture the pass resolves, which changes when the scene is resolved by another pass * before this one. Unless upscaling, the history is sized from it. * * @param {Texture} texture - The texture. */ setSourceTexture(texture: Texture): void; /** * Swaps the history textures, once per frame before the pass renders. * * @returns {Texture} The history texture the pass renders to this frame. */ update(): Texture; } import { RenderPassShaderQuad } from '../../../../scene/graphics/render-pass-shader-quad.js'; import { Texture } from '../../../../platform/graphics/texture.js'; import { RenderTarget } from '../../../../platform/graphics/render-target.js'; import type { CameraComponent } from '../../../../framework/components/camera/component.js'; import type { GraphicsDevice } from '../../../../platform/graphics/graphics-device.js'; import type { CameraFrameEffectDepth } from '../../../render-passes/camera-frame-effect.js';