1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| import { EffectComposer, RenderPass, SelectiveBloomEffect, BlendFunction, EffectPass, SMAAEffect, OutlineEffect, } from "postprocessing";
const composer = new EffectComposer(renderer);
composer.addPass(new RenderPass(scene, camera));
const bloomEffect = new SelectiveBloomEffect(scene, camera, { mipmapBlur: true, blendFunction: BlendFunction.ADD, luminanceThreshold: 0.7, luminanceSmoothing: 0.3, intensity: 10, });
const outlineEffect = new OutlineEffect(scene, camera, { blendFunction: BlendFunction.ADD, edgeStrength: 3, pulseSpeed: 0, visibleEdgeColor: 0xffffff, hiddenEdgeColor: 0x22090a, blur: false, xRay: true, usePatternTexture: false, });
const outlinePass = new EffectPass(camera, outlineEffect); composer.addPass(outlinePass);
const smaaEffect = new SMAAEffect();
let effectPass = new EffectPass(camera, bloomEffect, smaaEffect); composer.addPass(effectPass);
const render = () => { controls.update(); composer.render(); requestAnimationFrame(render); }; render();
|