A Minecraft clone from scratch with only modern OpenGL. No game engines or frameworks.

![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
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