Institute of Computer Science
  1. Courses
  2. 2023/24 fall
  3. Computer Graphics (MTAT.03.015)
ET
Log in

Computer Graphics 2023/24 fall

  • Main
  • Lectures
  • Practices
  • Projects
  • Exam
  • Results
  • Links

Terrain Generation Using Marching Cubes

Karm Koduvere, Jan Markus Rokka, Alexis Alliksaar

Video

Video link

Repository: Link
Demo (OpenGL): Link Demo (DX11): Link

Project description

The project idea is to implement marching cubes algorithm to procedurally generate interesting 3D terrain with caves and cliffs. For the procedural part, the plan is to experiment with different noise functions to create various types of landscapes.

Initial progress



Final release

The goal of this project was to implement the marching cubes algorithm to procedurally generate visually appealing 3D terrains with caves and cliffs. The entire implementation was carried out using Unity, utilizing a compute shader for efficient processing.

Marching Cubes Algorithm:

The marching cubes algorithm was implemented to convert the generated voxel data into a smooth 3D mesh. This algorithm efficiently handles the reconstruction of surfaces based on the density values of voxels, resulting in a visually appealing terrain with overhangs and caves.


Level of Detail (LOD) Implementation:

To optimize runtime performance, the project incorporated Unity’s Level of Detail (LOD) system. LODs dynamically adjusted the level of detail in the terrain based on the viewer's distance, ensuring smoother performance without compromising visual quality.



Compute Shader:

A compute shaders were used to perform the heavy lifting of both noise generation and marching cubes algorithm and for an interesting challenge to undertake. Compute shaders enable parallel processing on the GPU, resulting in faster and more efficient terrain generation.

Noise Functions:

Various noise functions, such as Perlin noise and Simplex noise, were experimented with different parameters to generate different patterns for the terrain.



Trees:

Tree model was made in Blender. Trees are generated above ground and then lowered onto ground level by sending a ray down and then setting the tree down to the where the ray hit. Random terrain generation has to be enabled for trees to be placed correctly.


Sources:

Coding Adventure: Marching Cubes
Coding Adventure: Terraforming
Generating Complex Procedural Terrains Using the GPU
Marching Cubes Lookup Tables
3D Cube World Level Generation
Making maps with noise functions
Noise
Compute Shaders
Unity Runtime Inspector & Hierarchy

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment