Skip to content

Commit

Permalink
add shadow to day preset
Browse files Browse the repository at this point in the history
  • Loading branch information
kfarr committed Sep 26, 2023
1 parent 0428231 commit c2dee5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@

<a-entity id="environment" data-layer-name="Environment" street-environment="preset: day;"></a-entity>

<!-- <a-entity position="-60 56 -16" light="intensity: 2.2; castShadow: true; shadowCameraBottom: -20; shadowCameraLeft: -30; shadowCameraRight: 40; shadowCameraTop: 30; shadowMapHeight: 1024; shadowMapWidth: 1024" visible=""></a-entity> -->

<a-entity id="street-container" data-layer-name="3D Street Layers" data-layer-show-children>
<a-entity id="default-street" street="length: 60; globalAnimated: true" streetmix-loader set-loader-from-hash></a-entity>
</a-entity>
Expand Down
9 changes: 6 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,14 @@ AFRAME.registerComponent('street-environment', {
sky.setAttribute('rotation', '0 0 0');
} else if (this.data.preset === 'day') { // day
// TODO: create a parent with children
light1.setAttribute('light', 'intensity', 2);
light2.setAttribute('light', 'intensity', 0.6);
light1.setAttribute('light', 'intensity', 0.8);
sky.setAttribute('color', '#FFF');
sky.setAttribute('src', '#sky');
sky.setAttribute('rotation', '0 255 0');
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('position', '-60 56 -16');

} else if (this.data.preset === 'sunny-morning') {
// copied from day
light1.setAttribute('light', 'intensity', 2);
Expand Down

0 comments on commit c2dee5e

Please sign in to comment.