Class: PostProcessingPipeline
Defined in: src/core/PostProcessing.ts:202
An opt-in stack of GPU post-processing passes. Add passes with
addBloom, addVignette, and addDepthOfField, then
attach it with scene.usePostProcessing(pipeline).
Constructors
Constructor
new PostProcessingPipeline():
PostProcessingPipeline
Returns
PostProcessingPipeline
Accessors
enabled
Get Signature
get enabled():
boolean
Defined in: src/core/PostProcessing.ts:218
Whether the pipeline is active. When false the renderer uses the direct render path, exactly as if no pipeline were attached.
Returns
boolean
Set Signature
set enabled(
value):void
Defined in: src/core/PostProcessing.ts:222
Parameters
value
boolean
Returns
void
isReady
Get Signature
get isReady():
boolean
Defined in: src/core/PostProcessing.ts:237
Whether the composer is built and ready to render this frame.
Returns
boolean
Methods
addBloom()
addBloom(
options):this
Defined in: src/core/PostProcessing.ts:251
Add a bloom (glow) pass. Bright areas bleed a soft halo.
Parameters
options
BloomOptions = {}
strength, radius, threshold
Returns
this
this for chaining
addDepthOfField()
addDepthOfField(
options):this
Defined in: src/core/PostProcessing.ts:284
Add a bokeh depth-of-field pass. Reads explicit focus/aperture/maxblur, or
their defaults. A ThreeDCamera's depthOfField/focalDistance can be fed
in through the options.
Parameters
options
DepthOfFieldOptions = {}
focus, aperture, maxblur
Returns
this
this for chaining
addVignette()
addVignette(
options):this
Defined in: src/core/PostProcessing.ts:267
Add a vignette pass that darkens the frame edges.
Parameters
options
VignetteOptions = {}
offset, darkness
Returns
this
this for chaining
clear()
clear():
this
Defined in: src/core/PostProcessing.ts:296
Remove all configured passes and drop the built composer.
Returns
this
dispose()
dispose():
void
Defined in: src/core/PostProcessing.ts:363
Dispose GPU resources held by the composer.
Returns
void
getPassConfigs()
getPassConfigs(): readonly
PassConfig[]
Defined in: src/core/PostProcessing.ts:242
The configured passes, in insertion order.
Returns
readonly PassConfig[]
prepare()
prepare():
Promise<void>
Defined in: src/core/PostProcessing.ts:357
Preload the post-processing modules so the next render can build the composer synchronously. Safe to call repeatedly. Resolves even if loading is already in flight.
Returns
Promise<void>
render()
render(
renderer,scene,camera,width,height,deltaTime?):boolean
Defined in: src/core/PostProcessing.ts:331
Render one frame through the composer.
Returns true when the composer drew the frame, false when it could not (modules still loading, no passes, or the build failed). On false the caller falls back to its direct render path, so default behavior is kept.
Parameters
renderer
the three WebGLRenderer
scene
the three Scene
camera
the three Camera
width
number
canvas width in CSS pixels
height
number
canvas height in CSS pixels
deltaTime?
number
optional frame delta in seconds
Returns
boolean
setEnabled()
setEnabled(
value):this
Defined in: src/core/PostProcessing.ts:231
Enable or disable the pipeline.
Parameters
value
boolean
true to route rendering through the composer
Returns
this
this for chaining
setSize()
setSize(
width,height):void
Defined in: src/core/PostProcessing.ts:309
Store the target size. Applied to the composer immediately when it exists, otherwise used when the composer is first built.
Parameters
width
number
canvas width in CSS pixels
height
number
canvas height in CSS pixels
Returns
void