Yet another Minecraft wannabe

I know it’s sow last season to be copying minecraft, but I found this to be a great exercise as this kind of voxel block world has a lot of interesting stuff where I can cut my teeth on 3D programming. I’ve been fooling around with Unity and jMonkeyEngine before, but only recently found out about Urho3D.
As I said, I’m pretty new to 3D programming and it’s been nearly 20 years since I last wrote a line of C++ code, so this is pretty much a learning process for me all around.

Here’s a screenshot of what I have currently:

It looks good so far. :slight_smile: Do you use a single combined mesh for each “chunk” or are you using a mesh group for this? If you use a combined mesh you will get a lot better performance. :wink:

Thanks. It’s a single mesh per chunk. With only the outside facing faces of the cubes drawn.
I just got the lighting working. I just need to get the chunk borders to work properly, haven’t bothered to do anything about that yet. I’m currently in the middle of refactoring the code to make it a bit easier to move to a mutithreaded terrain generation/light calculation/mesh generation method.

Here’s some pics with the lighting. Using DiffUnlitVCol techinque (which is basically just DiffUnlit with vertexcolor defines added. Started to get those white cracks between cubes after starting to use texture atlases. Probably some artifacts caused by floating point imprecisions. Not sure what to do about those yet.
But next I think I’m going to start thinking about multithreading once I get the refactorings out of the way. And after that proper terrain generation.


Just finished the first round of restructuring. Most of the stuff (lighting, dynamic chunk loading etc) now stopped working as they don’t support the new structure yet, but it looks like the new data structure is much, much better than my old one. First of all, it solved my problem with the chunk boundaries. They are no longer rendered and I don’t really have to worry about taking them into account anymore.
And of course the simplified mesh improved the rendering speed and memory consumption quite a lot.
Here’s wireframe rendering shots before and after the restructuring.

Before:

After:

Nice work.
You will release something of the code or the project ?

Oh I’m most likely going to make this open source if it actually gets somewhere. I’m still just learning as I go and I don’t have too much time to use on this project, so I’m not quite there yet.

Great work ,can you share from where you started , that is what are your references or example source code for you demo?

@ Tinimini wrote

Using DiffUnlitVCol techinque (which is basically just DiffUnlit with vertexcolor defines added.

How would one implement a DiffUnlitVCol Technique? Can I do it with a custom Technique or to I have to create a custom shader? Could I please see your code for this?

Oh wow. Talk about a blast from the past :smile: I haven’t touched this project in years, but I did still manage to find the source code. It’s available here https://bitbucket.org/syvanpera/cubid/
I have no idea whether it even compiles anymore, but for what it’s worth, it’s all there.

3 Likes

Awesome! Thank you! :smiley:

I just wanted to say think you again. The Urho3D technique you wrote for vertex colors saved me so much (frustration?).

Nice! I’m glad this is of some use even if I never had the time to continue it.

2 Likes