We'll wrap up this chapter with an example that makes use of the compute shader to produce an image of a fractal. We'll use the classic Mandelbrot set.

The Mandelbrot set is based on iterations of the following complex polynomial:

Where **z** and **c** are a complex numbers. Starting with the value **z**
* = 0 + 0i*, we apply the iteration repeatedly until a maximum number of iterations is reached or the value of z exceeds a specified maximum. For a given value of **c**, if the iteration remains stable (z doesn't increase above the maximum) the point is inside the Mandelbrot set and we color the position corresponding ...

Start Free Trial

No credit card required