Skip to content

Commit

Permalink
Update threejs render performance
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkunGao committed May 15, 2023
1 parent 21f1366 commit 55fcccb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/Renderer/baseRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ export default class baseRenderer {
});
}

this.renderer.physicallyCorrectLights = true;
// this.renderer.useLegacyLights = true;
this.renderer.outputEncoding = THREE.sRGBEncoding;
this.renderer.useLegacyLights = true;
this.renderer.outputColorSpace = THREE.SRGBColorSpace;
this.gui = null;
this.stats = Stats();
this.stats = new Stats();
this.pmremGenerator = new THREE.PMREMGenerator(this.renderer);
this.pmremGenerator.compileEquirectangularShader();
this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
Expand Down
6 changes: 4 additions & 2 deletions src/Renderer/copperMSceneRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ export default class copperMSceneRenderer {
}

init() {
this.renderer.physicallyCorrectLights = true;
this.renderer.outputEncoding = THREE.sRGBEncoding;
// this.renderer.physicallyCorrectLights = true;
// this.renderer.outputEncoding = THREE.sRGBEncoding;
this.renderer.useLegacyLights = true;
this.renderer.outputColorSpace = THREE.SRGBColorSpace;

this.pmremGenerator.compileEquirectangularShader();
this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
Expand Down

0 comments on commit 55fcccb

Please sign in to comment.