|
@@ -40,16 +40,6 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- function resize() {
|
|
|
|
-
|
|
|
|
- camera.aspect = window.innerWidth / window.innerHeight;
|
|
|
|
- camera.updateProjectionMatrix();
|
|
|
|
- renderer.setSize( window.innerWidth, window.innerHeight );
|
|
|
|
-
|
|
|
|
- pixelPass.uniforms[ "resolution" ].value.set( window.innerWidth, window.innerHeight ).multiplyScalar( window.devicePixelRatio );
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
function init() {
|
|
function init() {
|
|
|
|
|
|
const container = document.getElementById( 'container' );
|
|
const container = document.getElementById( 'container' );
|
|
@@ -122,7 +112,7 @@
|
|
pixelPass.uniforms[ "resolution" ].value.multiplyScalar( window.devicePixelRatio );
|
|
pixelPass.uniforms[ "resolution" ].value.multiplyScalar( window.devicePixelRatio );
|
|
composer.addPass( pixelPass );
|
|
composer.addPass( pixelPass );
|
|
|
|
|
|
- window.addEventListener( 'resize', resize );
|
|
|
|
|
|
+ window.addEventListener( 'resize', onWindowResize );
|
|
|
|
|
|
params = {
|
|
params = {
|
|
pixelSize: 16,
|
|
pixelSize: 16,
|
|
@@ -134,6 +124,16 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function onWindowResize() {
|
|
|
|
+
|
|
|
|
+ camera.aspect = window.innerWidth / window.innerHeight;
|
|
|
|
+ camera.updateProjectionMatrix();
|
|
|
|
+ renderer.setSize( window.innerWidth, window.innerHeight );
|
|
|
|
+
|
|
|
|
+ pixelPass.uniforms[ "resolution" ].value.set( window.innerWidth, window.innerHeight ).multiplyScalar( window.devicePixelRatio );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
function update() {
|
|
function update() {
|
|
|
|
|
|
controls.update();
|
|
controls.update();
|