Skip to content

Commit

Permalink
add shadowCameraAutomatic option
Browse files Browse the repository at this point in the history
add shadowCameraAutomatic option
delete shadowCamera parameters
  • Loading branch information
Algorush committed Jan 8, 2024
1 parent 938e55f commit 7b7bd13
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -422,15 +422,15 @@ 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');
sky.setAttribute('src', `url(${assetsPathRoot}images/skies/2048-kloofendal_43d_clear_puresky-sdr.jpeg)`);
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');
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 7b7bd13

Please sign in to comment.