@@ -16,7 +16,9 @@ export function createRenderer(isMobile) {
1616 const renderer = new THREE . WebGLRenderer ( { antialias : ! isMobile , powerPreference : 'high-performance' } )
1717 renderer . setSize ( window . innerWidth , window . innerHeight )
1818 renderer . setPixelRatio ( isMobile ? Math . min ( window . devicePixelRatio * 0.5 , 1 ) : Math . min ( window . devicePixelRatio , 2 ) )
19- renderer . shadowMap . enabled = false
19+ renderer . shadowMap . enabled = true
20+ renderer . shadowMap . type = THREE . PCFShadowMap
21+ renderer . shadowMap . autoUpdate = false
2022 renderer . toneMapping = THREE . ACESFilmicToneMapping
2123 renderer . toneMappingExposure = 1.0
2224 renderer . outputColorSpace = THREE . SRGBColorSpace
@@ -33,7 +35,11 @@ export function setupLights(scene) {
3335 const studio = new THREE . DirectionalLight ( 0x4488ff , 0.4 )
3436 studio . position . set ( - 20 , 30 , - 10 ) ; studio . castShadow = false ; scene . add ( studio )
3537 const sun = new THREE . DirectionalLight ( 0xffffff , 1.5 )
36- sun . position . set ( 21 , 50 , 20 )
38+ sun . position . set ( 21 , 50 , 20 ) ; sun . castShadow = true
39+ sun . shadow . mapSize . set ( 1024 , 1024 ) ; sun . shadow . bias = - 0.0005 ; sun . shadow . normalBias = 0.3
40+ sun . shadow . radius = 8 ; sun . shadow . blurSamples = 16
41+ sun . shadow . camera . left = - 50 ; sun . shadow . camera . right = 50 ; sun . shadow . camera . top = 50 ; sun . shadow . camera . bottom = - 50
42+ sun . shadow . camera . near = 0.5 ; sun . shadow . camera . far = 150
3743 scene . add ( sun ) ; scene . add ( sun . target )
3844 const warmupPoint = new THREE . PointLight ( 0xffffff , 0 , 1 ) ; scene . add ( warmupPoint )
3945 return { ambient, studio, sun, warmupPoint }
0 commit comments