Skip to content

Repository files navigation

ProceduralGeneration

Build Codacy Badge

Preview image

Current state of the application: Chunks being generated based on a noise map and streamed to the GPU for drawing.

Real-time terrain generation in a 3D world from a procedural density field. CUDA kernels are responsible for evaluating the density field and extracting a mesh out of it via Marching Cubes, which then can be drawn by OpenGL.

Building

With CMake Workflow

  1. Run workflow

    cmake --workflow --preset <platform>-<type>

    where <platform> can be any of gcc, clang, and windows and <type> can be either release, or debug.

  2. Run the Application

    ./build/<type>/src/app/ProceduralGeneration

Manually

  1. Configure CMake

    cmake --preset <platform>-<type>
  2. Build the Application

    cmake --build --preset <platform>-<type>
  3. Run the Application

    ./build/<type>/src/app/ProceduralGeneration

NVIDIA CUDA Support

Please note: macOS does not support CUDA Please note: CUDA support has only been tested and verified by myself on a Linux system with CUDA Toolkit version 13.3, reliability and functionality on Windows may be lacking.D

If you want to use CUDA (NVIDIA GPUs only), you can pass the needed flags to CMake at configuration time like so:

cmake --preset <platform>-<type> -DPEN_ENABLE_CUDA=ON -DCMAKE_CUDA_HOST_COMPILER=<path_to_a_c++23_compatible_compiler>

For example on Linux, use /usr/bin/clang++-19 for CMAKE_CUDA_HOST_COMPILER.

And afterward, build like normal:

cmake --build --preset <platform>-<type>

CMake will then figure out where the nvcc compiler is and give it the proper settings.

Acknowledgments / Credits

History

Stage 1

First stage of the project: A torus with a lighting sphere in the center

Stage 2

Second stage of the project: Single chunk that is generated based on noise.

About

Procedural terrain generation with Marching Cubes

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages