Giter Club home page Giter Club logo

opengl-voxel-engine's Introduction

opengl-voxel-engine

A simple voxel engine with OpenGL, PyOpenGL, and glfw.

Built with

Python.io OpenGL.io

Getting Started

To guarantee a seamless experience moving forward, please read and follow the installation instructions carefully.

Installation

To run the project, simply follow the instructions as listed below:

  1. Clone the repository
    git clone https://github.com/DuckyShine004/opengl-voxel-engine.git
  2. Install the required packages
    pip install -r requirements.txt
  3. Run the main driver code in the root directory
    python main.py

Contribution

Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. Don't forget to give the project a star! (โญ)

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b Feat/NewFeature)
  3. Commit your Changes (git commit -m 'Feat: Added New Feature')
  4. Push to the Branch (git push origin Feat/NewFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

Gallon Zhou - Linkedin

Project Link: https://github.com/DuckyShine004/opengl-voxel-engine

opengl-voxel-engine's People

Contributors

duckyshine004 avatar quincr avatar

Stargazers

 avatar Jared Recomendable avatar

Watchers

 avatar  avatar

opengl-voxel-engine's Issues

Add Camera Movement To Application

User Story

As a user, I would like to be able to move myself, so that I can view the different objects created in the application.

Description

Implement a simple camera, the functionalities should include:

  • User movement.
  • User mouse movement.

Implement Greedy Meshing For Rendering Voxels

User Story

As a user, I would like to be able to traverse the terrain without lagging, so that the experience can be immersive for me.

Description

Currently the application is really slow. This is mainly due to:

  • Duplicate vertices.
  • Faces that are not visible to the player, but are still being rendered despite this fact.

Add Textures

User Story

As a user, I would like to be able to determine what object I am looking at, so that I can understand and enjoy the visuals.

Description

Add textures to the shapes in the application.

Refactor The Shader Manager

Description

Unfortunately, the shader manager needs some refactoring as PyOpenGL is a the python clone of the OpenGL library from the C language.

Create First Voxel Box

User Story

As a user, I would like to be able to view a lot of cubes, so that my eyes can be satisfied.

Description

Create a 'box' of voxels, this is just to test if the instantiation of the wireframed cube model works.

Create Application Window

Description

Create an application window. This will make sure that everything is set up correctly.

Add LICENSE File

User Story

As a user, I would like to be able to know what sort of license the repository holds, so that I won't get in trouble with copyright.

Description

Create LICENSE.txt file.

Add Vertical Camera Movement

User Story

As a user, I would like to be able to move vertically, so that I can view more objects in the application.

Description

Currently, there are no vertical movements, meaning the user is restricted to NDC x, and z coordinates. Implement the vertical camera movement.

Add Wireframed Cube To Application

User Story

As a user, I would like to view shapes in the 3D shape, so that I am not limited to viewing objects in 2D.

Description

Create a simple wireframed cube.

Create First Chunk

User Story

As a user, I would like to be able to traverse a world with chunks, so that I can have fun.

Description

Create a first chunk, a chunk for now will consist of three layers:

  • Grass
  • Dirt
  • Stone

Add Simple Enemy AI

User Story

As a user, I would like to have an enemy, so that I don't feel alone in the world.

Description

Implement a simple enemy AI that uses a the A* star pathfinding algorithm.

Implement Perlin Noise

User Story

As a user, I would like to be able to experience the feeling that the world before me is random, so that there is variety in the worlds generated.

Description

Implement a Perlin noise function that generates a pseudo-random heightmap for each voxel. This is important to world generation later on.

Render Square Using Triangle Objects

User Story

As a user, I would like to be able to view squares, so that I know the shape is a square (lol).

Description

Create and render a square shape. A square in OpenGL is just two triangles - for effective usage of the GPU.

Add Music Manager To The Application

User Story

As a user, I would like to be able to listen to music, so that I can enjoy playing the game.

Description

Create a music manager that loops through a list of music in a directory.

Implement Multi-threading For World Generation

User Story

As a user, I would like to be able to play the game without lagging, so that I can enjoy the game.

Description

Implement multithreading so that the application does not lag when chunks are being rendered.

Add Fog To The Game

User Story

As a user, I would like to be able to see fog, so that other objects will not be rendered before me.

Description

Adding fog to the application is an easy way to 'un-render' voxels that are very far away from the user. However, I must not rely on this method, and instead incorporate raytracing to determine which chunks to include - determines the render distance.

Implement Inventory System

User Story

As a user, I would like to be able to store things, so that I know what I have done in the world.

Description

Implement an inventory system.

Create A Full List Of Texture IDs

User Story

As a user, I would like to be able to explore the different kind of blocks, so that the experience can be more immersive.

Description

Create a map of texture ids, so that there are more blocks to work with. Additionally, this will set up the next step which will be to parse a string of block data from an appropriate file format.

Refactor Shader Manager

User Story

As a developer, I would like to be able to call methods without too much coding, so that I won't get carpal tunnel.

Description

Refactor the shader manager class.

Add Lighting To Application

User Story

As a user, I would like to feel like the world before me is realistic, so that I will be flabbergasted.

Description

Implement a simple lighting system for the application.

Add requirements.txt

Might resolve conflict between glm and pyGlm modules, as only pyGlm has the vec3 classes used.

Improve Chunk Generation

User Story

As a user, I would like to be able to explore a world with realistic terrain, so that I can be fully immersed.

Description

Currently, the chunk generation is not that good, this is mainly due to the noise algorithm that I am using. Using Brownian Motion would most likely improve world generation by a lot. Additionally, improve the cave generation.

Add Ability To Place And Remove Voxels

User Story

As a user, I would like to be given the ability to terraform the world before me, so that I can create dubious things.

Description

Add the ability to remove and add voxels. This requires dynamic shader buffer binding techniques, which could be quite tricky, as so far, the world defined has been 'static'.

Add Multi-textured Cube To Application

User Story

As a user, I would like to be able to view a 3D shape with textures, so that I can immediately discern what the object is.

Description

Add a multi-textured cube to the application. Try testing all 6 faces with different textures.

Add A Shader Manager

Description

Add a shader manager. The manager will be used to manage things related to GLSL.

Update README File

User Story

As a developer, I would like to be able to know how to contribute to the project, so that I can effectively create changes to the repository.

Description

Add a README template which includes:

  • Installation
  • Brief project description
  • etc..,

Use Quads Instead Of Triangles Element Buffer

User Story

As a user, I would like to be able to play the game without lagging, so that I can enjoy the game.

Description

Currently, the geometry shader is being used, this is not recommended, as geometry shaders are slow. Here are a few solutions:

  • Remove lighting completely - lighting calculations take a lot of VRAM.
  • Use quads instead of triangles (indexing), initially it will probably use more VRAM than the current setup, however, we will discard duplicate vertices when binding the GPU buffers.
  • Use global shading for less GPU calculation. This will mitigate the use of a GPU profiler (Nvidia nsights graphics - also very hard to attach Python PID).
  • Using quads has a few benefits, such as reducing the size of the atlas (reduces file size); could switch to atlas-uv indexing for efficient texture manipulation.

Note

This issue should be completed ASAP, as development speed has slowed down significantly due to lack of attention for performance.

Create Buffer Manager

User Story

As a developer, I would like to be able to easily create buffers and send data to them, so that I don't have to write duplicate code.

Description

Create a buffer manager, so that buffers can easily be managed, without obfuscating clear code. This is essential as it improves code readability and lowers the chance of duplicated code.

Optimize The Rendering For Many Objects

User Story

As a user, I would like to be able to use your program without lagging, so that I can have a great experience.

Description

Optimize the rendering for many shapes with instance rendering. This is an efficient usage for both CPU and GPU.

Refactor The Entire Codebase

User Story

As a developer, I would like to be able to work with clean code, so that I don't laugh at you (lol).

Description

Refactor the codebase.

Resize The Window On User Resize

User Story

As a user, I would like to be able to resize the window, so that I can see stuff more clearly.

Description

Make a method that resizes the window, when the user resizes the window.

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.