Logo by simon.snake - Contribute your own Logo!


it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit us on facebook
Welcome, Guest. Please login or register. September 27, 2021, 01:09:35 PM

Login with username, password and session length

The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!

Pages: [1]   Go Down
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: OpenCL marching cubes source code release  (Read 4368 times)
0 Members and 1 Guest are viewing this topic.
Forums Newbie
Posts: 7

« on: March 12, 2013, 03:21:17 PM »


I just thought I'd share the initial release of my OpenCL marching cubes code.

It's available at https://github.com/folded/clemency.

In its current form it's probably not for the faint-of-heart, but it works, and I think it's actually pretty decently functional. It compiles fine on OSX 10.8 (OpenCL is required, so 10.6 is a definite minimum) but it may well compile in other places too. Building is done with cmake.

The image below is a meshlab "render" of the mesh generated by the command:

clmc -g 512 -C "-D ITERATIONS=5"  -a -1.2,-1.2,-1.2:1.2,1.2,1.2 opencl/mandelbulb.cl

Which, in short, does marching cubes on of a power 8 mandelbulb (5 iterations), in the cube bounded by <-1.2,-1.2,-1.2> - <1.2,1.2,1.2>, on a grid size of 512.

The full set of command line arguments is in the README.

The output is a triangle mesh with 8,619,704 faces.

The nice thing about this (IMO) is that it will produce a mesh for anything you can write an OpenCL kernel for. All that's needed is to implement a function
bool inside(float3 pos);

Also, after the initial evaluation on a regular grid, the intersections are refined, so the result is a lot less "stair-steppy" than doing MC on a z-stack of image slices.

Strange Attractor
Posts: 272

« Reply #1 on: March 12, 2013, 05:37:15 PM »

there is menger sponge hit test somewhere around here, would be nice to see how it handles sharp angles wink edit: found it http://www.fractalforums.com/ifs-iterated-function-systems/revenge-of-the-half-eaten-menger-sponge/#msg8382
« Last Edit: March 12, 2013, 05:39:38 PM by makc » Logged
Patryk Kizny
Global Moderator
Fractal Fertilizer
Posts: 372

« Reply #2 on: May 24, 2015, 06:00:50 PM »

Would you be able to generate poincloud instead of mesh?

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Posts: 99

« Reply #3 on: May 25, 2015, 05:35:39 AM »

Would you be able to generate poincloud instead of mesh?

Surely that defeats the point of marching cubes ?
Pages: [1]   Go Down
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Marching Cubes and attractor 3D Fractal Generation mishafe01 0 1621 Last post November 28, 2007, 01:42:09 PM
by mishafe01
The BuddhaLine is back, in color (ugly processing source code included) Programming ker2x 3 2716 Last post December 21, 2011, 07:33:18 PM
by ker2x
Mandelbulb3d source code? Programming flexiverse 14 6953 Last post April 14, 2015, 11:39:52 AM
by DarkBeam
Mandelbulb Source Code? Programming neosettler 5 3651 Last post April 14, 2015, 11:38:51 AM
by DarkBeam
Source code: Mandelbrot, C#, OpenCL and OpenGL Programming woronoi 3 3251 Last post November 16, 2016, 04:26:47 PM
by woronoi

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.18 seconds with 27 queries. (Pretty URLs adds 0.005s, 2q)