I wrote this code :
import React from 'react'
import { Canvas } from '@react-three/fiber'
import {Environment, Center } from '@react-three/drei'
import Shirt from './Shirt'
import Backdrop from './Backdrop'
import CameraRig from './CameraRig'
const index = () => {
return (
<Canvas
shadows
camera={{position: [0, 0, 0], fov : 25}}
gl = {{ preserveDrawingBuffer: true }}
className='w-full max-w-full h-full transition-all ease-in'
>
<ambientLight intensity={0.5}/>
<Environment preset='city' />
<CameraRig>
<Backdrop />
<Center>
<Shirt />
</Center>
</CameraRig>
</Canvas>
)
}
export default index
When I run this code, my 3d model doesn't appear on the page, and my full website is breaking after 5 to 10 seconds, But, whenever I comment out <Environment preset='city' />
, my website is working but the background of my website is greyish, but I wanted it to be white to fully showcase my website
I'm using react three drei version 9.70.4