Added FakeGlow Material

+default performance optomizations
This commit is contained in:
Anderson Mancini committed 2024-01-22 13:50:28 -03:00
1 parent 59bc38d06e
commit 4f3e52b9d7
4 files changed
+328 -263

No files matched your search

+37 -39
View File
@@ -1,55 +1,53 @@
import { Canvas } from "@react-three/fiber";
import { Experience } from "./components/Experience";
import { Suspense, useMemo } from "react";
import { Physics } from "@react-three/rapier";
import {
KeyboardControls,
Loader,
OrbitControls,
Preload,
Stats,
} from "@react-three/drei";
import { Canvas } from '@react-three/fiber'
import { Experience } from './components/Experience'
import { Suspense, useMemo } from 'react'
import { Physics } from '@react-three/rapier'
import { KeyboardControls, Loader, OrbitControls, Preload, Stats } from '@react-three/drei'
export const Controls = {
up: "up",
down: "down",
left: "left",
right: "right",
boost: "boost",
shoot: "shoot",
slow: "slow",
reset: "reset",
};
up: 'up',
down: 'down',
left: 'left',
right: 'right',
boost: 'boost',
shoot: 'shoot',
slow: 'slow',
reset: 'reset'
}
function App() {
const map = useMemo(
() => [
{ name: Controls.up, keys: ["KeyW", "ArrowUp"] },
{ name: Controls.down, keys: ["KeyS", "ArrowDown"] },
{ name: Controls.left, keys: ["KeyA", "ArrowLeft"] },
{ name: Controls.right, keys: ["KeyD", "ArrowRight"] },
{ name: Controls.jump, keys: ["Space"] },
{ name: Controls.slow, keys: ["Shift"] },
{ name: Controls.shoot, keys: ["KeyE", "Click"] },
{ name: Controls.reset, keys: ["KeyR"] },
{ name: Controls.up, keys: ['KeyW', 'ArrowUp'] },
{ name: Controls.down, keys: ['KeyS', 'ArrowDown'] },
{ name: Controls.left, keys: ['KeyA', 'ArrowLeft'] },
{ name: Controls.right, keys: ['KeyD', 'ArrowRight'] },
{ name: Controls.jump, keys: ['Space'] },
{ name: Controls.slow, keys: ['Shift'] },
{ name: Controls.shoot, keys: ['KeyE', 'Click'] },
{ name: Controls.reset, keys: ['KeyR'] }
],
[]
);
)
return (
<Canvas shadows>
<Canvas
shadows
dpr={1}
gl={{ antialias: false, stencil: false, powerPreference: 'high-performance' }}
>
<Suspense fallback={null}>
<Physics gravity={[0,-90,0]}>
<KeyboardControls map={map}>
<Physics
gravity={[0, -90, 0]}
predictionDistance={0.001}
>
<KeyboardControls map={map}>
<Experience />
</KeyboardControls>
{/* <Stats /> */}
</KeyboardControls>
{/* <Stats /> */}
</Physics>
</Suspense>
</Canvas>
);
)
}
export default App;
export default App