This commit is contained in:
parent
2295627d5a
commit
e78c129a1e
36
main.js
36
main.js
@ -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 );
|
||||
|
||||
|
||||
|
||||
@ -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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user