shadows
This commit is contained in:
parent
738a621318
commit
a7470d997b
|
@ -9,6 +9,7 @@ const controlsState = reactive({
|
||||||
maxDistance: 5,
|
maxDistance: 5,
|
||||||
enablePan: false,
|
enablePan: false,
|
||||||
enebleZoom: false,
|
enebleZoom: false,
|
||||||
|
maxPolarAngle: (Math.PI / 2) - 0.02,
|
||||||
// distance: 3
|
// distance: 3
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ renderer.value.shadowMap.enabled = true
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<TresMesh :position="[0, -1, 0]" :rotate-x="Math.PI * -0.5" receive-shadow cast-shadow>
|
<TresMesh :position="[0, -1, 0]" :rotate-x="Math.PI * -0.5" receive-shadow cast-shadow>
|
||||||
<TresBoxGeometry :args="[3, 3, 0.05]" />
|
<TresBoxGeometry :args="[8, 8, 0.05]" />
|
||||||
<TresMeshStandardMaterial color="pink" />
|
<TresMeshStandardMaterial color="pink" />
|
||||||
</TresMesh>
|
</TresMesh>
|
||||||
<Suspense>
|
<Suspense>
|
||||||
|
|
|
@ -16,10 +16,14 @@ box.getSize(size)
|
||||||
|
|
||||||
const box_size = [size.x, size.y, size.z]
|
const box_size = [size.x, size.y, size.z]
|
||||||
|
|
||||||
|
scene.children.forEach((el:any) => {
|
||||||
|
el.castShadow = true
|
||||||
|
el.receiveShadow = true
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<TresGroup>
|
<TresGroup>
|
||||||
<TresMesh :position="center" cast-shadow receive-shadow>
|
<TresMesh :position="center" cast-shadow receive-shadow v-if="false">
|
||||||
<TresBoxGeometry :args="box_size" />
|
<TresBoxGeometry :args="box_size" />
|
||||||
<TresMeshPhysicalMaterial :opacity="0" color="pink" :transparent="true" />
|
<TresMeshPhysicalMaterial :opacity="0" color="pink" :transparent="true" />
|
||||||
</TresMesh>
|
</TresMesh>
|
||||||
|
|
Loading…
Reference in New Issue