This means it's not enough to compute some iterations to get the result for current pixel - you may need to do this a lot of times, for every tested point along the ray, and this makes your computations a lot slower.īasically, when you've found the first point that meets your condition and have an iterations count for this point you could color it the same way as in 2D case, but the 3D space gives you more options.
You do your iterations for this 3D point, but if you don't meet the condition you advance your point by a small step and recompute everything for this new point. You start with some pixel but now you compute the 3D ray from your eyes to that pixel and pick some starting point close to you (like a near clipping plane). In 3D case most of the computations are the same, just a lot more of them. One thing to notice here is that when you start computing some pixel then after some iterations you'll end up with a result for that pixel - this will be different in 3D case. You may also cycle those colors to fake animation. You may use gradients, bands, grayscale or whatever you want. Having all of this computed for every pixel you map your iterations number to colors, most often I saw the outside painted as black and iterations count mapped to some custom color. If the condition was never met you assume that current pixel is outside of a fractal, if the condition was met you store the iteration count needed to do so. Your numbers may never meet this condition so you add some global counter, let's say 100 iterations per pixel - if it doesn't meet the condition after 100 iterations you assume it never will and stop. If it doesn't you reiterate again, and again.
When computing a general (2D) fractal you pick some pixel coordinates and transform them with a function, like = somefunc(x,y) and check if the result meets some condition. But first lets see how you can do a 2D fractal: This generator works by sampling all points in a regular grid, and if the point is a prisoner point, it adds it to an AiPoints geometry node for rendering.I don't know the exact math but I do know how you can get from 2D fractal to 3D one. The Mandelbulb extends this math into three dimensions. That means, for every point on a mandelbrot set, you can generate a Julia set. Although both sets are continuous functions in the complex plane, they are usually rendered by sampling an even grid (pixels), and if the point is a prisoner point, it is rendered black. It is generated by sampling the center point of all possible Julia sets. The Mandelbrot set is the set if all fully connected Julia sets. A disconnected Cantor dust of points (for more on Cantor dust - If the center point (0,0) of a Julia set is a prisoner point, then the Julia set is completely connected if it is not a prisoner point the Julia set is a Cantor dust.
#Rendering mandelbulb 3d full
There is a full Julia set for all possible values of C C is a 2-dimensional value on the complex plane.ġ. You can clearly see that it is formed of thousands of tiny spheres.Ī Julia set is the set of points on the complex plane that when squared and added iteratively to a constant (C), the 'prisoner' points fail to leave a circle of radius 2.