Skip to content

Fedron/gpu-voxel-fields

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

133 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast GPU Generation of Distance Fields from a Voxel Grid

🚀 Overview

Fast GPU Generation of Distance Fields from a Voxel Grid is a real-time voxel painting application built in Rust, designed to explore and optimize techniques for generating distance fields directly on the GPU. The project compares several existing algorithms and proposes a new optimized approach suitable for interactive applications.

Whether you're painting in voxels or pushing the limits of real-time computation, this project showcases how GPU acceleration can make complex field generation blazingly fast.

✨Features

  • Interactive voxel painting interface
  • Real-time distance field generation using GPU shaders
  • A comparison of multiple distance field algorithms in the report
  • Optimized distance field generation pipeline for minimal latency

🛠️ Running the Application

You can either download a prebuilt executable for your system or build it yourself from source.

📦 Download

Prebuilt executables are available on the Releases page for:

  • Windows
  • macOS
  • Linux

🔨 Building from Source

If you prefer building yourself, a nightly version of rust is required for the following features:

  • generic_const_exprs
  • duration_millis_float
  • map_try_insert
  • variant_count

You will also require the shaderc tools to be installed, this can easily be acquired by installing the Vulkan SDK.

To build the project:

  1. Install Rust Nightly:
rustup install nightly
rustup default nightly
  1. Clone the repository:
git clone https://github.com/Fedron/gpu-voxel-fields.git
cd gpu-voxel-fields/implementation
  1. Run the application using Cargo:
cargo run --release

📈 Results Summary

Through a comparison of existing distance field generation techniques, this project develops an optimized GPU-based method that achieves real-time performance, significantly outperforming naive approaches especially on larger voxel grids.

Key improvements:

  • Reduction in computation time by 99% compared to a brute force approach
  • Improved scalability to larger voxel volumes

Limitations:

  • Large memory usage as memory representation and compression was not a focus of the paper
  • Ray marcher computation time bottleneck at large voxel volumes

📂 Repository Structure

/implementation - Rust source code for the voxel painting application and distance field generation compute shader
/report         - LaTeX source files for the full dissertation report, and a complete PDF

📜 License

This project is licensed under the MIT License.

About

Real-time GPU generation of distance fields from voxel grids.

Topics

Resources

License

Stars

Watchers

Forks

Contributors