Or in other words, applying this to the vector representation Rendering the set We just need to iterate this function and see which values remain bounded in We now have all that is necessary to start rendering the mandelbrot set. Let’s try to substitute the complex number z in the mandelbrot set function:Īnd using the two-dimensional vector representation for the complex number system we have: Now, the only thing we need to worry about when doing math on imaginary numbers is the following property for this set: We will use z to denote our complex number. Thus, we can represent a complex number by using a two-dimensional vector, where the x component represents the real part of the number, and the y component represents the imaginary part. A complex number is, as you might know, a number that has two distinct components: a real and an imaginary one. Now, don’t let the complex numbers scare you. Stays bounded between a certain range of values when iterated from z = 0. Taking the definition straight out of its Wikipedia page, the mandelbrot set is a set of complex numbers c for which the function I largely based my development and learning through these two platforms. I also greatly encourage you to visit Inigo Quilez’s website if you are insterested in fractal rendering techniques and the great explanation The Art of Code gives in his mandelbrot fractal introduction video. The application we build in this post is also available in a github repository. If you are feeling adventurous or can’t depend on an internet connection, you can clone this git repository where I host a base C++ and OpenGL application that allows you to dive right into shader coding locally on your machine. You can also share your creations and there are a couple of useful tutorials out there for you to learn from and amazing shaders to explore! ShaderToy is a website were you can code your own shaders right out-of-the-box, without having to worry about establishing a lower level application to deal with input, screen libraries and other steps that might demotivate you right from the beginning. If you want to start learning to code shaders, I suggest taking a look at ShaderToy. In this post I will take you through the creation of a simple mandelbrot set explorer application that I built using GLSL shaders. A great way to start coding shaders is by rendering fractals with them.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |