GridVids
Sign in with YouTube

Procedural Terrain Generator in Unity

Jed037 Aug 13, 2023 00:20
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Don't Miss
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Mark watched
Create an account to hide videos, mark them watched, or save them to Don't Miss.
Hide
Open in popup Open on YouTube
Share video

Share video

Copy the GridVids link or iframe code.

Video link
Iframe code
Iframe content

Hello, Today I will be showcasing my voxel terrain generator that I have implemented for the Unity Engine. The terrain generator uses an Octree to allow for very large maps. In the video, it uses a depth of 7 (which allows for a 1024m^3 map with a voxel size of 0.25m per voxel). I use async texture readback and compute shaders for generating the voxel data on the GPU, and I use the Job system + Burst on the CPU for mesh generation and edits. Currently I do 1 async readback task per frame and I can handle up to 4 mesh jobs per frame (although the maximum is 8). The meshing algorithm I use is naive surface nets (volume of 64x64x64) but with some optimizations that are based on marching cubes edge bitmasks (which reduced the average time for my surface nets job from 16ms down to 4ms). There are still many more optimizations that I could apply but for now this is satisfactory. There are some issues with my current implementation at the moment: Chunks popping in / popping out (could be fixed using dithering) Edits not being saved (implemented in latest update) Repository: https://github.com/jedjoud10/VoxelTerrainGenerator/tree/main
Science & Technology
#unity procedural terrain #procedural terrain generator #voxel terrain #destructible terrain