GithubHelp home page GithubHelp logo

makkambaevdastan / glcraft Goto Github PK

View Code? Open in Web Editor NEW

This project forked from isti01/glcraft

0.0 0.0 0.0 8.64 MB

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

C++ 90.18% C 1.47% CMake 1.59% GLSL 6.76%

glcraft's Introduction

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
  • Order-Independent Transparency mode
    Order-Independent Transparency mode
  • 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:
    ./main <saved-world.glc>
    • Or on Windows with an optional save to load
    main.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 mode 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

glcraft's People

Contributors

isti01 avatar wunkolo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.