compositor()
ts
function compositor(
gl: WebGL2RenderingContext,
renderPass: RenderPass<any>,
effects: (EffectPass<any> | CompositeEffectPass<any>)[],
): Compositor;The compositor handles the combination of the main render pass and the subsequent effects.
It manages:
- Initialization of the WebGL context for all effects.
- Automatic creation of intermediate floating-point render targets.
- Injecting
previousPassandinputPassreferences into effect uniforms. - Automatic linking of the previous pass's output texture to the next effect's input.
- Rendering all passes in the correct order.
Parameters
gl
WebGL2RenderingContext
The WebGL2 context.
renderPass
RenderPass<any>
The main scene render pass.
effects
( | EffectPass<any> | CompositeEffectPass<any>)[]
An array of post-processing effects to apply.