Being one of those No Man’s Sky fan boys, i wanted to test my luck in the voxel world just to understand the basics.
So a few days ago i took the cheap and lazy road and started by trying to adapt a free octree/dual contouring implementation written for opengl that i found here.
So really i did nothing but stealing it, adapting it to UE4, then adding some texturing, collisions and adaptive LOD.
With no background in this field, my purpose here is to familiarize myself with the voxels vocabulary and methods while having some quick and fun results to play with
Then, when i know what i’m talking about, i’ll probably try to write my own thing.
As you will see, the realtime stuff (and a miserable attempt to get some infinite terrain ) is an absolute failure visually but when given a few seconds of computation time the (not realtime) thing is quite nice.
So i just wanted to share it here, it might give good ideas to some beginners who don’t know where to start
Btw, the qef provided in the link above seems to be quite good and is super easy to use (replace the “vec3” by some good old “FVector” basically). I tried another one which seemed to be less accurate. It might be a good starting point to go from minecraft to smooth if you’re not into linear algebra.
It’s still useless as there is no memory, every modification is forgotten as soon as the next one is made, but it’s a start, and already fun to play with
I just wanted to say I think your work is fantastic. Please keep giving us updates and information so others like myself can learn and grow and develop along behind you.
I am so looking forward to where this is going, I’m making it a daily page-check!
I’m still a complete baby in this field, and the octree part of the code is not mine so i really can’t take too much credit for this, i’m merely using someone else’s (great) work
I spent 2 weeks trying to write my own octree manager but i failed.
Well, it worked, the terrain was displayed, but it was about 10 times slower than the one i grabbed and had some glitches (see the voxel playlist on my YT channel).
I know i can’t outsmart a researcher in the field and don’t want to spend 2 years reinventing the wheel, so i finally kept his code.
That said, i recently added the “undo” function (very easy btw, as my paintstrokes are kept in a TArray), if you want to have a look:
The video is rather long and boring, i kept it as a personnal april 2016 memory and didn’t plan to post it here, but your post created the occasion :-))
The next big step is to add multithreading, it currently doesn’t work, i am learning to use FAsyncTask in FQueuedThreadPool but i get crashes^^
I’ll keep posting my progress in this thread in case anyone is interested in how to start.
Looks great! I’ve used FRunnable to multithread the vert/tri/normal/UV/tangent on my terrain generator, it was pretty straightforward although I do have some stutter issues which may or may not be related to that, I’m still to look into it.
Yeah, i’ve been using FRunnable for something else and it was my first idea for the voxel chunks, but i read somewhere on this forum that FQueuedThreadPool was much faster than FRunnable, so i’m giving it a try.
It’s a pain to learn, no doc, mostly trials and crashes, and on top of that i get a different behavior in the editor and the packaged game (bug report opened but currently unanswered), so trials really take forever as i have to package everytime :-((
i’ll post the code if i manage to have something working.
I’m running into the same issues with FAsyncTask/FAutoDeleteAsyncTask. I’m currently having issues with SharedPointers and References. Once the task is finished, I get crashes in a few different places possibly due to garbage collection issues. If I don’t use those ptr types, it doesn’t crash, but getting data back out is eluding me. If I use a non-thread safe pointer, then my results are highly inconsistent (sometimes works, sometimes not) so I’m stuck.
I think I’ll post about it and see what can be done. Without a task system, my game idea is sunk, and FRunnable has too much overhead for what I’m trying to do. I might be able to build my own task system using FRunnable as a kind of queue, but that would add a lot of work and testing for me.