Skip to content

Commit

Permalink
Update bloom.js to implement multisampling
Browse files Browse the repository at this point in the history
  • Loading branch information
enzofrancescaHM authored Jan 31, 2025
1 parent 97c97f7 commit fbf8c44
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/showcase/post-processing/bloom.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ AFRAME.registerComponent("bloom", {
this.scene = this.el.object3D;
this.renderer = this.el.renderer;
this.camera = this.el.camera;
this.composer = new EffectComposer(this.renderer);

// create composer with multisampling to avoid alias
const resolution = this.renderer.getDrawingBufferSize(new THREE.Vector2());
const renderTarget = new THREE.WebGLRenderTarget(resolution.width, resolution.height, { type: THREE.HalfFloatType, samples: 8 });
this.composer = new EffectComposer(this.renderer, renderTarget);

const renderScene = new RenderPass(this.scene, this.camera);
this.composer.addPass(renderScene);

Expand Down

0 comments on commit fbf8c44

Please sign in to comment.