Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadows for intersections #894

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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