UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

137 lines (136 loc) 5.12 kB
/** * Render pass implementation of a common camera frame rendering with integrated post-processing * effects. * * @category Graphics * @ignore */ export class FramePassCameraFrame extends FramePass { constructor(app: any, cameraFrame: any, cameraComponent: any, options?: {}); app: any; prePass: any; scenePass: any; composePass: any; bloomPass: any; ssaoPass: any; taaPass: any; scenePassHalf: any; dofPass: any; volumetricFogPass: any; _renderTargetScale: number; /** * True if the render pass needs to be re-created because layers have been added or removed. * * @ignore */ layersDirty: boolean; /** * The camera frame that this render pass belongs to. * * @type {CameraFrame} */ cameraFrame: CameraFrame; /** * @type {RenderTarget|null} * @private */ private rt; cameraComponent: any; options: any; reset(): void; sceneTexture: Texture; sceneTextureHalf: Texture; rtHalf: RenderTarget; scenePassTransparent: RenderPassForward; colorGrabPass: FramePassColorGrab; afterPass: RenderPassForward; sanitizeOptions(options: any): any; set renderTargetScale(value: number); get renderTargetScale(): number; needsReset(options: any): boolean; update(options: any): void; createRenderTarget(name: any, depth: any, stencil: any, samples: any, flipY: any): RenderTarget; setupRenderPasses(options: any): void; hdrFormat: number; _bloomEnabled: boolean; _sceneHalfEnabled: any; sceneOptions: { resizeSource: any; scaleX: number; scaleY: number; }; /** * Scan all RenderPassForward instances in the pass chain and mark the first / last * layer render step per camera with firstCameraUse / lastCameraUse. This mirrors what * LayerComposition does for the non-CameraFrame path and ensures that beforePasses * collection and EVENT_PRERENDER / EVENT_POSTRENDER fire exactly once per camera. * * @private */ private updateCameraUseFlags; collectPasses(): any[]; createPasses(options: any): void; setupScenePrepass(options: any): void; setupScenePassSettings(pass: any): void; /** * Adds the camera's layers from the pass's layer composition to a forward render pass, starting * from the given index, till the end of the layer list, or till the last layer with the given id * and transparency is reached (inclusive). Only layers that the camera renders are added. * * @param {RenderPassForward} renderPass - The forward render pass to add the layers to. * @param {number} startIndex - The index of the first layer to be considered for adding. * @param {boolean} firstLayerClears - True if the first layer added should clear the render target. * @param {number} [lastLayerId] - The id of the last layer to be added. If not specified, all * layers till the end of the layer list are added. * @param {boolean} [lastLayerIsTransparent] - True if the last layer to be added is transparent. * Defaults to true. * @returns {number} Returns the index of last layer added. */ addCameraLayers(renderPass: RenderPassForward, startIndex: number, firstLayerClears: boolean, lastLayerId?: number, lastLayerIsTransparent?: boolean): number; setupScenePass(options: any): { lastAddedIndex: number; clearRenderTarget: boolean; }; setupSsaoPass(options: any): void; setupSceneHalfPass(options: any, sourceTexture: any): void; setupBloomPass(options: any, inputTexture: any): void; setupDofPass(options: any, inputTexture: any, inputTextureHalf: any): void; setupVolumetricFogPass(options: any): void; setupTaaPass(options: any): Texture; setupComposePass(options: any): void; setupAfterPass(options: any, scenePassesInfo: any): void; } /** * @import { CameraFrame } from './camera-frame.js' */ /** * Options used to configure the FramePassCameraFrame. To modify these options, you must create * a new instance of the FramePassCameraFrame with the desired settings. * * @ignore */ export class CameraFrameOptions { formats: any; stencil: boolean; samples: number; sceneColorMap: boolean; lastGrabLayerId: number; lastGrabLayerIsTransparent: boolean; lastSceneLayerId: number; lastSceneLayerIsTransparent: boolean; taaEnabled: boolean; bloomEnabled: boolean; ssaoType: string; ssaoBlurEnabled: boolean; prepassEnabled: boolean; dofEnabled: boolean; dofNearBlur: boolean; dofHighQuality: boolean; volumetricFogEnabled: boolean; } import { FramePass } from '../../platform/graphics/frame-pass.js'; import type { CameraFrame } from './camera-frame.js'; import { Texture } from '../../platform/graphics/texture.js'; import { RenderTarget } from '../../platform/graphics/render-target.js'; import { RenderPassForward } from '../../scene/renderer/render-pass-forward.js'; import { FramePassColorGrab } from '../../scene/graphics/frame-pass-color-grab.js';