UE4 Voxel Terrain Tutorial

Hello forum people! I’ve been working on a tutorial series to show everyone how to implement voxel terrain in UE4, and I figured I should post it on the forums so it can reach more people. So far the series is up to the point of texturing the terrain using a basic world coordinate mapping material. I plan on covering infinite terrain, smooth terrain using marching cubes, and creating an editor extension to allow for terrain modification in the editor during the series. Let me know what you think!

You can find the complete list of tutorials on my website: https://garvinized.com/portfolio/unreal-engine-4-voxel-terrain-tutorial-series/

Awesome tutorial series, really in depth! :smiley:

This is simply great! Many thanks, I have never thought I would want to create a voxel game…

awesome, subscribing :slight_smile:

if I understood correct, you can do it all with an installer version of UE4 right? i.e. no compiling of the engine itself

also I’d like to know, what’s the performance in comparison with a Landscape?

Yup, no engine compiling required. The launcher version will work just fine!

As far as performance comparisons go, it really depends on what you do with the voxels. Most of my setups have had roughly equal performance when compared to normal terrain, but it’s pretty easy for performance to fall behind.

Yeah the procedural mesh component has some serious concerns as far as performance goes if you are creating a lot or very large mesh sections. There are a ton of optimizations and ways to improve it but it requires a modified mesh component to really pull off correctly.

You might want to also base your polyvox code off of their cubiquity branch for UE4, it has been recently open sourced and has a lot of additional features over the base library, I would use parts of it myself except I barely have any of the original polyvox library left in my personal project.

ANL is also a little slow, noisePP is a threaded and more optimized noise library that you might want to check out to improve more complicated noise generation.

Nice write up though and cool project!

This is exactly the type of tutorial series I have been looking for! I was just wondering though, are you still working on adding the other things you said you were planning on covering? If so, when do you think you will be adding them? I have been looking for a guide and tutorial to really help me accomplish all of these things for the game I am working on creating so let me know!

Yup, I’m still working on it. In fact, part 4.5 is out today. That one covers updating to 4.12. Part 5 will follow shortly, probably later today or tomorrow. I’ve already written the code, and it is available on the project GitHub page if you’d like to check it out.

Part 5 is finally here! Check it out over on my website: Unreal Engine 4 Voxel Terrain Tutorial Part 5: Using Multiple Voxel Materials - Garvinized

Awesome and in-depth tutorial! Great job.
I have been programming a small voxel engine in UE4 for awhile now. My time to work on it is limited. This tutorial was a very interesting read for me.

I do already use ANL, but I have never tried out PolyVox before. My concern is with something you said in the first tutorial about how you could not even safely read from the PagedVolume reliably in any thread other than the main thread.
I am very curious to see how you handle the multi threaded chunk generation.

Any spoilers are welcome. :wink:


I forgot to mention something - ninja edit

Have you seen the Runtime Mesh Component on the market place made by Chris AKA Koderz?

May be worth looking into. It is used pretty much the same way as the PMC made by Epic.

Lastly, handling the materials as individual mesh sections seems like it may cause performance issues with the number of draw calls? Say you have 256 kinds of voxel, so 256 draw calls per chunk seems like it could be an issue.
https://github.com/EpicGames/UnrealEngine/pull/2340 this is another item kept up by the Koderz I mentioned above. It looks like it is being merged into the engine now and would allows the draw calls to be significantly reduced if that becomes an issue.

Once again, keep up the great work!

This is what I’m looking for a Voxel World like Minecraft that is purely made in cubes. Thanks for the tutorials mate.

that is great ,but i am interested in the part6,hope you can keep on working on this,thanks

This is really cool but is it possible to make a smoother more realistic version for a game like AKA"7 Days to die" style maps in UE4

Please make an updated tutorial version for the recent polyvox , ANL and UE4.15
I’m following step by step, but after compiling part2 i’ll get all kinds of errors and my project will get corrupted and i need a new project and i’m really clueless on what to do.

Awesome tutorial man, I’ve just implemented it in 4.19 preview and it works great. If you find the time, it may be worth going back and updating some of the sections with the edits you made later on especially the build.cs changes as this had me googling for a few minutes only to read the edits in the subsequent section after I had already implemented the fix.

Also, a little more detail on what some of the things do would be awesome and allow people to take it further.

Great tutorial overall though and provides people with a good foundation to build upon. Top Marks!!

Why do I only see ULLS in the spiciest UE4 topics?


Your website says coming soon:

Part 5.5: Exploring The Terrain Generator (The code for this part is available on the Project Github page, find it below!)
Part 6: “Infinite” Terrain Generation
Part 7: Multithreading, AKA “Send Help My Game Is Frozen”

Are you still working on this tutorial?

Hi @Mewbits,

I haven’t had much time to work on this for a while now. I try to keep the project working with new versions of UE4 and have written the code needed for the next couple of parts, but I haven’t had time to sit down and write the tutorial part itself.

Right now the code on github should be compatible with 4.21 and have most of the code needed for Part 6. When 4.23 comes out I will be making sure it works with that version of UE4 as well.

sorry to bump this but I wanted to look at the tutorials you had up but all the links seem down.
is there somewhere I can still view the tutorial?