mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: better hdr
This commit is contained in:
1 parent
8f0894364b
commit
2ad0fcfdf9
1 file changed
+4
-8
+4
-8
@@ -1,9 +1,9 @@
|
|||||||
import { Environment } from '@react-three/drei';
|
import { Environment } from '@react-three/drei';
|
||||||
import { times } from 'lodash-es';
|
import { times } from 'lodash-es';
|
||||||
|
import { Euler } from 'three';
|
||||||
import { useModel } from '../../../../../../hooks/useModel';
|
import { useModel } from '../../../../../../hooks/useModel';
|
||||||
import { Duel } from '../../../../../../stores/duel';
|
import { Duel } from '../../../../../../stores/duel';
|
||||||
import { TankopediaEphemeral } from '../../../../../../stores/tankopediaEphemeral';
|
import { TankopediaEphemeral } from '../../../../../../stores/tankopediaEphemeral';
|
||||||
import { TankopediaPersistent } from '../../../../../../stores/tankopediaPersistent';
|
|
||||||
import { TankopediaDisplay } from '../../../../../../stores/tankopediaPersistent/constants';
|
import { TankopediaDisplay } from '../../../../../../stores/tankopediaPersistent/constants';
|
||||||
|
|
||||||
const LIGHTS_COUNT = 5;
|
const LIGHTS_COUNT = 5;
|
||||||
@@ -14,17 +14,13 @@ export function Lighting() {
|
|||||||
const { hasPbr } = useModel(protagonist.tank.id);
|
const { hasPbr } = useModel(protagonist.tank.id);
|
||||||
const isBrighterLighting =
|
const isBrighterLighting =
|
||||||
!hasPbr && display !== TankopediaDisplay.StaticArmor;
|
!hasPbr && display !== TankopediaDisplay.StaticArmor;
|
||||||
const showEnvironment = TankopediaPersistent.use(
|
|
||||||
(state) => state.showEnvironment,
|
|
||||||
);
|
|
||||||
const environment = TankopediaPersistent.use((state) => state.environment);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Environment
|
<Environment
|
||||||
preset={environment}
|
files="https://dl.polyhaven.org/file/ph-assets/HDRIs/hdr/1k/winter_river_1k.hdr"
|
||||||
background={showEnvironment}
|
environmentIntensity={isBrighterLighting ? 2 : 1}
|
||||||
environmentIntensity={isBrighterLighting ? 3 : 1}
|
environmentRotation={new Euler(0, Math.PI, 0)}
|
||||||
/>
|
/>
|
||||||
{display === TankopediaDisplay.ShootingRange && (
|
{display === TankopediaDisplay.ShootingRange && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Reference in new issue
Block a user