Skip to content

Commit

Permalink
hide shadows for mobile on laser controls example (aframevr#2801)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngokevin authored and dmarcos committed Jun 21, 2017
1 parent 26f9c58 commit 06334dc
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion examples/test/laser-controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@
}
}
});

AFRAME.registerComponent('shadow-if-mobile', {
init: function () {
if (!this.el.sceneEl.isMobile) {
this.el.setAttribute('light', {
castShadow: true,
shadowMapWidth: 2048,
shadowMapHeight: 1024
});
}
}
});
</script>

<a-scene antialias="true">
Expand All @@ -48,7 +60,7 @@

<a-circle rotation="-90 0 0" radius="20" color="#666" position="0 -0.1 0" shadow="receive: true" roughness="1"></a-circle>

<a-light type="point" position="0 10 -30" intensity="0.85" light="castShadow: true; shadowMapWidth: 2048; shadowMapHeight: 1024"></a-light>
<a-light type="point" position="0 10 -30" intensity="0.85" shadow-if-mobile></a-light>

<a-torus radius="20" arc="190" rotation="0 90 0">
<a-animation attribute="rotation" to="0 450 0" repeat="indefinite" dur="16000" easing="linear"></a-animation>
Expand Down

0 comments on commit 06334dc

Please sign in to comment.