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

This commit is contained in:
Simple_Not 2023-08-02 13:34:33 +10:00
parent 84eea795b3
commit 2295627d5a

40
main.js
View File

@ -44,18 +44,18 @@ import { OutlineEffect } from 'three/addons/effects/OutlineEffect.js';
import { FontLoader } from 'three/addons/loaders/FontLoader.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';
import { OutlinePass } from 'three/addons/postprocessing/OutlinePass.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';
// import { OutlinePass } from 'three/addons/postprocessing/OutlinePass.js';
let container, stats;
let camera, scene, renderer, effect;
let particleLight;
let composer, glitchPass, outlinePass;
//let composer, glitchPass, outlinePass;
const loader = new FontLoader();
loader.load( 'https://raw.githubusercontent.com/mrdoob/three.js/master/examples/fonts/gentilis_regular.typeface.json', function ( font ) {
@ -175,24 +175,24 @@ function init( font ) {
//
///effect = new OutlineEffect( renderer );
effect = new OutlineEffect( renderer );
// postprocessing
composer = new EffectComposer( renderer );
composer.addPass( new RenderPass( scene, camera ) );
// // composer = new EffectComposer( renderer );
// // composer.addPass( new RenderPass( scene, camera ) );
outlinePass = new OutlinePass( );
composer.addPass( outlinePass );
// // // outlinePass = new OutlinePass( );
// // // composer.addPass( outlinePass );
//composer.addPass( new OutlineEffect( ) );
// // //composer.addPass( new OutlineEffect( ) );
glitchPass = new GlitchPass();
composer.addPass( glitchPass );
// // glitchPass = new GlitchPass();
// // composer.addPass( glitchPass );
const outputPass = new OutputPass();
composer.addPass( outputPass );
// // const outputPass = new OutputPass();
// // composer.addPass( outputPass );
@ -225,8 +225,8 @@ function animate() {
requestAnimationFrame( animate );
stats.begin();
//render();
composer.render();
render();
//composer.render();
stats.end();
}
@ -239,7 +239,7 @@ function render() {
particleLight.position.y = Math.cos( timer * 5 ) * 400;
particleLight.position.z = Math.cos( timer * 3 ) * 300;
//effect.render( scene, camera );
effect.render( scene, camera );
composer.render();
//composer.render();
}