Capítulo 821 de 859
Three.js supports post-processing effects (bloom, depth-of-field, glitch, anti-aliasing) via EffectComposer, which renders the scene to an offscreen buffer and then runs it through an ordered chain of passes before the result reaches the screen.
EffectComposer: the addon that manages the render-to-buffer-then-filter workflow; replaces calling renderer.render() directly with composer.render() in the animation loop.RenderPass: typically first in the chain — renders the actual scene/camera into the buffer that later passes consume.OutputPass: typically last — performs color-space conversion and tone mapping for final display.examples/jsm/postprocessing directory and can be dropped into the chain.ShaderPass: wraps a custom shader as a pass; CopyShader is a minimal starting point that just copies the composer's read buffer to its write buffer.import { EffectComposer } from "three/addons/postprocessing/EffectComposer.js";
import { RenderPass } from "three/addons/postprocessing/RenderPass.js";
import { GlitchPass } from "three/addons/postprocessing/GlitchPass.js";
import { OutputPass } from "three/addons/postprocessing/OutputPass.js";
RenderPass → effect pass → OutputPass chain.EffectComposer replaces renderer.render() in the animation loop once post-processing is set up.RenderPass first and OutputPass (color/tone mapping) last.examples/jsm/postprocessing and just need to be added to the chain.ShaderPass (with CopyShader as a starting template) is the way to plug in a custom post-processing shader.WebGLRenderer instance.