This leads to the "cut" that appears along the negative X axis. There is another problem: non-integer powers of complex numbers are multivalued, because complex $\log$ is multi-valued (the imaginary part can have arbitrary integer multiples of $2 \pi$ added to it). Small changes in $d$ might lead to large changes in the distance estimate, but hopefully the change is bounded above by a constant factor. This is to try to mitigate the inherent problem with this approach: the distance estimate is only valid in the plane where the power $d$ is constant, but the ray direction in general has varying $d$. Note the use of the DistanceFactor variable to scale the distance estimate. Return 0.5 * log(r) * r / dr * DistanceFactor Using FragM's DE Raytracer, a "Multibrot Stack" distance estimator can be implemented like this: uniform float Iterations // e.g. FragM 2.0.0 has a ag with complex dual numbers for automatic differentiation.
Mandelbulb 3d voxal stacks software#
Syntopia has a blog with a series of posts on Distance Estimated 3D Fractals, applicable within the software Fragmentarium and its updated fork FragM. The ray-marching algorithm calculates the distance from a point on the ray (in any direction, not necessarily the ray direction), and steps the ray forward by this amount, thus the ray gets closer and closer to the object (or passes by it and hits the background). The distance estimate tells you, given a point, how far the nearest point in the fractal is. It is possible to render 3D fractals by ray-marching with distance estimators.