Skip to content
Projets

À propos

A basic minecraft clone made with OpenGL, written in C++

Apprentissage et éducation

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

glCraft

A minecraft clone made with OpenGL, written in C++

I am learning computer graphics, and the basics of game development. I think that the best way to learn something is to use it to create a minecraft clone, so I made this, which is also my first C++ project. Making this was a great journey, I learnt a lot. I created the game entirely from scratch except the libraries, compilers, the operating system and other software that I used to make this.

Screenshots

  • Building and destroying blocks
    Building and destroying blocks
  • Ambient Occlusion
    Building and destroying blocks
  • Post-processing effects
    Post-processing effects
  • Procedural world generation
    Procedural world generation
  • Semi-transparent blocks
    Semi-transparent blocks
  • The chunks are hollow on the inside
    The chunks are hollow on the inside

Building the project

  • How to build it in CLion

    • Clone the repository
    git clone --recursive https://github.com/Isti01/glCraft.git
    
    • Open it in CLion and press the green magic button.
  • How to build it using CMake

    • Clone the repository
    git clone --recursive https://github.com/Isti01/glCraft.git
    
    • Build the project the build_type can be either Release or Debug
    cd glCraft
    mkdir build
    cd build
    cmake -DCMAKE_BUILD_TYPE=<build_type> ..
    cmake --build .
    
    • Run the game on Linux with an optional save to load:
    ./glCraft <saved-world.glc>
    
    • Or on Windows with an optional save to load
    glCraft.exe <saved-world.glc>
    

Features

  • Rendering

    • The chunks are hollow on the inside, so most of the blocks that are not visible are not sent to the GPU.
    • Each vertex in a chunk is only 4 bytes long to make the game as memory-efficient as possible (on the GPU side).
    • The game has animated textures and an animated skybox.
    • The game supports ambient occlusion, post-processing and semi-transparent textures, the chunk meshes are sorted before drawing.
    • The world rendering has order independent transparency rendering implemented from this paper.
  • Gameplay

    • The game has very basic, minecraft-like physics, with two movement modes:
      • One that is similar to spectator mode (the default).
      • One that is similar to the movement in survival.
    • The game has block placing, block picking and block breaking. - maybe the most essential feature
    • Implemented a basic UI to change the active block, load saves, and load custom textures for the world.
    • The world is generated procedurally using a seed, and loaded dynamically as the player moves across it.
  • Controls

    • Left Click to break a block
    • Middle Click to pick a block
    • Right Click to place a block
    • WASD to move around
    • Shift to descend when physics is off
    • Space to ascend when physics is off, or jump when physics is on
    • Ctrl to go faster
    • Esc to open the menu

Libraries that I used

  • FastNoiseLite - for terrain generation
  • GLAD - for loading OpenGL functions
  • glfw - for managing the window
  • glm - a great math library for working with OpenGL
  • imgui - for creating the amazing UI in the game
  • lodepng - for loading PNG textures

Explorer des projets similaires

Chargement…