1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00
This commit is contained in:
Kevin Levron 2020-10-03 11:19:03 +02:00
parent 440a854417
commit 0f830f1b01
2 changed files with 7 additions and 4 deletions

View File

@ -1,15 +1,16 @@
<template>
<Renderer ref="renderer" :auto-clear="false" :orbit-ctrl="{ enableDamping: true, dampingFactor: 0.05 }" mouse-move="body" :mouse-raycast="true">
<Camera :position="{ z: 200 }" />
<StandardMaterial id="material" :transparent="true" :opacity="0.9" :metalness="0.8" :roughness="0.5" />
<PhongMaterial id="material1" />
<Scene>
<AmbientLight color="#808080" />
<PointLight color="#ff6000" />
<PointLight ref="light" color="#0060ff" :intensity="0.5" />
<InstancedMesh ref="imesh" material-id="material" :count="NUM_INSTANCES">
<BoxGeometry :width="2" :height="2" :depth="10" />
<StandardMaterial :transparent="true" :opacity="0.9" :metalness="0.8" :roughness="0.5" />
</InstancedMesh>
<Text
text="TroisJS"
font-src="helvetiker_regular.typeface.json"
@ -19,7 +20,9 @@
:height="5"
:position="{ x: 0, y: 0, z: 0 }"
:cast-shadow="true"
/>
>
<PhongMaterial />
</Text>
</Scene>
<EffectComposer>
<RenderPass />

View File

@ -1,12 +1,12 @@
<template>
<Renderer ref="renderer" :orbit-ctrl="{ enableDamping: true, dampingFactor: 0.05 }" :shadow="true">
<Camera :position="{ z: 100 }" />
<PhongMaterial id="material" color="#ffffff" />
<Scene>
<SpotLight color="#ffffff" :intensity="0.5" :position="{ y: 150, z: 0 }" :cast-shadow="true" :shadow-map-size="{ width: 1024, height: 1024 }" />
<SpotLight color="#ff0000" :intensity="0.5" :position="{ y: -150, z: 0 }" :cast-shadow="true" :shadow-map-size="{ width: 1024, height: 1024 }" />
<InstancedMesh ref="imesh" material-id="material" :count="NUM_INSTANCES" :cast-shadow="true" :receive-shadow="true">
<SphereGeometry :radius="5" />
<PhongMaterial />
</InstancedMesh>
</Scene>
<EffectComposer>