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