|
@@ -256,7 +256,7 @@
|
|
|
// gui
|
|
|
|
|
|
gui = new GUI();
|
|
|
- gui.add( api, 'webgpu', true ).onChange( () => {
|
|
|
+ gui.add( api, 'webgpu' ).onChange( () => {
|
|
|
|
|
|
init( ! api.webgpu );
|
|
|
|
|
@@ -296,19 +296,14 @@
|
|
|
|
|
|
function onWindowResize() {
|
|
|
|
|
|
- renderer.setSize( window.innerWidth, window.innerHeight );
|
|
|
-
|
|
|
- const aspect = window.innerWidth / window.innerHeight;
|
|
|
-
|
|
|
- camera.aspect = aspect;
|
|
|
-
|
|
|
- const frustumHeight = camera.top - camera.bottom;
|
|
|
-
|
|
|
- camera.left = - frustumHeight * aspect / 2;
|
|
|
- camera.right = frustumHeight * aspect / 2;
|
|
|
+ const width = window.innerWidth;
|
|
|
+ const height = window.innerHeight;
|
|
|
|
|
|
+ camera.aspect = width / height;
|
|
|
camera.updateProjectionMatrix();
|
|
|
|
|
|
+ renderer.setSize( width, height );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|