Logo by Pauldelbrot - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

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. April 24, 2024, 10:34:24 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] 2   Go Down
  Print  
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: I need some help in Mandelbulber development  (Read 5827 times)
0 Members and 1 Guest are viewing this topic.
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« on: June 14, 2011, 07:32:55 PM »

Hi

As you see development of Mandelbulber has slowed down last months. Now I don't have enough time for sitting by my computer because of some personal issues and in few months I will have less free time than today cry So that's why I'm asking for help

Generally what I need:
- some C++ sources for new interesting fractal formulas (not only mathematical ideas). I'm not so good mathematician, so it's difficult for me to derive formulas.
- code optimization and cleaning up
- GUI improvement
- preparing of DEB packages (for easier instillation Linux)
- preparing of better Windows installer
- program debugging

It's too much for me now.  surrender; give up If somebody is interested in contributing in my project with me and I will give direct access to SVN repository.

I'm not postponing development of program, but I'm limiting my activities. I still want to drive this project.

I will be very thankful if somebody helps me.
 
Logged

cytotox
Alien
***
Posts: 39


« Reply #1 on: June 17, 2011, 12:41:22 PM »

Hi Buddhi

Unfortunately, I am not qualified to be of any help. However, you might want to post this plea for support somewhat higher up in the topics' structure (i.e., in 'Mandelbulb Software' or '3D Fractal Generation'). I am sure that there are more - knowledgable and possibly helpful - people populating these 'higher order' threads ...
 smiley
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #2 on: June 17, 2011, 09:28:39 PM »

I'd love to help with Mandelbulber but I'm so pushed for time myself that I haven't created a new fractal image in about a year sad
I don't even have as much time to work on converting i.Candy to OSX as I would like sad
Also I now only want to work from a Mac platform using Xcode as far as development is concerned.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
MackTuesday
Guest
« Reply #3 on: June 24, 2011, 01:30:15 AM »

I think it would be interesting to try offsetting the center of the spherical folding operation in the Mandelbox fractal.  It would be a simple generalization of the formula.  Instead of
Code:
length = sqrt(x² + y² + z²)

//spherical folding
if(length < minRadius)
{
    x = x * fixedRadius² / minRadius²
    y = y * fixedRadius² / minRadius²
    z = z * fixedRadius² / minRadius²
}
elseif(length < fixedRadius)
{
    x = x * fixedRadius² / length²
    y = y * fixedRadius² / length²
    z = z * fixedRadius² / length²
}

you'd have

Code:
length = sqrt(x² + y² + z²)

//spherical folding
x += xOffset
y += yOffset
z += zOffset
if(length < minRadius)
{
    x = x * fixedRadius² / minRadius²
    y = y * fixedRadius² / minRadius²
    z = z * fixedRadius² / minRadius²
}
elseif(length < fixedRadius)
{
    x = x * fixedRadius² / length²
    y = y * fixedRadius² / length²
    z = z * fixedRadius² / length²
}
x -= xOffset
y -= yOffset
z -= zOffset

By the way, do you have that square root and all those divides in the actual code?  They aren't all necessary.
Logged
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #4 on: June 24, 2011, 04:09:58 PM »

I think it would be interesting to try offsetting the center of the spherical folding operation in the Mandelbox fractal.  It would be a simple generalization of the formula.  Instead of

Thank you for interesting idea. I have just implemented in Mandelbulber. It gives interesting results.
Logged

MackTuesday
Guest
« Reply #5 on: June 25, 2011, 02:32:57 AM »

Awesome!  I can't wait to see the result.

I have downloaded the source to see if there are any obvious optimizations.  So far I've looked in fractal.cpp, common_math.cpp, and algebra.cpp.  I found a few things.

First, there are a number of places were the code does something like

Code:
a = 2.0 * b * c

where

Code:
temp = b * c
a = temp + temp

is likely faster.  Also I noticed your rand function does something like

Code:
return rand() % (max - 1)

If max < 65536 and rand() generates 16 bits instead of 31 or 32 you can do

Code:
return (rand() * (max - 1)) >> 16

