Skip to content

Commit

Permalink
Update package, atmosphere
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jan 21, 2025
1 parent d03d30d commit bfdac1f
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 12 deletions.
10 changes: 4 additions & 6 deletions example/r3f/atmosphere.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ function App() {
ortho: false,
};

// TODO: the renderer is rerendering due to floating point issues
// - see if we should trigger an invalidate on tiles plugin add and params change
// - see if we need to trigger a force update on plugin add for the UpdateOnChange plugin

const { ortho } = useControls( levaParams );
return (
<>
Expand All @@ -93,7 +89,7 @@ function App() {
{/* Add compass gizmo */}
<CompassGizmo overrideRenderLoop={ false } />

<AtmosphereWrapper />
<GlobeTilesAtmosphere />
</TilesRenderer>

<CameraTransition mode={ ortho ? 'orthographic' : 'perspective' }/>
Expand All @@ -102,7 +98,7 @@ function App() {

}

function AtmosphereWrapper() {
function GlobeTilesAtmosphere() {

const tiles = useContext( TilesRendererContext );
const camera = useThree( ( { camera } ) => camera );
Expand All @@ -114,6 +110,7 @@ function AtmosphereWrapper() {
const matrix = new Matrix4();
useFrame( () => {

// assign the orientation
const atmosphere = atmosphereRef.current;
if ( atmosphere != null && tiles ) {

Expand All @@ -125,6 +122,7 @@ function AtmosphereWrapper() {

}

// update the camera settings for the atmosphere
const composer = composerRef.current;
if ( composer != null ) {

Expand Down
39 changes: 34 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
"dependencies": {
"@react-three/postprocessing": "^2.16.3",
"@takram/three-atmosphere": "^0.5.0",
"@takram/three-atmosphere": "^0.6.0",
"@takram/three-geospatial": "^0.0.1-alpha.4",
"@takram/three-geospatial-effects": "^0.0.1-alpha.4",
"postprocessing": "^6.36.4"
Expand Down

0 comments on commit bfdac1f

Please sign in to comment.