Voxel-Based Metaballs

Inspired by the blue repulsion gel featured in Valve Software's Portal 2, I developed this voxel-based metaball simulator using C++, DirectX 11, and HLSL. The surfaces of the metaballs are extracted from a voxel grid each frame with a GPU-based implementation of the Marching Cubes algorithm. The metaball surfaces are shaded with a flat color, reflectivity (where the surfaces reflect a 3D environment map), or a triplanar terrain texturing technique. I also used this simulator to generate surreal, voxel-based terrains. These terrains produced interesting results, but they were not the main focus of the project.

I developed this simulator as a part of an Undergraduate Student Research Award (USRA) at the University of Regina. I received this award during the Spring/Summer semester of 2012, when I was entering my fourth and final year as an undergraduate student. I worked on this research project under the supervision of Dr. Howard Hamilton, who later became the supervisor of my master's thesis research.


Details

Tech:

  • C++
  • HLSL
  • Direct3D 11
  • DirectCompute
  • DirectInput
  • Windows API

Features:

  • Voxel-Based Metaballs
  • GPU-Based Marching Cubes
  • Shadow Mapping
  • Normal Mapping
  • Cube Mapping
  • Reflections

Features (cont'd):

  • Voxel Editing
  • 10,000 Lines of Code
  • Real-Time Simulation

Videos


Gallery

Blue metaballs rendered with a wireframe overlay. These metaballs were inspired by the repulsion gel in Portal 2

2012

Metaballs rendered with a reflective surface. The surfaces of the metaballs reflect the cubemap of the environment

2012

Metaballs rendered with terrain textures. These metaballs may be used to randomly generate surreal terrains for a platformer

2012

Terrain metaballs that have been edited by the user. With the simulation paused, the player can edit and deform the metaballs

2012