This is likely faster.  It's also better because it gives the highest bits rather than the lowest, which are more random in the type of pseudorandom number generator used by rand().  In fact, you might prefer to implement rand() yourself.  It's quite easy and saves an extra function call if you declare it inline:

Code:
static unsigned buddhi_rand_seed = 4632784;  // you can initialize this any way you like
inline unsigned buddhi_rand()
{
    buddhi_rand_seed = buddhi_rand_seed * 1103515245 + 12345;  // This is the exact formula used in gcc's rand()
    return buddhi_rand_seed & 0x7fffffff;  // gcc's rand returns bits 0 to 30; that's the reason for the mask
    // If you use either of the following instead you can use multiply-shift instead of the % operator
    // return (buddhi_rand_seed & 0x7fffffff) >> 15;
    // return buddhi_rand_seed & 0xffff;
}

Logged
marius
Fractal Lover
**
Posts: 206


« Reply #6 on: June 25, 2011, 05:25:05 AM »

First, there are a number of places were the code does something like

Code:
a = 2.0 * b * c

where

Code:
temp = b * c
a = temp + temp

is likely faster.

First rule of optimization: profile!

I'd vote for legibility and defer to the compiler to optimize at the instruction sequence level; gcc isn't that bad anymore.
You might be able to beat it with carefully chosen sse3+ sequences for the DE loops but on simple arith and logic code it's hard to beat.
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #7 on: June 28, 2011, 12:23:45 PM »

Code:
			case menger_sponge:
{
double temp;
z.x = fabs(z.x);
z.y = fabs(z.y);
z.z = fabs(z.z);
if (z.x - z.y < 0)
{
temp = z.y;
z.y = z.x;
z.x = temp;
}
if (z.x - z.z < 0)
{
temp = z.z;
z.z = z.x;
z.x = temp;
}
if (z.y - z.z < 0)
{
temp = z.z;
z.z = z.y;
z.y = temp;
}

if (Mode == colouring)
{
double length2 = z.Length();
if (length2 < min) min = length2;
}

z *= 3.0;

z.x -= 2.0;
z.y -= 2.0;
if (z.z > 1.0) z.z -= 2.0;
r = z.Length();
tgladDE *= 3.0;
break;
It's a bit incomplete. wink

The original formula is;

Menger3(x,y,z){
   r=x*x+y*y+z*z;
   for(i=0;i<MI && r<bailout;i++){
      rotate1(x,y,z); (I think pre-rotation is done with another system in your program)

      x=abs(x);y=abs(y);z=abs(z);
      if(x-y<0){x1=y;y=x;x=x1;}
      if(x-z<0){x1=z;z=x;x=x1;}
      if(y-z<0){y1=z;z=y;y=y1;}

      rotate2(x,y,z); // (is missing)
    
      x=scale*x-CX*(scale-1);
      y=scale*y-CY*(scale-1);
      z=scale*z;
      if(z>0.5*CZ*(scale-1)) z-=CZ*(scale-1);
      
      r=x*x+y*y+z*z;
   }
   return (sqrt(x*x+y*y+z*z)-2)*scale^(-i);
}

Okay then. For MengerKoch, modify as follows;

Menger3(x,y,z){
   r=x*x+y*y+z*z;
   for(i=0;i<MI && r<bailout;i++){
      rotate1(x,y,z);

      x=abs(x);y=abs(y);z=abs(z);
      if(x-y<0){x1=y;y=x;x=x1;}
      if(x-z<0){x1=z;z=x;x=x1;}
      if(y-z<0){y1=z;z=y;y=y1;}

      rotate2(x,y,z);
      if(edgex>0) x=edgex-abs(edgex-x) // Thanks Syntopia for the exact formula!
       // By default use edgex=1 and all other = 0
       if(edgey>0) y=edgey-abs(edgey-y)
       if(edgez>0) z=edgez-abs(edgez-z) // edgez is not implemented in MB3D jet!
      // By default use scalex=1 - scaley=0 - scalez=1/3

      x=scale*x-CX*(scale-1);
      y=scale*y-CY*(scale-1);
      z=scale*z;
      if(z>0.5*CZ*(scale-1)) z-=CZ*(scale-1);
      
      r=x*x+y*y+z*z;
   }
   return (sqrt(x*x+y*y+z*z)-2)*scale^(-i);
}
« Last Edit: July 01, 2011, 10:36:11 AM by DarkBeam » Logged

No sweat, guardian of wisdom!
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #8 on: June 29, 2011, 05:54:47 PM »

Okay then. For MengerKoch, modify as follows;


Hi, DarkBeam, what exactly is a MengerKoch? Do you have an image or thread link?

I tried your formula and got some nicely pertubated Mengers (like the attached), but they are not very koch'y, I'm afraid.


* NoKoch.jpg (83.22 KB, 800x588 - viewed 219 times.)
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #9 on: June 30, 2011, 05:10:31 PM »

Tried to invert as I suggested? cheesy

You should get something like it grin ; (if not able to do so please contact me via pm!)

Be careful with cscale settings they are very important!


* aaaaa iko.jpg (168.74 KB, 1028x363 - viewed 261 times.)
« Last Edit: June 30, 2011, 05:13:01 PM by DarkBeam » Logged

No sweat, guardian of wisdom!
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #10 on: June 30, 2011, 05:41:23 PM »

Tried to invert as I suggested? cheesy

You should get something like it grin ; (if not able to do so please contact me via pm!)

Be careful with cscale settings they are very important!

I will try this formula next week. Now I'm working on other topic. With one of "upstrems" we are making Mandelbulber as a Debian package. Mandelbulber will be in Debian repository. Second thing, what I'm also doing now is Windows installer for Mandelbulber. It's almost done (I'm using InstallJammer which is on GPL licence).
Logged

DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #11 on: June 30, 2011, 06:26:02 PM »

Tried to invert as I suggested? cheesy

You should get something like it grin ; (if not able to do so please contact me via pm!)

Be careful with cscale settings they are very important!

I will try this formula next week. Now I'm working on other topic. With one of "upstrems" we are making Mandelbulber as a Debian package. Mandelbulber will be in Debian repository. Second thing, what I'm also doing now is Windows installer for Mandelbulber. It's almost done (I'm using InstallJammer which is on GPL licence).

That's okay Kriz (can I call you so? embarrass ) since I don't even remember the exact formula, hope Syntopia helps smiley

You can also ask to visual http://www.fractalforums.com/3d-fractal-generation/fragmentarium-an-ide-for-exploring-3d-fractals-and-other-systems-on-the-gpu/msg32167/#msg32167 <- he rendered my fractal successfully cheesy
Logged

No sweat, guardian of wisdom!
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #12 on: June 30, 2011, 07:35:31 PM »

Tried to invert as I suggested? cheesy


Ah, I found the combination :-)
Code:
if (edge.x > 0) z.x = edge.x-abs(edge.x-z.x)  ;

This also explains why the structure vanish even for very small edge.x values (e.g. 0.00000001)




* MengerKoch.jpg (38.92 KB, 500x307 - viewed 1156 times.)
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #13 on: July 01, 2011, 10:37:29 AM »

Cool! Now we have the exact formula, fixed my post too cheesy
Logged

No sweat, guardian of wisdom!
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #14 on: July 09, 2011, 09:38:02 PM »

I have implemented MengerKoch formula as an option for general IFS formula. It looks exactly the same like Syntipia's version. Thank you for details about this formula.

Logged

Pages: [1] 2   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Few weeks break in Mandelbulber development Mandelbulber Buddhi 13 3230 Last post September 13, 2011, 04:14:35 PM
by MarkJayBee
Embryonic Development Movies Showcase (Rate My Movie) brasnacte 3 1012 Last post February 01, 2014, 09:04:23 PM
by brasnacte
Fractal Explorer Development Let's collaborate on something! Catelee2u 4 1997 Last post March 11, 2014, 09:29:10 PM
by Catelee2u
Mandelbulb 3D development? Mandelbulb 3d Direct2Brain 7 3361 Last post October 15, 2014, 05:58:55 PM
by Sockratease
Mandelbulb 3d Development Officially Suspended Mandelbulb 3d « 1 2 3 » cKleinhuis 40 9236 Last post March 27, 2015, 10:58:07 AM
by cKleinhuis

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 25 queries. (Pretty URLs adds 0.014s, 2q)