How to use the postprocessing.BloomPass function in postprocessing

To help you get started, we’ve selected a few postprocessing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ronik-design / love.ronikdesign.com / src / webgl / WebGLApp.js View on Github external
this._lastTime = rightNow();
    this._rafID = null;

    this.scene = new THREE.Scene();

    // fog
    this.scene.fog = new THREE.Fog(0x000000, 0, 60);

    // handle resize events
    window.addEventListener('resize', () => this.resize());
    window.addEventListener('orientationchange', () => this.resize());

    this.composer = new EffectComposer(this.renderer);
    this.composer.addPass(new RenderPass(this.scene, this.camera));

    const pass = new BloomPass({resolution: 0.2, kernelSize: 1, intensity: 2.5, distinction: 0.1});
    pass.renderToScreen = true;

    this.composer.addPass(pass);
    this.clock = new Clock();

    // force an initial resize event
    this.resize();
  }
github Jeremboo / scribble-lab / scribbles / blob&metaballs / organism / app.js View on Github external
// https://gitlab.com/Jeremboo/watermelon-sugar/blob/develop/src/js/webgl/index.js
const organism = new Organism();
organism.initGUI();

// Post processing
const clock = new Clock();
const composer = new EffectComposer(rm.renderer, {
  // stencilBuffer: true,
  // depthTexture: true,
});
composer.setSize(window.innerWidth, window.innerHeight);
const renderPass = new RenderPass(rm.scene, rm.renderCamera);
// renderPass.renderToScreen = true;
composer.addPass(renderPass);

const bloomPass = new BloomPass({
  intensity: 5,
  resolution: 5,
  kernelSize: 3,
  distinction: 0.9,
});
bloomPass.renderToScreen = true;
composer.addPass(bloomPass);


// START
function animate() {
  requestAnimationFrame(animate);
  organism.update();
  // rm.update();
  composer.render(clock.getDelta());
  // rm.render();
github Jeremboo / scribble-lab / scribbles / codevember2017 / 27_metaballsandbloom / app.js View on Github external
// stencilBuffer: true,
    // depthTexture: true,
  });

  // *********
  // PASSES
  const renderPass = new RenderPass(this.scene, this.camera);
  // renderPass.renderToScreen = true;
  this._composer.addPass(renderPass);

  // TODO add new custo pass (MASK PASS)
  const incrustationPass = new MetaballPass();
  // incrustationPass.renderToScreen = true;
  this._composer.addPass(incrustationPass);

  const bloomPass = new BloomPass({
    // intensity: 1,
    // resolution: 0.9,
    kernelSize: 4,
    // distinction: 2,
  });
  bloomPass.renderToScreen = true;
  this._composer.addPass(bloomPass);
}