Capítulo 277 de 859
This pass is inspired by the bloom pass of Unreal Engine. It creates a mip map chain of bloom textures and blurs them with different radii. Because of the weighted combination of mips, and because larger blurs are done on higher mips, this effect provides good quality and performance.
When using this pass, tone mapping must be enabled in the renderer settings.
Reference:
[0,1].const resolution = new THREE.Vector2( window.innerWidth, window.innerHeight );
const bloomPass = new UnrealBloomPass( resolution, 1.5, 0.4, 0.85 );
composer.addPass( bloomPass );
Constructor
| Signature |
|---|
new UnrealBloomPass( resolution : Vector2, strength : number, radius : number, threshold : number ) |
Properties
| Property | Description |
|---|---|
.clearColor : Color | The effect's clear color |
.needsSwap : boolean | Overwritten to disable the swap. |
.radius : number | The Bloom radius. Must be in the range [0,1]. |
.resolution : Vector2 | The effect's resolution. |
.strength : number | The Bloom strength. |
.threshold : number | The luminance threshold limits which bright areas contribute to the Bloom effect. |
Methods
| Method | Description |
|---|---|
.dispose() | Frees the GPU-related resources allocated by this instance. Call this method whenever the pass is no longer used in your app. |
.render( renderer : WebGLRenderer, writeBuffer : WebGLRenderTarget, readBuffer : WebGLRenderTarget, deltaTime : number, maskActive : boolean ) | Performs the Bloom pass. |
.setSize( width : number, height : number ) | Sets the size of the pass. |