A minecraft-like voxel game built from the gorund up without a game engine
GitHub Copilot for Code Completion
Cline for smaler completions of tasks
A minecraft-like voxel game built from the gorund up without a game engine
GitHub Copilot for Code Completion
Cline for smaler completions of tasks
Devlog 11:
Fully working async chunk generation using taskflow is now working with versioned chunk-vertex-data. This allows for very fast remeshing.
For testing I currently spawn a block 5 blocks in the view direction from the player, but only in the same chunk so this is why the result may look a bit weird.
The biggest achievement at the moment is that it works to have two threads working independently from each other on the same elements without dead locking themselfes out or waiting forever for the other thread to finish working on some data.
One thread for rendering and only parsing the input and a second one to check if the player changed the chunk, update the chunks that need to be rendered and start the corresponding tasks in their own threads.
The next time after I finished calculating the vertices of a chunk when the renderer checked if the version changed it uploads the vertex data to the gpu and from there on it does not need to access the vertex data in the ram anymore as it has its own copy on the gpu where it needs it.
If you are interested in any other more specific features feel free to ask.
Log in to leave a comment
Devlog 10:
Went from Qt to GLFW for rendering and split the work into multiple classes in the process.
This gives me way more control and way better readability of the code.
By also going away from Qt Threads I now have to rework the multithreading, so only simple renderside generated chunk meshes consisting of only one cube for now.
The difference is not that notable in the recording but with qt i was hard stuck at 180 fps, with glfw the upper limit actually is my hardware.
Terrain generation also is implemented it just can not be used at the moment.
Log in to leave a comment
Devlog 09:
Added binary chunk mesh generation and paralized everything so chunks are properly loaded and unloaded by multiple threads.
Simple diffuse lighting also is implemented in the fragment shader
Log in to leave a comment
Devlog 08:
Added Meshes and logic to always load the chunks around the player and unload those that are further away. The meshes currently generate dummy data in their own thread, but are ready to be filled with the actual chunk mesh.
To reduce the data sent to the gpu, for every face there is one vertex that then by using instancing is used 4 times for a GL_TRIANGLE_STRIP.
Everything works async and should be thread safe, so one thread can write to it and another can read from it. Currently there is one thread for the inputs, one for the gameLoop that currently is not used yet and one for rendering.
Everything is coming together
Log in to leave a comment
Devlog 07:
We are back to a cube and a moving camera, so the foundation is laid.
The input is recorded through QML and passed on to the PlayerController. The renderer then updates the position according to the current inputs and the time since the last frame, so it feels as smooth as possible.
As the basic chunk data structure allready is there, it should not be too difficult to implement chunk rendering with a simple chunk meshing algorithm.
Log in to leave a comment
Devlog 06:
Added basic engine structure and player movement for a portable approach to allow for multiple rendering engines and easy switching in the future.
That is:
Log in to leave a comment
Devlog 05:
After trying to use vulkan with qt on macOS for a too long time, I now switched to OpenGL as it should me get quite a long way and allow for way faster prototyping and faster progress.
This also allows me to rewrite the chunk data backend and optimize and structure it better than it was before to make for a more stable gameplay and avoid stuff like chunks not unloading properly.
QRhi limited me as it seperated the chunk upload and configuring from the rendering. With OpenGL I now am able to change uniform buffers in between draw calls and also more complex features like indirect drawing are possible.
This means a fresh start so all I have to show for now after trying around to much is a black window, but more will follow soon.
What are your thoughts?
Is OpenGL a good starting point?
Log in to leave a comment
Devlog 04:
After some more optimizations I am now able to render quite a large region. The problem that now arrises is the amount of buffers used. Every chunk at the moment uses 6 buffers and QRhi just cant handle this. The next approach to fix this is to switch from QRhi to Vulkan to gain more control and implement a solution that can work for far larger render distances.
Optimizations:
Log in to leave a comment
Devlog 03:
Voxel Worlds are hard :(
What I did:
Log in to leave a comment
Devlog 02:
After too many hours, I now finally got a codebase, that can do efficient rendering of chunks using QRhi under Qml.
To achieve this the hardest parts were:
The picture currently shows one 32x16x32 stone chunk rendered with different colored faces.
If you have any questions feel free to comment <:
Log in to leave a comment
Devlog 01:
Tried a lot with QRhi and Qt Quick 3D but always had problems with optimization and different threads accessing different things and bing blocked by operations.
New try with QRhiWindow to stay in c++ for the whole 3D pipeline.
Allready learned a lot about 3D rendering and optimization.
Log in to leave a comment