UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

102 lines (101 loc) 3.6 kB
import type { Camera } from "../../../Cameras/camera.js"; import { PostProcessRenderPipeline } from "../../../PostProcesses/RenderPipeline/postProcessRenderPipeline.js"; import type { Scene } from "../../../scene.js"; import "../../../PostProcesses/RenderPipeline/postProcessRenderPipelineManagerSceneComponent.js"; import "../../../Shaders/ssao.fragment.js"; import "../../../Shaders/ssaoCombine.fragment.js"; /** * Render pipeline to produce ssao effect */ export declare class SSAORenderingPipeline extends PostProcessRenderPipeline { /** * @ignore * The PassPostProcess id in the pipeline that contains the original scene color */ SSAOOriginalSceneColorEffect: string; /** * @ignore * The SSAO PostProcess id in the pipeline */ SSAORenderEffect: string; /** * @ignore * The horizontal blur PostProcess id in the pipeline */ SSAOBlurHRenderEffect: string; /** * @ignore * The vertical blur PostProcess id in the pipeline */ SSAOBlurVRenderEffect: string; /** * @ignore * The PostProcess id in the pipeline that combines the SSAO-Blur output with the original scene color (SSAOOriginalSceneColorEffect) */ SSAOCombineRenderEffect: string; /** * The output strength of the SSAO post-process. Default value is 1.0. */ totalStrength: number; /** * The radius around the analyzed pixel used by the SSAO post-process. Default value is 0.0006 */ radius: number; /** * Related to fallOff, used to interpolate SSAO samples (first interpolate function input) based on the occlusion difference of each pixel * Must not be equal to fallOff and superior to fallOff. * Default value is 0.0075 */ area: number; /** * Related to area, used to interpolate SSAO samples (second interpolate function input) based on the occlusion difference of each pixel * Must not be equal to area and inferior to area. * Default value is 0.000001 */ fallOff: number; /** * The base color of the SSAO post-process * The final result is "base + ssao" between [0, 1] */ base: number; private _scene; private _randomTexture; private _originalColorPostProcess; private _ssaoPostProcess; private _blurHPostProcess; private _blurVPostProcess; private _ssaoCombinePostProcess; private _firstUpdate; /** * Gets active scene */ get scene(): Scene; /** * @constructor * @param name - The rendering pipeline name * @param scene - The scene linked to this pipeline * @param ratio - The size of the postprocesses. Can be a number shared between passes or an object for more precision: { ssaoRatio: 0.5, combineRatio: 1.0 } * @param cameras - The array of cameras that the rendering pipeline will be attached to */ constructor(name: string, scene: Scene, ratio: any, cameras?: Camera[]); /** * @internal */ _attachCameras(cameras: any, unique: boolean): void; /** * Get the class name * @returns "SSAORenderingPipeline" */ getClassName(): string; /** * Removes the internal pipeline assets and detaches the pipeline from the scene cameras * @param disableDepthRender - If the depth renderer should be disabled on the scene */ dispose(disableDepthRender?: boolean): void; private _createBlurPostProcess; /** @internal */ _rebuild(): void; private _createSSAOPostProcess; private _createSSAOCombinePostProcess; private _createRandomTexture; }