Welcome to Fractal Forums

Fractal Software => Programming => Topic started by: Mrz00m on January 03, 2017, 05:37:43 PM




Title: Advanced 3D mesh rendering logic for Mandelbulb3D Voxel Stacks
Post by: Mrz00m on January 03, 2017, 05:37:43 PM
Mandelbulb3D generates very high quality voxel stacks and it would be easy to convert it into high quality mesh of fractals using some specific and fairly simple programming routines instead of the currently used marching cubes. (marching cubes needs an ISOsurface gradient to figure out where the vertices are in every cube on the 12 edges, otherwise it just generates cubes which is what we are getting, we should at least be making a gaussian blur of the m3d output to send to marching cubes)... AFAIK it would be 10 times faster, requiring smaller input images and produce vertices totally aligned with the actual fractal if we use better routines than MC for generating mesh.

It would make sense to edit a marching cubes program a bit to search where the B/W division is on every edge of the cube, which would actually be more precise than ISO marching cubes. That requires someone who knows how to edit MC with a lot of memory because the mesh  we make in M3D is massive.

If i had the mental clarity, brain power and energy to program an image-stack to mesh program, it would do the following:

1/Detect the edge of the black/white limit of every layer, in an iterative process which places a new vertex when the angle between two vertices exceeds a threshold of 2/10 degrees. Even if the vertices are placed around the outline at regular intervals, the resolution would be higher than using marching cubes.
2/assign normal vectors to every vertex that's at a tangent to the edge which goes from black to white.

3/Verify that every outline ends in a closed loop

THAT's The REALLY DIFFICULT THING I DONT KNOW ABOUT ! EDGE DETETECTION! AFTERWARDS IT's EASIER:

4/join every vertex on the XY plane with it's nearest neighbour, and triangulate every XY pair of vertices with a Z vertex on the layer above, perhaps by getting sets of 4 vertices, two from every layer, and generating quads where necessary. (any suggestions?).

5/Process a 2D marching cubes surface for the first and last layers, which may have open faces.


That way, the vertex number can be devided by 50 or 100 and the vertex precision can be augmented and optimized.

I am not experienced with edge detection algorythms, but mesh triangulation from layers of data is similar to extrusion and it should be very easy to make a labor intesive loop that joins the vertices on the Z plane once they have been made on X/Y slices.

perhaps others have already designed programs for efficient rendering of image stacks, it would be very profitable for us!