Skip to content

Commit 2c45efa

Browse files
committed
fix(shop): light the back of the shirt, tighter hero container
- Replaced flat lambert1 material with meshStandardMaterial (PBR) so the Environment map lights all sides evenly - Added two directional lights (front-right + back-left fill) on top of the raised ambient — no more dark back - Container: 2:1 aspect ratio (max 400px), camera moved closer (z 2.5 → 2) for a tighter crop on the shirt
1 parent 65129f8 commit 2c45efa

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

src/components/shop/ShopHero3D.tsx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ export function ShopHero3D({ products }: ShopHero3DProps) {
3737
if (images.length === 0) return null
3838

3939
return (
40-
<div className="w-full h-[400px] md:h-[500px] relative">
40+
<div className="w-full aspect-[2/1] max-h-[400px] relative">
4141
<Canvas
4242
shadows
43-
camera={{ position: [0, 0, 2.5], fov: 25 }}
43+
camera={{ position: [0, 0, 2], fov: 25 }}
4444
gl={{ preserveDrawingBuffer: true, antialias: true }}
4545
className="!absolute inset-0"
4646
>
47-
<ambientLight intensity={0.5} />
47+
<ambientLight intensity={0.7} />
48+
<directionalLight position={[5, 5, 5]} intensity={0.6} />
49+
<directionalLight position={[-5, 3, -5]} intensity={0.4} />
4850
<Environment preset="city" />
4951
<Backdrop />
5052
<Center>
@@ -84,7 +86,7 @@ function Backdrop() {
8486
}
8587

8688
function RotatingShirt({ images }: { images: Array<string> }) {
87-
const { nodes, materials } = useGLTF('/shop/shirt.glb') as any
89+
const { nodes } = useGLTF('/shop/shirt.glb') as any
8890
const groupRef = React.useRef<any>(null)
8991

9092
// Cycle through product images
@@ -117,20 +119,19 @@ function RotatingShirt({ images }: { images: Array<string> }) {
117119
0.25,
118120
delta,
119121
)
120-
121-
// Smooth color to white
122-
easing.dampC(materials.lambert1.color, '#ffffff', 0.25, delta)
123122
})
124123

125124
return (
126125
<group ref={groupRef}>
127-
<mesh
128-
castShadow
129-
geometry={nodes.T_Shirt_male.geometry}
130-
material={materials.lambert1}
131-
material-roughness={1}
132-
dispose={null}
133-
>
126+
<mesh castShadow geometry={nodes.T_Shirt_male.geometry} dispose={null}>
127+
{/* Replace the flat lambert with a standard PBR material so the
128+
Environment map lights all sides evenly — no dark back. */}
129+
<meshStandardMaterial
130+
color="#ffffff"
131+
roughness={0.85}
132+
metalness={0}
133+
envMapIntensity={0.8}
134+
/>
134135
<Decal
135136
position={[0, 0.04, 0.15]}
136137
rotation={[0, 0, 0]}

0 commit comments

Comments
 (0)