Skip to content

Commit

Permalink
Merge pull request #228 from LinkunGao/feat/v1.15.0
Browse files Browse the repository at this point in the history
Update threejs render performance
  • Loading branch information
LinkunGao authored May 15, 2023
2 parents dc93d09 + 55fcccb commit 700b510
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 700b510

Please sign in to comment.