/** * Render pass implementation of the final post-processing composition. * * @category Graphics * @ignore */ export class RenderPassCompose extends RenderPassShaderQuad { /** * @param {GraphicsDevice} graphicsDevice - The graphics device. * @param {CameraComponent} cameraComponent - The camera this composes the frame of. Only the depth * debug mode needs it, for the depth encoding the camera renders and its clip range. */ constructor(graphicsDevice: GraphicsDevice, cameraComponent: CameraComponent); /** * @type {Texture|null} */ sceneTexture: Texture | null; _toneMapping: number; _shaderDirty: boolean; _gammaCorrection: number; _key: string; _debug: any; _sceneDepthAvailable: boolean; _customComposeChunks: Map; /** * The effects taking part in the composition, in the order they are applied within their * slot - the active ones as of the last CameraFrame#update. * * @type {CameraFrameEffect[]} * @private */ private _effects; /** * The version of the defines of each of the effects the shader was last built for, so that a * define an update changed is detected without the effects needing property setters. * * @type {number[]} * @private */ private _effectVersions; /** * Whether an effect taking part in the composition requires the scene depth, which its chunk * then reads with the functions of the depth chunk the composition includes. * * @type {boolean} * @private */ private _effectsRequireDepth; cameraComponent: CameraComponent; sceneTextureId: import("../../index.js").ScopeId; sceneTextureSizeId: import("../../index.js").ScopeId; sceneTextureSizeValue: Float32Array; composeTargetFlipYId: import("../../index.js").ScopeId; cameraParams: Float32Array; cameraParamsId: import("../../index.js").ScopeId; /** * Sets the effects taking part in the composition, all of which it composes. Each effect's * chunk can be overridden by its chunk name in the device's shader chunks; without an override * the effect's own source is used. Assigned on every CameraFrame#update - which can run every * frame - so assigning the same effects with unchanged defines costs only the comparison. * * @type {CameraFrameEffect[]} */ set effects(value: CameraFrameEffect[]); get effects(): CameraFrameEffect[]; /** * Tracks the override names of the effects' chunks for changes, alongside the custom compose * chunks, so that setting or removing an override rebuilds the shader. * * An effect's own source is deliberately never put into the device's shader chunks: the map is * shared by everything on the device, so the first source registered under a name would stay * there, and a later effect with the same id - a replacement, a hot-reloaded script, the effect * of another camera - would silently render it instead of its own. An entry in the map under an * effect's chunk name is therefore always a user override. * * @private */ private _trackEffectChunks; /** * Collects the contributions of the active effects: the declarations of their chunks, assembled * into one include, and the defines driving the static slot and debug chunks of the composition * - a call count per slot with the entry function names injected into the slot's call chunk, * and the debug function of the effect providing the active debug view. * * @param {string} shaderLanguage - The shader language. * @param {Map} defines - The defines the effects add to. * @returns {Map} The assembled includes. * @private */ private _buildEffectChunks; set debug(value: any); get debug(): any; /** * Whether the scene depth this frame renders is available to sample, which the depth debug mode * displays instead of producing a depth of its own - a debug mode never changes what is rendered. * * @type {boolean} */ set sceneDepthAvailable(value: boolean); get sceneDepthAvailable(): boolean; /** * The debug mode the shader is built for. This is the requested mode, except that a request for the * depth with no depth to sample renders black instead. * * @type {string|null} * @private */ private get _debugMode(); set toneMapping(value: number); get toneMapping(): number; /** * Returns the compose shader variant for the current state: the key identifying the program, * the fragment defines, and the fragment includes. Split out from {@link frameUpdate} so the * variant can be inspected without a shader being created, which the compose shader snapshot * test relies on. * * @param {string} shaderLanguage - The shader language the variant is built for, SHADERLANGUAGE_GLSL * or SHADERLANGUAGE_WGSL. * @returns {{ key: string, defines: Map, includes: Map|undefined }} * The variant. * @ignore */ getShaderVariant(shaderLanguage: string): { key: string; defines: Map; includes: Map | undefined; }; } import { RenderPassShaderQuad } from '../../scene/graphics/render-pass-shader-quad.js'; import type { Texture } from '../../platform/graphics/texture.js'; import type { CameraComponent } from '../../framework/components/camera/component.js'; import type { CameraFrameEffect } from './camera-frame-effect.js'; import type { GraphicsDevice } from '../../platform/graphics/graphics-device.js';