mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 19:19:52 +02:00
fix: consistent lighting in static mode
This commit is contained in:
1 parent
e17470e419
commit
f1c50c2531
1 file changed
+6
-2
+6
-2
@@ -2,10 +2,14 @@ import { Environment } from '@react-three/drei';
|
||||
import { useModel } from '../../../../../../hooks/useModel';
|
||||
import { Duel } from '../../../../../../stores/duel';
|
||||
import { TankopediaPersistent } from '../../../../../../stores/tankopediaPersistent';
|
||||
import { TankopediaDisplay } from '../../../../../../stores/tankopediaPersistent/constants';
|
||||
|
||||
export function Lighting() {
|
||||
const protagonist = Duel.use((state) => state.protagonist);
|
||||
const display = TankopediaPersistent.use((state) => state.display);
|
||||
const { hasPbr } = useModel(protagonist.tank.id);
|
||||
const isBrighterLighting =
|
||||
hasPbr && display !== TankopediaDisplay.StaticArmor;
|
||||
const showEnvironment = TankopediaPersistent.use(
|
||||
(state) => state.showEnvironment,
|
||||
);
|
||||
@@ -17,13 +21,13 @@ export function Lighting() {
|
||||
|
||||
<directionalLight
|
||||
position={[1, 1, -1]}
|
||||
intensity={hasPbr ? 1 : 5}
|
||||
intensity={isBrighterLighting ? 5 : 1}
|
||||
castShadow
|
||||
color={'rgb(225, 225, 255)'}
|
||||
/>
|
||||
<directionalLight
|
||||
position={[-1, 1, 1]}
|
||||
intensity={hasPbr ? 1 : 4}
|
||||
intensity={isBrighterLighting ? 4 : 1}
|
||||
castShadow
|
||||
color={'rgb(240, 255, 240)'}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user