upd
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simple_Not 2023-08-02 13:11:47 +10:00
parent 0747c56328
commit 873c003580

25
main.js
View File

@ -44,6 +44,11 @@ import { OutlineEffect } from 'three/addons/effects/OutlineEffect.js';
import { FontLoader } from 'three/addons/loaders/FontLoader.js'; import { FontLoader } from 'three/addons/loaders/FontLoader.js';
import { TextGeometry } from 'three/addons/geometries/TextGeometry.js'; import { TextGeometry } from 'three/addons/geometries/TextGeometry.js';
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';
let container, stats; let container, stats;
let camera, scene, renderer, effect; let camera, scene, renderer, effect;
@ -169,6 +174,20 @@ function init( font ) {
effect = new OutlineEffect( renderer ); effect = new OutlineEffect( renderer );
// postprocessing
composer = new EffectComposer( renderer );
composer.addPass( new RenderPass( scene, camera ) );
glitchPass = new GlitchPass();
composer.addPass( glitchPass );
const outputPass = new OutputPass();
composer.addPass( outputPass );
// //
stats = new Stats(); stats = new Stats();
@ -198,7 +217,8 @@ function animate() {
requestAnimationFrame( animate ); requestAnimationFrame( animate );
stats.begin(); stats.begin();
render(); //render();
composer.render();
stats.end(); stats.end();
} }
@ -211,6 +231,7 @@ function render() {
particleLight.position.y = Math.cos( timer * 5 ) * 400; particleLight.position.y = Math.cos( timer * 5 ) * 400;
particleLight.position.z = Math.cos( timer * 3 ) * 300; particleLight.position.z = Math.cos( timer * 3 ) * 300;
effect.render( scene, camera ); //effect.render( scene, camera );
composer.render();
} }