A Minecraft clone from scratch with only modern OpenGL. No game engines or frameworks.
![demo2](https://private-user-images.githubusercontent.com/93693693/399037567-610d1f34-cd6f-4e84-89de-86ddf327fe48.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MTYyNDYsIm5iZiI6MTczOTQxNTk0NiwicGF0aCI6Ii85MzY5MzY5My8zOTkwMzc1NjctNjEwZDFmMzQtY2Q2Zi00ZTg0LTg5ZGUtODZkZGYzMjdmZTQ4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDAzMDU0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQyM2Q1YTViZTk2OGE3YzQ2NmRmYjJlMGMzYjY4Mzk4Mjk2Nzc5ODk4YWMzZTVjZWQ1ODBjMjFjMTc3ZTliZjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7x9R2XFqiQpKInhN_dQcj27xssoVZiwSDlfPZFBPRHE)
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Screen.Recording.2024-12-27.at.11.20.54.PM.copy.mp4
- Infinite and procedurally generated terrain using Perlin noise
- Physics engine with collision detection
- Day/night cycle
- Dynamic lighting
- Block placement and destruction
- Tree generation
- Basic cave systems
- Dynamic chunk loading/unloading based on player position
- Simple culling techniques for rendering optimization
- Simple inventory system
- Flying mode
# clone
git clone https://github.com/GianlucaP106/minecraft minecraft && cd minecraft
# run game (requires go)
go run .
- WASD - Movement
- Space - Jump
- F - Toggle flying mode
- Mouse - Look around
- Left Click - Break block
- Right Click - Place block
- 1-9 - Select inventory slot
- Written in OpenGL 4.1
- Custom shader programs for blocks, UI elements, and effects
- View frustum culling for performance optimization
- Multi-octave Perlin noise for terrain generation
- Biome system affecting terrain height and features
- Procedural cave system generation
- Dynamic tree placement based on biome
- Custom physics engine
- Rigid body dynamics
- Custom collision detection and response
- Jump mechanics
The game is built with a component-based architecture, with key systems including:
- World: (chunk loading, block updates)
- World Generator: (noise, terrain, tree, biome)
- Physics engine and Rigid Body (collision, movement)
- Player, Camera and Ray
- Chunk and Block
- github.com/go-gl/gl/v4.1-core/gl
- github.com/go-gl/glfw/v3.3/glfw
- github.com/go-gl/mathgl/mgl32