Skip to content

Commit

Permalink
Fix area of shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
JI0PATA committed Sep 27, 2023
1 parent 9a1c309 commit 6fb4902
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 10 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {Player} from "./Player.jsx";
import {Cubes} from "./Cube.jsx";
import {WeaponModel} from "./WeaponModel.jsx";

const shadowOffset = 50;

export const App = () => {
return (
<>
Expand All @@ -13,8 +15,14 @@ export const App = () => {
<ambientLight intensity={1.5} />
<directionalLight
castShadow
intensity={.8}
position={[50, 50, 0]} />
intensity={1.5}
shadow-mapSize={4096}
shadow-camera-top={shadowOffset}
shadow-camera-bottom={-shadowOffset}
shadow-camera-left={shadowOffset}
shadow-camera-right={-shadowOffset}
position={[100, 100, 0]}
/>
<Physics gravity={[0, -20, 0]}>
<Ground />
<Player />
Expand Down
12 changes: 6 additions & 6 deletions src/cubes.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[
[0, 0, -5],
[2, 0, -5],
[4, 0, -5],
[6, 0, -5],
[8, 0, -5],
[10, 0, -5]
[0, 0, -7],
[2, 0, -7],
[4, 0, -7],
[6, 0, -7],
[8, 0, -7],
[10, 0, -7]
]

0 comments on commit 6fb4902

Please sign in to comment.