|
|
@@ -50,7 +50,7 @@
|
|
|
import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
|
|
|
import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';
|
|
|
import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
|
|
|
- import { FXAAShader } from 'three/addons/shaders/FXAAShader.js';
|
|
|
+ import { FXAAPass } from 'three/addons/postprocessing/FXAAPass.js';
|
|
|
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
|
|
|
|
|
|
let camera, scene, renderer, controls, container;
|
|
|
@@ -119,7 +119,7 @@
|
|
|
|
|
|
//
|
|
|
|
|
|
- fxaaPass = new ShaderPass( FXAAShader );
|
|
|
+ fxaaPass = new FXAAPass();
|
|
|
|
|
|
const outputPass = new OutputPass();
|
|
|
|
|
|
@@ -129,11 +129,6 @@
|
|
|
|
|
|
//
|
|
|
|
|
|
- const pixelRatio = renderer.getPixelRatio();
|
|
|
-
|
|
|
- fxaaPass.material.uniforms[ 'resolution' ].value.x = 1 / ( container.offsetWidth * pixelRatio );
|
|
|
- fxaaPass.material.uniforms[ 'resolution' ].value.y = 1 / ( container.offsetHeight * pixelRatio );
|
|
|
-
|
|
|
composer2 = new EffectComposer( renderer );
|
|
|
composer2.addPass( renderPass );
|
|
|
composer2.addPass( outputPass );
|
|
|
@@ -157,11 +152,6 @@
|
|
|
composer1.setSize( container.offsetWidth, container.offsetHeight );
|
|
|
composer2.setSize( container.offsetWidth, container.offsetHeight );
|
|
|
|
|
|
- const pixelRatio = renderer.getPixelRatio();
|
|
|
-
|
|
|
- fxaaPass.material.uniforms[ 'resolution' ].value.x = 1 / ( container.offsetWidth * pixelRatio );
|
|
|
- fxaaPass.material.uniforms[ 'resolution' ].value.y = 1 / ( container.offsetHeight * pixelRatio );
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function animate() {
|