style: misc visual changes
This commit is contained in:
+13
-12
@@ -1,9 +1,8 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import { OrbitControls, PerspectiveCamera } from '@react-three/drei';
|
|
||||||
import { Environment, OrbitControls, PerspectiveCamera } from '@react-three/drei';
|
import { Environment, OrbitControls, PerspectiveCamera } from '@react-three/drei';
|
||||||
import { Canvas, useLoader, useFrame } from '@react-three/fiber';
|
import { Canvas, useLoader, useFrame } from '@react-three/fiber';
|
||||||
import { forwardRef, useLayoutEffect, useMemo, useRef } from 'react';
|
import { useLayoutEffect, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BufferAttribute,
|
BufferAttribute,
|
||||||
@@ -27,7 +26,9 @@ import {
|
|||||||
Bloom,
|
Bloom,
|
||||||
EffectComposer,
|
EffectComposer,
|
||||||
Noise,
|
Noise,
|
||||||
Pixelation
|
Pixelation,
|
||||||
|
Vignette,
|
||||||
|
DepthOfField
|
||||||
} from '@react-three/postprocessing';
|
} from '@react-three/postprocessing';
|
||||||
|
|
||||||
interface Shader {
|
interface Shader {
|
||||||
@@ -466,8 +467,8 @@ function TerrainChunk({
|
|||||||
ref={meshRef}
|
ref={meshRef}
|
||||||
geometry={geometry}
|
geometry={geometry}
|
||||||
position={[x * size, 0, y * size]}
|
position={[x * size, 0, y * size]}
|
||||||
// receiveShadow
|
// receiveShadow
|
||||||
// castShadow
|
// castShadow
|
||||||
>
|
>
|
||||||
<meshStandardMaterial
|
<meshStandardMaterial
|
||||||
vertexColors
|
vertexColors
|
||||||
@@ -599,18 +600,18 @@ export default function Home() {
|
|||||||
return (
|
return (
|
||||||
<Canvas
|
<Canvas
|
||||||
shadows
|
shadows
|
||||||
camera={{ position: [0, 5, 15], fov: 50 }}
|
camera={{ position: [0, 5, 15], fov: 50, far: 100 }}
|
||||||
gl={{ antialias: true }}
|
gl={{ antialias: true }}
|
||||||
className='canvas'
|
className='canvas'
|
||||||
>
|
>
|
||||||
<EffectComposer>
|
<EffectComposer>
|
||||||
<Noise opacity={0.1} />
|
<Noise opacity={0.1} />
|
||||||
<Bloom
|
<Bloom
|
||||||
intensity={2}
|
intensity={2.2}
|
||||||
luminanceThreshold={0.5}
|
luminanceThreshold={0.5}
|
||||||
luminanceSmoothing={0.1}
|
luminanceSmoothing={0.1}
|
||||||
/>
|
/>
|
||||||
<Pixelation />
|
{/* <Pixelation granularity={10} /> */}
|
||||||
<Vignette />
|
<Vignette />
|
||||||
<DepthOfField target={[0, 5, 0]} focalLength={50} bokehScale={5} />
|
<DepthOfField target={[0, 5, 0]} focalLength={50} bokehScale={5} />
|
||||||
</EffectComposer>
|
</EffectComposer>
|
||||||
@@ -618,7 +619,7 @@ export default function Home() {
|
|||||||
<Environment files={'hdr/sky.hdr'} environmentIntensity={1} background />
|
<Environment files={'hdr/sky.hdr'} environmentIntensity={1} background />
|
||||||
|
|
||||||
<Terrain
|
<Terrain
|
||||||
chunks={8.0}
|
chunks={16}
|
||||||
chunkSize={10.0}
|
chunkSize={10.0}
|
||||||
resolution={8.0}
|
resolution={8.0}
|
||||||
scale={1}
|
scale={1}
|
||||||
@@ -627,7 +628,7 @@ export default function Home() {
|
|||||||
detailScale={1.0}
|
detailScale={1.0}
|
||||||
detailHeight={0.1}
|
detailHeight={0.1}
|
||||||
wireframe={false}
|
wireframe={false}
|
||||||
grassCount={6000}
|
grassCount={4000}
|
||||||
grassSize={0.6}
|
grassSize={0.6}
|
||||||
grassLOD={80}
|
grassLOD={80}
|
||||||
/>
|
/>
|
||||||
@@ -637,8 +638,8 @@ export default function Home() {
|
|||||||
target={[0, 5, 0]}
|
target={[0, 5, 0]}
|
||||||
enablePan={false}
|
enablePan={false}
|
||||||
makeDefault
|
makeDefault
|
||||||
minDistance={5}
|
minDistance={2}
|
||||||
maxDistance={30}
|
maxDistance={10}
|
||||||
/>
|
/>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user