Visualizing Complex Functions Using GPU

This is a project done during JSC - Guest Student Programme 2012 by Khaldoon Ghanem under supervision of Prof. Dr. Erik Koch. The goal was to acquire familiarity with programming GPUs and at the same time produce something that is both interesting and useful.

Presentation and Report

The project was divided into four stages of increasing complexity. Each stage resulted in an independent application visualizing certain class of complex functions using different techniques:

  • Fractals

    fractals screenshot This application visualizes two common complex fractals: the mandelbrot set and newton fractals. It is implemented on the fragment shader.
    Download Fractals Code
    + Show/Hide Requirements

    The program is written in c99. It should compile and work on Linux, Mac OS X and Windows (using MinGW).
    For Linux and Mac, the following should be installed: Glut library, Glew library.
    For windows, nothing is needed as they are already included in Win32 directory.
    For running the program, the computer should have a GPU with a driver that support GLSL version 1.2 at least.
    Known Issues: On windows, scroll button doesn't work. It is a problem of Glut library on windows.

  • Domain Coloring

    domain coloring screenshot This application visualizes complex functions of a single complex varaible using the domain coloring method. It is implemented on the fragment shader. For details, you can check this article on CodeProject website .

    Download Domain Coloring Code
    + Show/Hide Requirements

    The program is written in c99. It should compile and work on Linux, Mac OS X and Windows (using MinGW).
    For Linux and Mac, the following should be installed: Glut library, Glew library, lex tool, yacc tool.
    For windows, nothing is needed as they are already included in directory 'Win32'.
    For running the program, the computer should have a GPU with a driver that support GLSL version 1.3 at least.
    Known Issues: On windows, scroll button doesn't work. It is a problem of Glut library on windows.

  • Spherical Harmonics

    spherical harmonics screenshot This application visualizes linear combinations of spherical harmonics, the most well-known complex functions defined on a unit sphere. It is implemented on the vertex shader.
    Download Spherical Harmonics Code
    + Show/Hide Requirements

    The program is written in c99. It should compile and work on Linux, Mac OS X and Windows (using MinGW).
    For Linux and Mac, the following should be installed: Glut library, Glew library.
    For windows, nothing is needed as they are already included in Win32 directory.
    For running the program, the computer should have a GPU with a driver that support GLSL version 1.2 at least.
    Known Issues: On windows, scroll button doesn't work. It is a problem of Glut library on windows.

  • Marching Tetrahedra

    marching tetrahedra screenshot This application visualizes real functions defined in 3D space using marching tetrahedra method.
    There are two versions: The first one is implemented on CPU in such way that it can be easily port to GPU. The second one is implemented on GPU using OpenCL.

    Download Marching Tetrahedra Code - CPU Version
    + Show/Hide Requirements

    The program is written in c99. It should compile and work on Linux, Mac OS X and Windows (using MinGW).
    For Linux and Mac, the following should be installed: Glut library, Glew library.
    For windows, nothing is needed as they are already included in Win32 directory.
    For running the program, the computer should have a GPU with a driver that support GLSL version 1.2 at least.
    Known Issues: On windows, scroll button doesn't work. It is a problem of Glut library on windows.

    Download Marching Tetrahedra Code - OpenCL Version
    + Show/Hide Requirements

    The program is written in c99. It should compile and work on Linux and Mac .
    The following should be installed: Glut library, Glew library and OpenCL library.
    For windows: Work is in progress.
    For running the program, the computer should have a GPU that support OpenCL and OpenCL-OpenGL Interoperability.

    Note: We believe that extending this application to complex fields should an easy task, following the same line of thought as the other applications i.e. encoding the complex number argument using a color map.


Khaldoon Ghanem