fix: shadows

This commit is contained in:
Calum H.
2025-06-16 15:36:38 +01:00
parent b851cd8d7c
commit cbb7c80e21
3 changed files with 3 additions and 4 deletions

View File

@@ -39,7 +39,7 @@ class BatchSkinRenderer {
const ambientLight = new THREE.AmbientLight(0xffffff, 2)
const directionalLight = new THREE.DirectionalLight(0xffffff, 1.2)
directionalLight.castShadow = false
directionalLight.castShadow = true
directionalLight.position.set(2, 4, 3)
this.scene.add(ambientLight)
this.scene.add(directionalLight)

View File

@@ -52,8 +52,7 @@ function onImageLoad(type: 'forward' | 'backward') {
<span
v-show="imagesLoaded.forward && imagesLoaded.backward"
:class="[
'skin-button__image-parent pointer-events-none w-full h-full grid [transform-style:preserve-3d] transition-transform duration-500 group-hover:[transform:rotateY(180deg)] place-items-stretch',
selected ? 'with-shadow' : '',
'skin-button__image-parent pointer-events-none w-full h-full grid [transform-style:preserve-3d] transition-transform duration-500 group-hover:[transform:rotateY(180deg)] place-items-stretch with-shadow',
]"
>
<img

View File

@@ -83,7 +83,7 @@
/>
<TresAmbientLight :intensity="2" />
<TresDirectionalLight :position="[2, 4, 3]" :intensity="1.2" :cast-shadow="false" />
<TresDirectionalLight :position="[2, 4, 3]" :intensity="1.2" :cast-shadow="true" />
</TresCanvas>
<div v-if="!isReady" class="w-full h-full flex items-center justify-center">