From 7b7bd13a7a8141f5b03292b47de0c1076579f786 Mon Sep 17 00:00:00 2001 From: Alexander Goryushkin Date: Mon, 8 Jan 2024 19:16:07 -0300 Subject: [PATCH] add shadowCameraAutomatic option add shadowCameraAutomatic option delete shadowCamera parameters --- src/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index bddee277e..a74c818d7 100644 --- a/src/index.js +++ b/src/index.js @@ -403,11 +403,11 @@ AFRAME.registerComponent('street-environment', { sky.setAttribute('color', '#FFF'); sky.setAttribute('src', '#sky'); sky.setAttribute('rotation', '0 20 0'); - light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); + light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowMapHeight: 2048; shadowMapWidth: 2048'); light2.setAttribute('position', '-40 56 -16'); } else if (this.data.preset === 'sunny-morning') { light1.setAttribute('light', 'intensity', 0.8); - light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); + light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowMapHeight: 2048; shadowMapWidth: 2048'); light2.setAttribute('position', '-60 56 -16'); sky.setAttribute('visible', true); sky.setAttribute('color', '#FFF'); @@ -422,7 +422,7 @@ AFRAME.registerComponent('street-environment', { sky.setAttribute('rotation', '0 0 0'); } else if (this.data.preset === 'sunny-afternoon') { light1.setAttribute('light', 'intensity', 2); - light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); + light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowMapHeight: 2048; shadowMapWidth: 2048'); light2.setAttribute('position', '60 56 -16'); sky.setAttribute('visible', true); sky.setAttribute('color', '#FFF'); @@ -430,7 +430,7 @@ AFRAME.registerComponent('street-environment', { sky.setAttribute('rotation', '0 0 0'); } else if (this.data.preset === 'sunny-noon') { light1.setAttribute('light', 'intensity', 2); - light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); + light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowMapHeight: 2048; shadowMapWidth: 2048'); light2.setAttribute('position', '5 56 -16'); sky.setAttribute('visible', true); sky.setAttribute('color', '#FFF'); @@ -468,7 +468,7 @@ AFRAME.registerComponent('street-environment', { const light2 = this.light2; light2.setAttribute('id', 'env-light2'); light2.setAttribute('position', '-60 56 -16'); - light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 2048; shadowMapWidth: 2048'); + light2.setAttribute('light', 'intensity: 2.2; castShadow: true; shadowCameraAutomatic: #default-street; shadowMapHeight: 2048; shadowMapWidth: 2048'); el.appendChild(light2); this.sky = document.createElement('a-sky');