Constructs a new depth of field effect.
Optionalcamera: CameraThe main camera.
Optionaloptions: { The options.
OptionalblendThe blend function of this effect.
OptionalbokehThe scale of the bokeh blur.
OptionalfocalThe focal length. Range is [0.0, 1.0].
OptionalfocusThe normalized focus distance. Range is [0.0, 1.0].
OptionalfocusThe focus range. Range is [0.0, 1.0].
Optionalheight?: numberDeprecated. Use resolutionY instead.
OptionalresolutionThe resolution scale.
OptionalresolutionX?: numberThe horizontal resolution.
OptionalresolutionY?: numberThe vertical resolution.
Optionalwidth?: numberDeprecated. Use resolutionX instead.
OptionalworldThe focus distance in world units.
OptionalworldThe focus distance in world units.
ReadonlyblendThe blend mode of this effect.
ReadonlyblurThis pass blurs the foreground CoC buffer to soften edges.
ReadonlydefinesPreprocessor macro definitions.
Call Effect.setChanged after changing macro definitions.
ReadonlyextensionsWebGL extensions that are required by this effect.
Call Effect.setChanged after adding or removing extensions.
The name of this effect.
ProtectedrendererThe renderer.
A target position that should be kept in focus. Set to null to disable auto focus.
ReadonlyuniformsShader uniforms.
Call Effect.setChanged after adding or removing uniforms.
The current bokeh scale.
The circle of confusion material.
The circle of confusion material.
The circle of confusion texture.
ExperimentalThe input color space.
Protected ExperimentalSets the main camera.
Sets the main scene.
The mask function. Default is MULTIPLY_RGB.
ExperimentalThe output color space.
Should only be changed if this effect converts the input colors to a different color space.
Protected ExperimentalThe resolution of this effect.
Adds a listener to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Fire an event type.
Performs a shallow search for properties that define a dispose method and deletes them.
The EffectComposer calls this method when it is being destroyed.
Returns the effect attributes.
The attributes.
Returns the pass that blurs the foreground CoC buffer to soften edges.
The blur pass.
Returns the circle of confusion material.
The material.
Returns the WebGL extensions that are required by this effect.
The extensions.
Returns the resolution settings.
The resolution.
Checks if listener is added to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Removes a listener from an event type.
The type of the listener that gets removed.
The listener function that gets removed.
ProtectedsetProtectedSets the effect attributes.
Effects that have the same attributes will be executed in the order in which they were registered. Some attributes imply a higher priority.
The attributes.
ProtectedsetProtectedInforms the associated EffectPass that this effect requires a shader recompilation.
Should be called after changing macros or extensions and after adding/removing uniforms.
Sets the depth texture.
You may override this method if your effect requires direct access to the depth texture that is bound to the associated EffectPass.
A depth texture.
OptionaldepthPacking: DepthPackingStrategiesThe depth packing.
ProtectedsetProtectedsetUpdates this effect.
The renderer.
A frame buffer that contains the result of the previous pass.
OptionaldeltaTime: numberThe time between the last frame and the current one in seconds.
A depth of field effect.
Based on a graphics study by Adrian Courrèges and an article by Steve Avery: https://www.adriancourreges.com/blog/2016/09/09/doom-2016-graphics-study/ https://pixelmischiefblog.wordpress.com/2016/11/25/bokeh-depth-of-field/