mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-06 00:03:50 +01:00
feat: environment options
This commit is contained in:
1 parent
bf59d127f9
commit
8bb5032ee4
3 files changed
+47
-11
No files matched your search
@@ -3,16 +3,21 @@ import { useModel } from '../../../../../hooks/useModel';
|
||||
import { useDuel } from '../../../../../stores/duel';
|
||||
import { useTankopediaPersistent } from '../../../../../stores/tankopedia';
|
||||
|
||||
export const ENVIRONMENTS = ['warehouse', 'dawn', 'sunset'] as const;
|
||||
|
||||
export function Lighting() {
|
||||
const protagonist = useDuel((state) => state.protagonist!);
|
||||
const { hasPbr } = useModel(protagonist.tank.id);
|
||||
const showEnvironment = useTankopediaPersistent(
|
||||
(state) => state.model.visual.showEnvironment,
|
||||
);
|
||||
const environment = useTankopediaPersistent(
|
||||
(state) => state.model.visual.environment,
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Environment preset="warehouse" background={showEnvironment} blur={0} />
|
||||
<Environment preset={environment} background={showEnvironment} blur={0} />
|
||||
<directionalLight
|
||||
position={[1, 1, -1]}
|
||||
intensity={hasPbr ? 1 : 5}
|
||||
|
||||
Reference in new issue
Block a user