Skip to content

Commit

Permalink
fixed asteroids appearing behind planet
Browse files Browse the repository at this point in the history
  • Loading branch information
Resaki1 committed Jan 18, 2024
1 parent 3cf76eb commit 3400b98
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/Planet/Planet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ void main() {

extend({ AtmosphereShaderMaterial });

const position = new Vector3(1000, 0, -1000);
const position = new Vector3(10000, 0, -10000);
const rotation = new Euler(1.1 * Math.PI, 1.8 * Math.PI, 0.8 * Math.PI);
const sunDirection = new Vector3(0, 0, -1);
const size = 400;
const size = 4000;

const Planet = () => {
const planet = useRef<Group>(null!);
Expand Down
6 changes: 3 additions & 3 deletions src/components/Scene/Scene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Scene = () => {
<div className="container">
<Canvas
style={{ background: "black" }}
camera={{ far: 10000 }}
camera={{ far: 20000 }}
frameloop="always"
dpr={[0.5, 2]}
>
Expand All @@ -68,11 +68,11 @@ const Scene = () => {
</EffectComposer>
)}
<ambientLight intensity={0.5} />
<Star bloom={gpu.tier > 1 || bloomDIsabled} />
<Planet />
<SpaceShip movement={movement} />
<StarsComponent />
<AsteroidField />
<Planet />
<Star bloom={gpu.tier > 1 || bloomDIsabled} />
<AdaptiveDpr pixelated />
<AdaptiveEvents />
</Canvas>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Stars/StarsComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ const StarsComponent = () => {
return (
<Stars
ref={stars}
radius={200}
radius={4000}
depth={50}
count={5000}
factor={4}
factor={100}
saturation={0}
fade
speed={0.2}
Expand Down

0 comments on commit 3400b98

Please sign in to comment.