Skip to content

A generic CUDA / GLFW implementation of a Mandelbrot Viewer.

Notifications You must be signed in to change notification settings

teunvw14/GenericMandelbrotViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generic Mandelbrot Viewer

This project is a CUDA/C implementation of a Mandelbrot Set viewer. If you're not familiar with the Mandelbrot Set: it's a beautiful mathematical object (just look at the samples). A passion project.

Background info

I've had a fascination for the Mandelbrot Set for a while now - which is why I created the pybrot project using Python during my 2018 High School summer break; I learned a bunch and was pretty happy with the end result.

Unfortunately, because it was written in Python, pybrot wasn't particularly fast. For that reason, I've wanted to implement a mandelbrot viewer/renderer in C ever since I finished the original Python project.

And so this project was born. I wanted to see how much I could improve on performance if I chose a programming language that was closer to the metal.

Hence why I created this project: a Mandelbrot viewer written in C / CUDA. The results were satisfactory: this implementation is roughly five hundred times faster than my pybrot implementation. Whoo!

This project taught me:

  • the basics of GPU computing using CUDA; and
  • how to actually use the fantastic C programming language; and
  • most importantly: how pointers work.

Samples

The classic Mandelbrot Set image.

The crest between two of the Mandelbrot's "Bulbs".

Don't stare at this one too long.

One of the Manelbrot's many self-contained duplicates.

Beautiful, isn't it?

Features

  • Basic controls for viewing the mandelbrot set
  • Speedy performance thanks to NVIDIA GPU acceleration. Also works on systems without an NVIDIA GPU.
  • Performance test to check performance of (future) optimisations.

Controls

  • Pan image: arrow keys (up, down, right, left)
  • Zoom in/out: + and - keys respectively
  • Increase maximum iterations: [
  • Do a performance test and print results to console: e key
  • Quit: esc

Build

Requirements

To build this projects: the following software is required.

Build using Visual Studio 19

Open the solution in Visual Studio, and build. (Build > Build Solution)

About

A generic CUDA / GLFW implementation of a Mandelbrot Viewer.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published