This commit is contained in:
2026-03-23 19:56:37 +02:00
parent 45074d78d2
commit 627452a308
4 changed files with 15 additions and 21 deletions
+6 -7
View File
@@ -68,12 +68,12 @@ class GameEngine extends EventManager{
dirLight.castShadow = true;
dirLight.shadow.mapSize.width = 1024;
dirLight.shadow.mapSize.height = 1024;
const d = 10;
const d = 50;
dirLight.shadow.camera.left = - d;
dirLight.shadow.camera.right = d;
dirLight.shadow.camera.top = d;
dirLight.shadow.camera.bottom = - d;
dirLight.shadow.camera.far = 1000;
dirLight.shadow.camera.far = 100;
dirLight.shadow.bias = - 0.001;
// const spotLight = new THREE.SpotLight(0xffffff);
@@ -162,7 +162,7 @@ class GameEngine extends EventManager{
renderer.toneMapping = THREE.CineonToneMapping;
renderer.toneMappingExposure = 1.0;
renderer.shadowMap.enabled = true;
renderer.shadowMap.type = THREE.PCFShadowMap; // default THREE.PCFShadowMap
renderer.shadowMap.type = THREE.VSMShadowMap; // default THREE.PCFShadowMap
// renderer.toneMapping = THREE.ACESFilmicToneMapping;
// renderer.toneMappingExposure = 1;
// renderer.shadowMap.enabled = true;
@@ -674,18 +674,15 @@ class GameEngine extends EventManager{
this.ambientSound.stop();
this.loadedObjects.forEach(o=>clearObject(o.scene))
GameEngine.loadedTextures.forEach(t=>{
//console.log('Disposing', t.name, this.renderer.info.memory.textures );
t.dispose();
//console.log('Disposed', t.name, this.renderer.info.memory.textures );
});
GameEngine.loadedTextures.splice(0, GameEngine.loadedTextures.length);
this.scene.background?.dispose?.();
this.scene.environment?.dispose?.();
clearObject(this.scene);
this.scene = null;
this.tm?.setScene(null);
this.removeAllListenersOfType('beforeRender');
this.renderer.renderLists.dispose();
this.renderer.properties.dispose();
}
async resetScene(){
@@ -703,6 +700,8 @@ class GameEngine extends EventManager{
this.arBtn?.remove();
this.xrBtn?.remove();
this.stats?.dom?.remove();
this.renderer.renderLists.dispose();
this.renderer.properties.dispose();
this.renderer.domElement.removeEventListener('wheel', this._wheelEvent)
this.renderer.domElement.remove();
super.dispose();