Skip to content

Commit

Permalink
Merge pull request #894 from 3DStreet/shadows-for-intersections
Browse files Browse the repository at this point in the history
Shadows for intersections
  • Loading branch information
kfarr authored Oct 9, 2024
2 parents 3e2bd59 + d0bc57d commit 1c510de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,9 @@ function buildAssetHTML(assetUrl, categories) {
<a-mixin shadow id="arched-building-04" scale="1 1 1" rotation="0 0 0" gltf-part="src: #archedmodel; part: arched-building-04"></a-mixin>
`,
'intersection-props': `
<a-asset-item id="stopsign" src="${assetUrl}sets/road-signs/gltf-exports/draco/stop-sign.glb"></a-asset-item>
<a-asset-item id="signal1" src="${assetUrl}sets/signals/gltf-exports/draco/signal1.glb"></a-asset-item>
<a-asset-item id="signal2" src="${assetUrl}sets/signals/gltf-exports/draco/signal2.glb"></a-asset-item>
<a-mixin id="signal_left" gltf-model="#signal1"></a-mixin>
<a-mixin id="signal_right" gltf-model="#signal2"></a-mixin>
<a-mixin id="stop_sign" gltf-model="#stopsign"></a-mixin>
<a-mixin shadow id="signal_left" gltf-model="url(${assetUrl}sets/signals/gltf-exports/draco/signal1.glb)"></a-mixin>
<a-mixin shadow id="signal_right" gltf-model="url(${assetUrl}sets/signals/gltf-exports/draco/signal2.glb)"></a-mixin>
<a-mixin shadow id="stop_sign" gltf-model="url(${assetUrl}sets/road-signs/gltf-exports/draco/stop-sign.glb)"></a-mixin>
`,
'segment-textures': `
<!-- segment mixins with textures -->
Expand Down
2 changes: 2 additions & 0 deletions src/components/intersection.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ AFRAME.registerComponent('intersection', {
'material',
'src: #asphalt-texture; repeat:5 5; roughness:1'
);
this.el.setAttribute('shadow', '');

function createSidewalkElem({
length,
Expand All @@ -73,6 +74,7 @@ AFRAME.registerComponent('intersection', {
sd.setAttribute('scale', scaleVec);
sd.setAttribute('rotation', rotationVec);
sd.setAttribute('mixin', 'sidewalk');
sd.setAttribute('shadow', 'cast: false;');
sd.classList.add('autocreated');
sd.setAttribute(
'material',
Expand Down

0 comments on commit 1c510de

Please sign in to comment.