SnazzCraft Development
▲ 46 r/VoxelGameDev+2 crossposts

SnazzCraft Development

My latest work on SnazzCraft was improving the lighting engine. Previously entire faces had one light value and light as a visual felt very unnatural. What I've done here is create a thirty two bit float for each vertex that stores a light value. When the GPU renders each triangle in a voxel, it will extrapolate the per-pixel light value based off of the three light values in each of the triangles vertices. You can see how smooth this is by looking at the wall I created in the right of the frame. To do this I did some research on how the original MineCraft Console Edition's lighting engine worked.

For this project I am using C++ with OpenGL. I am considering switching this to a Vulkan project due to some limiting factors of OpenGL. The inability to multi thread and the inability to manually manage memory are the most apparent limitations related to OpenGL and this project. I implemented a thread pool in which the program can hand tasks to have executed concurrently. This is primarily used in the generated process, but is severely limited due to the previously mentioned OpenGL limited of the inability to interact with the GPU concurrently across multiple threads.

The blue rectangle seen towards the center right of the frame is an entity. SnazzCraft's entity system can handle a dynamic amount of entities, each with their collision and movement.

Project Github:

https://github.com/Mr-Snazz/SnazzCraft

u/Mr-Snazz — 10 days ago
▲ 106 r/VoxelGameDev+2 crossposts

This is a screenshot from my voxel game engine, which I am using to make a Minecraft clone. I am a Junior in high school and I am working on this as a hobby, which hopefully in the future I will be able to present to a college or workplace. I implemented my own GUI system which nicely works with my event handling system that I made from scratch as well. You cannot see it but the game also has an entity system, allowing entities to rotate and move around with full collision. The engine also has a voxel placing and remove system, which uses a DDA algorithm. Right now there is no inventory system (although I will most likely work on it in the future and it shouldn't be hard given my GUI is modular and adaptable), so right now number keys are mapped to voxel ids, which are placed when the user right clicks on a valid surface. Like many other voxel engines this one uses Perlin noise, in this case from the LibNoise library. The button that toggles "Complex Lighting" just toggles the use of ambient, diffuse, and specular lighting in the fragment shader for the voxels, which I have been playing around with today. In the screenshot this is toggled on and the light reflected off the generated ocean is from a light source I have been using for testing. Normally all lighting is done once on chunk generation and each vertice has a brightness attribute that is passed to the shaders. I am using a 5x5 atlas system for textures, which can easily be expanded when need be (like adding more different types of voxels for example). Greedy meshing has not been implemented yet however there is face culling. Right now some data is being stored redundantly which is causing the program to use more ram than it should, which I am currently fixing. I have a public github repo in which you can download this project, as linked here: https://github.com/Mr-Snazz/SnazzCraft.

u/Mr-Snazz — 2 months ago