Class ThinCircleOfConfusionPostProcess
Hierarchy (View Summary)
- EffectWrapper
- ThinCircleOfConfusionPostProcess
Constructors
constructor
-
new ThinCircleOfConfusionPostProcess(
name: string,
engine?: Nullable<AbstractEngine>,
options?: ThinCircleOfConfusionPostProcessOptions,
): ThinCircleOfConfusionPostProcessConstructs a new circle of confusion post process
Parameters
- name: string
Name of the effect
- engine: Nullable<AbstractEngine> = null
Engine to use to render the effect. If not provided, the last created engine will be used
Optionaloptions: ThinCircleOfConfusionPostProcessOptionsOptions to configure the effect
Returns ThinCircleOfConfusionPostProcess
- name: string
Properties
alpha Mode
Type of alpha mode to use when applying the effect (default: Engine.ALPHA_DISABLE). Used only if useAsPostProcess is true.
camera
The camera to use to calculate the circle of confusion
focal Length
Focal length of the effect's camera in scene units/1000 (eg. millimeter). (default: 50)
focus Distance
Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)
f Stop
F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)
lens Size
Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.
on Apply Observable
Event that is fired (only when the EffectWrapper is used with an EffectRenderer) right before the effect is drawn (should be used to update uniforms)
on Effect Created Observable
Executed when the effect is created
Readonlyoptions
Options used to create the effect wrapper
Static ReadonlyDefines Depth Not Normalized
Defines if the depth is normalized or not
StaticForce GLSL
Force code to compile to glsl even on WebGPU engines. False by default. This is mostly meant for backward compatibility.
Static ReadonlyFragment Url
The fragment shader url
Static ReadonlySamplers
The list of samplers used by the effect
Static ReadonlyUniforms
The list of uniforms used by the effect
Accessors
draw Wrapper
-
Get the draw wrapper associated with the effect wrapper
Returns DrawWrapper
the draw wrapper associated with the effect wrapper
effect
name
-
get name(): string
Gets or sets the name of the effect wrapper
Returns string
-
set name(value: string): void
Parameters
- value: string
Returns void
Methods
bind
-
Binds the data to the effect.
Parameters
- noDefaultBindings: boolean = false
if true, the default bindings (scale and alpha mode) will not be set.
Returns void
- noDefaultBindings: boolean = false
dispose
-
Disposes of the effect wrapper
Parameters
- _ignored: boolean = false
kept for backward compatibility
Returns void
- _ignored: boolean = false
is Ready
-
Get a value indicating if the effect is ready to be used
Returns boolean
true if the post-process is ready (shader is compiled)
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 effect wrapper 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
StaticRegister Shader Code Processing
-
RegisterShaderCodeProcessing(
effectWrapperName: Nullable<string>,
customShaderCodeProcessing?: EffectWrapperCustomShaderCodeProcessing,
): voidRegisters a shader code processing with an effect wrapper name.
Parameters
- effectWrapperName: Nullable<string>
name of the effect wrapper. 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 an effect wrapper name
OptionalcustomShaderCodeProcessing: EffectWrapperCustomShaderCodeProcessingshader code processing to associate to the effect wrapper name
Returns void
- effectWrapperName: Nullable<string>
Post process used to calculate the circle of confusion (used for depth of field, for example)