Class ExtractHighlightsPostProcess
Hierarchy (View Summary)
- PostProcess
- ExtractHighlightsPostProcess
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new ExtractHighlightsPostProcess(
name: string,
options: number | PostProcessOptions,
camera?: Nullable<Camera>,
samplingMode?: number,
engine?: AbstractEngine,
reusable?: boolean,
textureType?: number,
blockCompilation?: boolean,
): ExtractHighlightsPostProcessParameters
- name: string
- options: number | PostProcessOptions
- camera: Nullable<Camera> = null
OptionalsamplingMode: numberOptionalengine: AbstractEngineOptionalreusable: boolean- textureType: number = Constants.TEXTURETYPE_UNSIGNED_BYTE
- blockCompilation: boolean = false
Returns ExtractHighlightsPostProcess
Properties
adapt Scale To Current Viewport
Modify the scale of the post process to be the same as the viewport (default: false)
alpha Constants
Sets the setAlphaBlendConstants of the babylon engine
always Force POT
Force textures to be a power of two (default: false)
animations
Animations to be used for the post processing
auto Clear
If the buffer needs to be cleared before applying the post process. (default: true) Should be set to false if shader will overwrite all previous pixels.
clear Color
Clear color to use when screen clearing
do Not Serialize
Specifies if the post process should be serialized
enable Pixel Perfect Mode
Enable Pixel Perfect mode where texture is not scaled to be power of 2. Can only be used on a single postprocess or on the last one of a chain. (default: false)
external Texture Sampler Binding
if externalTextureSamplerBinding is true, the "apply" method won't bind the textureSampler texture, it is expected to be done by the "outside" (by the onApplyObservable observer most probably). counter-productive in some cases because if the texture bound by "apply" is different from the currently texture bound, (the one set by the onApplyObservable observer, for eg) some internal structures (materialContext) will be dirtified, which may impact performances
force Auto Clear In Alpha Mode
If clearing the buffer should be forced in autoClear mode, even when alpha mode is enabled (default: false). By default, the buffer will only be cleared if alpha mode is disabled (and autoClear is true).
force Fullscreen Viewport
Force the postprocess to be applied without taking in account viewport
height
Height of the texture to apply the post process on
inspectable Custom Properties
List of inspectable custom properties (used by the Inspector)
node Material Source
Gets the node material used to create this postprocess (null if the postprocess was manually created)
on Activate Observable
An event triggered when the postprocess is activated.
on After Render Observable
An event triggered after rendering the postprocess
on Apply Observable
An event triggered when the postprocess applies its effect.
on Before Render Observable
An event triggered before rendering the postprocess
Readonlyon Dispose Observable
An event triggered when the post-process is disposed
on Effect Created Observable
Executed when the effect was created
on Size Changed Observable
An event triggered when the postprocess changes its size.
render Target Sampling Mode
Sampling mode used by the shader
scale Mode
Scale mode for the post process (default: Engine.SCALEMODE_FLOOR)
| Value | Type | Description |
|---|---|---|
| 1 | SCALEMODE_FLOOR | engine.scalemode_floor |
| 2 | SCALEMODE_NEAREST | engine.scalemode_nearest |
| 3 | SCALEMODE_CEILING | engine.scalemode_ceiling |
unique Id
Gets or sets the unique id of the post process
width
Width of the texture to apply the post process on
Accessors
alpha Mode
-
get alphaMode(): number
Type of alpha mode to use when performing the post process (default: Engine.ALPHA_DISABLE)
Returns number
-
set alphaMode(value: number): void
Parameters
- value: number
Returns void
aspect Ratio
-
get aspectRatio(): number
The aspect ratio of the output texture.
Returns number
input Texture
-
The input texture for this post process and the output texture of the previous post process. When added to a pipeline the previous post process will render it's output into this texture and this texture will be used as textureSampler in the fragment shader of this post process.
Returns RenderTargetWrapper
-
Parameters
- value: RenderTargetWrapper
Returns void
is Supported
-
get isSupported(): boolean
If the post process is supported.
Returns boolean
name
-
get name(): string
Name of the PostProcess.
Returns string
-
set name(value: string): void
Parameters
- value: string
Returns void
on Activate
on After Render
-
A function that is added to the onAfterRenderObservable
Parameters
- callback: (efect: Effect) => void
Returns void
on Apply
-
A function that is added to the onApplyObservable
Parameters
- callback: (effect: Effect) => void
Returns void
on Before Render
-
A function that is added to the onBeforeRenderObservable
Parameters
- callback: (effect: Effect) => void
Returns void
on Size Changed
-
A function that is added to the onSizeChangedObservable
Parameters
- callback: (postProcess: PostProcess) => void
Returns void
samples
-
get samples(): number
Number of sample textures (default: 1)
Returns number
-
set samples(n: number): void
Parameters
- n: number
Returns void
shader Language
-
Gets the shader language type used to generate vertex and fragment source code.
Returns ShaderLanguage
texel Size
-
Gets the texel size of the postprocess. See https://en.wikipedia.org/wiki/Texel_(graphics)
Returns Vector2
threshold
-
get threshold(): number
The luminance threshold, pixels below this value will be set to black.
Returns number
-
set threshold(value: number): void
Parameters
- value: number
Returns void
StaticForce GLSL
-
get ForceGLSL(): boolean
Force all the postprocesses to compile to glsl even on WebGPU engines. False by default. This is mostly meant for backward compatibility.
Returns boolean
-
set ForceGLSL(force: boolean): void
Parameters
- force: boolean
Returns void
Methods
activate
-
activate(
cameraOrScene: Scene | Nullable<Camera>,
sourceTexture?: Nullable<InternalTexture>,
forceDepthStencil?: boolean,
): RenderTargetWrapperActivates the post process by intializing the textures to be used when executed. Notifies onActivateObservable. When this post process is used in a pipeline, this is call will bind the input texture of this post process to the output of the previous.
Parameters
- cameraOrScene: Scene | Nullable<Camera>
The camera that will be used in the post process. This camera will be used when calling onActivateObservable. You can also pass the scene if no camera is available.
- sourceTexture: Nullable<InternalTexture> = null
The source texture to be inspected to get the width and height if not specified in the post process constructor. (default: null)
OptionalforceDepthStencil: booleanIf true, a depth and stencil buffer will be generated. (default: false)
Returns RenderTargetWrapper
The render target wrapper that was bound to be written to.
- cameraOrScene: Scene | Nullable<Camera>
apply
clone
dispose
-
Disposes the post process.
Parameters
Optionalcamera: CameraThe camera to dispose the post process on.
Returns void
get Camera
-
Gets the camera which post process is applied to.
Returns Camera
The camera the post process is applied to.
get Class Name
-
Gets a string identifying the name of the class
Returns string
"ExtractHighlightsPostProcess" string
get Effect
-
The effect that is created when initializing the post process.
Returns Effect
The created effect corresponding to the postprocess.
get Effect Name
-
Returns the fragment url or shader name used in the post process.
Returns string
the fragment url or name in the shader store.
get Engine
-
Gets the engine which this post process belongs to.
Returns AbstractEngine
The engine the post process was enabled with.
is Ready
-
Get a value indicating if the post-process is ready to be used
Returns boolean
true if the post-process is ready (shader is compiled)
is Reusable
-
The post process is reusable if it can be used multiple times within one frame.
Returns boolean
If the post process is reusable
mark Texture Dirty
-
invalidate frameBuffer to hint the postprocess to create a depth buffer
Returns void
resize
-
resize(
width: number,
height: number,
camera?: Nullable<Camera>,
needMipMaps?: boolean,
forceDepthStencil?: boolean,
): voidResizes the post-process texture
Parameters
- width: number
Width of the texture
- height: number
Height of the texture
- camera: Nullable<Camera> = null
The camera this post-process is applied to. Pass null if the post-process is used outside the context of a camera post-process chain (default: null)
- needMipMaps: boolean = false
True if mip maps need to be generated after render (default: false)
- forceDepthStencil: boolean = false
True to force post-process texture creation with stencil depth and buffer (default: false)
Returns void
- width: number
restore Default Input Texture
-
Since inputTexture should always be defined, if we previously manually set
inputTexture, the only way to unset it is to use this function to restore its internal stateReturns void
serialize
-
Serializes the post process to a JSON object
Returns any
the JSON object
set Pre Pass Renderer
-
Sets the required values to the prepass renderer.
Parameters
- prePassRenderer: PrePassRenderer
defines the prepass renderer to setup.
Returns boolean
true if the pre pass is needed.
- prePassRenderer: PrePassRenderer
share Output With
-
To avoid multiple redundant textures for multiple post process, the output the output texture for this post process can be shared with another.
Parameters
- postProcess: PostProcess
The post process to share the output with.
Returns PostProcess
This post process.
- postProcess: PostProcess
update Effect
defines?: Nullable<string>,
uniforms?: Nullable<string[]>,
samplers?: Nullable<string[]>,
indexParameters?: any,
onCompiled?: (effect: Effect) => void,
onError?: (effect: Effect, errors: string) => void,
vertexUrl?: string,
fragmentUrl?: string,
): void
Updates the effect with the current post process compile time values and recompiles the shader.
Parameters
Define statements that should be added at the beginning of the shader. (default: null)
Set of uniform variables that will be passed to the shader. (default: null)
Set of Texture2D variables that will be passed to the shader. (default: null)
OptionalindexParameters: any
The index parameters to be used for babylons include syntax "#include[0..varyingCount]". (default: undefined) See usage in babylon.blurPostProcess.ts and kernelBlur.vertex.fx
OptionalonCompiled: (effect: Effect) => void
Called when the shader has been compiled.
OptionalonError: (effect: Effect, errors: string) => void
Called if there is an error when compiling a shader.
OptionalvertexUrl: string
The url of the vertex shader to be used (default: the one given at construction time)
OptionalfragmentUrl: string
The url of the fragment shader to be used (default: the one given at construction time)
Returns void
use Own Output
-
Reverses the effect of calling shareOutputWith and returns the post process back to its original state. This should be called if the post process that shares output with this post process is disabled/disposed.
Returns void
StaticParse
-
Creates a material from parsed material data
Parameters
- parsedPostProcess: any
defines parsed post process data
- scene: Scene
defines the hosting scene
- rootUrl: string
defines the root URL to use to load textures
Returns Nullable<PostProcess>
a new post process
- parsedPostProcess: any
StaticRegister Shader Code Processing
-
RegisterShaderCodeProcessing(
postProcessName: Nullable<string>,
customShaderCodeProcessing?: EffectWrapperCustomShaderCodeProcessing,
): voidRegisters a shader code processing with a post process name.
Parameters
- postProcessName: Nullable<string>
name of the post process. Use null for the fallback shader code processing. This is the shader code processing that will be used in case no specific shader code processing has been associated to a post process name
OptionalcustomShaderCodeProcessing: EffectWrapperCustomShaderCodeProcessingshader code processing to associate to the post process name
Returns void
- postProcessName: Nullable<string>
The extract highlights post process sets all pixels to black except pixels above the specified luminance threshold. Used as the first step for a bloom effect.