Overview
Gitlantis transforms your file system into an immersive 3D ocean world, where files and folders are rendered as interactive 3D objects floating on the water. The extension uses React Three.js and Three.js physics to create a realistic maritime environment.World Architecture
The 3D world is composed of several core components that work together:- World Canvas
- Physics System
- Camera System
The Located in:
WorldCanvas component serves as the root container for the entire 3D scene. It uses React Three Fiber’s Canvas to create a WebGL context.src/browser/components/world/canvas/index.tsxOcean Rendering
The ocean is rendered usingthree-stdlib’s Water shader, which provides realistic water effects including reflections, refractions, and wave animations.
Implementation Details
src/browser/components/world/ocean/index.tsx:13-22
Sky and Atmosphere
The sky uses Three.js’s procedural sky shader with atmospheric scattering:Sky Parameters
Sky Parameters
src/browser/components/world/sky/index.tsx:22-27File and Folder Nodes
Files and folders are rendered as 3D models positioned in the ocean world:- Files: Rendered using a dedicated file model
- Folders: Rendered using a dedicated folder model
- Collision Detection: Nodes detect when the boat collides with them
- Click Interaction: Both keyboard collision and mouse clicks trigger file/folder opening
src/browser/components/world/nodes/index.tsx:38-52
Performance Optimization
Gitlantis uses several optimization techniques:
- Suspense boundaries for lazy loading components
- Tiled ocean rendering for infinite worlds
- Throttled collision detection to prevent excessive file opening
- Delta-based animations that adapt to frame rate
Loading and Transitions
The world respects the splash screen state and fades in smoothly:src/browser/components/world/canvas/index.tsx:10-12