Skip to content

Commit 996a6ca

Browse files
vincentfretinclaude
andcommitted
Add material asset entities to the example scene
Two <a-material> assets (PBR and textured) shared across entities, plus an inline material(...) definition, to test the material property type. Requires an A-Frame build with aframevr/aframe#5846; with older builds these entities render with a default material and a warning. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 37001a2 commit 996a6ca

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

examples/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
<a-mixin id="purple" material="color: #93648D"></a-mixin>
7878
<a-mixin id="short" scale="1 0.5 1"></a-mixin>
7979
<a-mixin id="yellow" material="color: #FFC65D"></a-mixin>
80+
<a-material id="gold" color="#FFC65D" metalness="0.9" roughness="0.2"></a-material>
81+
<a-material id="crateMat" src="#crateImg" roughness="0.9"></a-material>
8082
<img id="crateImg" src="https://aframe.io/sample-assets/assets/images/wood/crate.gif" crossorigin="true">
8183
<img id="floorImg" src="https://aframe.io/sample-assets/assets/images/terrain/grasslight-big.jpg" crossorigin="true">
8284
</a-assets>
@@ -93,6 +95,12 @@
9395
<a-box id="aBox" position="0 2 0" height="2" color="#FFC65D"></a-box>
9496
<a-plane id="smiley" position="2.5 2 0" width="1" height="1" material="src: #canvasTexture" draw-smiley="canvas: #canvasTexture"></a-plane>
9597

98+
<!-- Shared material assets. -->
99+
<a-entity id="goldBox" geometry="primitive: box" material="material: #gold" position="0 5 -2"></a-entity>
100+
<a-entity id="goldSphere" geometry="primitive: sphere; radius: 0.5" material="material: #gold" position="1.5 5 -2"></a-entity>
101+
<a-entity id="crateBox" geometry="primitive: box" material="material: #crateMat" position="-1.5 5 -2"></a-entity>
102+
<a-entity id="inlineBox" geometry="primitive: box" material="material: material(shader: flat; color: #EF2D5E)" position="-3 5 -2"></a-entity>
103+
96104
<!-- Models. -->
97105
<a-entity class="boxClass" geometry="primitive: box" material="src: #crateImg" position="3 4 0"></a-entity>
98106
<a-entity class="boxClass" geometry="primitive: box" material="color: #0f0" position="4 2 4"></a-entity>

0 commit comments

Comments
 (0)