/minecraft-clone

Minecraft clone in C++ and OpenGL

Primary LanguageC++MIT LicenseMIT

minecraft-clone

Intro

Hi everyone! This is yet another Minecraft clone/voxel engine written in C++ and OpenGL. I am doing this mainly for learning purposes, since I am trying to get into graphics programming. I have no previous experience with game engines and this is my first OpenGL project, so forgive my bad design decisions. I will work on this in my spare time and update this repo as I progress.

picture 1 picture 2

Features

  • Infinite terrain generation
  • Place/destroy blocks
  • Frustum culling
  • "Physics"
  • Trees (is this a feature?)
  • Day/night cycle
  • Ambient occlusion
  • Diffuse lighting
  • RGB lights
  • Very basic GUI
  • Smooth lighting
  • Cool water shader
  • Multithreading
  • Arena allocator
  • Shadow mapping
  • Greedy meshing

How to build

git clone --recursive https://github.com/simsax/minecraft-clone.git
cd minecraft-clone
mkdir build
cd build
cmake -S .. -B . -DCMAKE_BUILD_TYPE=Release
make

If you are on Windows, just use Visual Studio and import as a cmake project.

Commands

  • WASD to move
  • SHIFT to sprint
  • F to activate/deactive gravity
  • P to pause
  • SPACE to jump/fly up
  • CTRL to fly down
  • G to deactivate/activate gui
  • 1,2,3,... or scroll wheel to select a block
  • left click to destroy a block
  • right click to place a block

References