Welcome to Fractal Forums

Fractal Software => Mandelbulber => Topic started by: Buddhi on June 14, 2011, 07:32:55 PM




Title: I need some help in Mandelbulber development
Post by: Buddhi 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 :'( 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: 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.
 


Title: Re: I need some help in Mandelbulber development
Post by: cytotox 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 ...
 :)


Title: Re: I need some help in Mandelbulber development
Post by: David Makin 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 :(
I don't even have as much time to work on converting i.Candy to OSX as I would like :(
Also I now only want to work from a Mac platform using Xcode as far as development is concerned.


Title: Re: I need some help in Mandelbulber development
Post by: MackTuesday 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.


Title: Re: I need some help in Mandelbulber development
Post by: Buddhi 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.


Title: Re: I need some help in Mandelbulber development
Post by: MackTuesday 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;
}



Title: Re: I need some help in Mandelbulber development
Post by: marius 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.


Title: Re: I need some help in Mandelbulber development
Post by: DarkBeam 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. ;)

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);
}


Title: Re: I need some help in Mandelbulber development
Post by: Syntopia 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.


Title: Re: I need some help in Mandelbulber development
Post by: DarkBeam on June 30, 2011, 05:10:31 PM
Tried to invert as I suggested? :D

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

Be careful with cscale settings they are very important!


Title: Re: I need some help in Mandelbulber development
Post by: Buddhi on June 30, 2011, 05:41:23 PM
Tried to invert as I suggested? :D

You should get something like it ;D ; (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).


Title: Re: I need some help in Mandelbulber development
Post by: DarkBeam on June 30, 2011, 06:26:02 PM
Tried to invert as I suggested? :D

You should get something like it ;D ; (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 :)

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 :D


Title: Re: I need some help in Mandelbulber development
Post by: Syntopia on June 30, 2011, 07:35:31 PM
Tried to invert as I suggested? :D


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)




Title: Re: I need some help in Mandelbulber development
Post by: DarkBeam on July 01, 2011, 10:37:29 AM
Cool! Now we have the exact formula, fixed my post too :D


Title: Re: I need some help in Mandelbulber development
Post by: Buddhi 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.

(http://nocache-nocookies.digitalgott.com/gallery/7/640_09_07_11_9_16_29.jpeg)


Title: Re: I need some help in Mandelbulber development
Post by: 618smartguy on July 15, 2011, 06:44:43 PM
I would be glad to help!

I'm just 14, but I am great at programming, and i have lots of free time. I have not done much with c++ but generally its not too hard for me to learn a new language. Also I am really into math so I could work on improving and optimizing DE code and other aspects. I would love to see this project go far and i suppose that helping you will progress it.


Title: Re: I need some help in Mandelbulber development
Post by: Sfumato on August 07, 2011, 08:46:55 PM
Krzysztof, I am so sorry I am neither a programmer and nor a mathematician as I'll be happy to be of any help. I could prepare textures, maps, gradients or anything of that kind (2D raster graphics) if it was needed.
Though You said
some C++ sources for new interesting fractal formulas (not only mathematical ideas).  
What ideas did You mean? Perhaps that is the field non-programmers and non-mathematicians could participate in!
With kindest regards, and wish You solve all the personal issues successfully,
Sfumato.


Title: Re: I need some help in Mandelbulber development
Post by: Dave13 on March 26, 2016, 09:13:47 AM
Hi Buddhi,

How is the DEB package going? I am still learning how to build DEB packages (I successfully have built a couple) and would be happy to help out with this.

Dave.


Title: Re: I need some help in Mandelbulber development
Post by: Buddhi on March 26, 2016, 09:33:30 AM
Actually I'm in touch with one of Debian maintainers. He will prepare deb packages and add them to official repository.
I have never done packaging for debian by myself. I think it doesn't make sense until I cannot provide continuous compatibility with packages which are in official repository. That's why for Linux it's distributed as source code.


Title: Re: I need some help in Mandelbulber development
Post by: valera_rozuvan on July 26, 2016, 05:04:33 PM
Hi there! I would like to help you. Looking at https://github.com/buddhi1980/mandelbulber2 (https://github.com/buddhi1980/mandelbulber2) , I can't find description on the build process. How do you go about building the project on the various systems? I am interested in Linux, and Windows versions.


Title: Re: I need some help in Mandelbulber development
Post by: Buddhi on July 26, 2016, 06:52:09 PM
Hi there! I would like to help you. Looking at https://github.com/buddhi1980/mandelbulber2 (https://github.com/buddhi1980/mandelbulber2) , I can't find description on the build process. How do you go about building the project on the various systems? I am interested in Linux, and Windows versions.

Hi. Try to follow guides from README file: https://github.com/buddhi1980/mandelbulber2/blob/master/mandelbulber2/deploy/README to prepare Linux for development

For cross-compiling to build win32 and win64 version you can use following bash scripts:
https://github.com/buddhi1980/mandelbulber2/blob/master/mandelbulber2/deploy/setup-cross-compile-to-windows.sh
https://github.com/buddhi1980/mandelbulber2/blob/master/mandelbulber2/deploy/cross-compile-windows.sh

To prepare installable packages you can use:
https://github.com/buddhi1980/mandelbulber2/blob/master/mandelbulber2/make-package.sh

When you clone this git repository, all that file you will find in mandelbulber2 and mandelbulber2/deploy directories

There is also a lot of information here (guide how to add new fomulas and prepare development environment): https://github.com/buddhi1980/mandelbulber2/blob/master/mandelbulber2/deploy/AddingNewFormulas.odt



Title: Re: I need some help in Mandelbulber development
Post by: valera_rozuvan on July 26, 2016, 10:28:01 PM
After some poking around, I did eventually get Mandelbulber2 to build on a machine running Ubuntu 16.04. Here are my steps:

  • sudo apt-get install build-essential libqt5gui5 qt5-default libpng12-0 libpng12-dev qttools5-dev qttools5-dev-tools libgsl2 libgsl-dev libgomp1 git
  • cd ~
  • mkdir -p github.com/buddhi1980
  • cd github.com/buddhi1980
  • git clone https://github.com/buddhi1980/mandelbulber2.git
  • cd mandelbulber2/mandelbulber2
  • ./make-package.sh 2.42 /home/valera/github.com/buddhi1980/mandelbulber2/mandelbulber2/build
  • cd build/mandelbulber2-2.42/makefiles
  • qmake mandelbulber.pro
  • make --jobs=4 all
  • cd ..
  • ./install

NOTE: In the above, I chose the number 2.42 randomly. I guess it can be any version number for local development.


Title: Re: I need some help in Mandelbulber development
Post by: mclarekin on July 27, 2016, 01:45:10 AM
Hi Valera, I am running on 16.04 too.

Thanks for your list of steps

Quote
There is also a lot of information here (guide how to add new formulas and prepare development environment): https://github.com/buddhi1980/mandelbulber2/blob/master/mandelbulber2/deploy/AddingNewFormulas.odt

This was written a while ago and probably needs updating.


Title: Re: I need some help in Mandelbulber development
Post by: capn-damo on August 26, 2016, 03:24:05 AM
Steve Pusser has packaged v2.08 for Debian Stable. You can get it from his repo here (https://software.opensuse.org/download.html?project=home%3Astevepusser%3Amandelbulber2_2.08.3&package=mandelbulber2)

I put together a HowTo for compiling on Debian on the BunsenLabs forums: Mandelbulber2 on jessie and stretch (https://forums.bunsenlabs.org/viewtopic.php?id=2522)

The MB2 README seems to be incorrect for Debian - specifically the png libraries. This is what I found was needed to compile the source...

Debian Stable(jessie):
Code:
sudo apt-get install build-essential libqt5gui5 qt5-default libpng12-0 libpng12-dev qttools5-dev qttools5-dev-tools libgomp1

Debian Testing/Unstable (stretch/sid):
Code:
sudo apt-get install build-essential libqt5gui5 qt5-default libpng16-16 libpng-dev qttools5-dev qttools5-dev-tools libgomp1


Title: Re: I need some help in Mandelbulber development
Post by: Buddhi on August 26, 2016, 09:01:23 PM
Steve Pusser has packaged v2.08 for Debian Stable. You can get it from his repo here (https://software.opensuse.org/download.html?project=home%3Astevepusser%3Amandelbulber2_2.08.3&package=mandelbulber2)

I put together a HowTo for compiling on Debian on the BunsenLabs forums: Mandelbulber2 on jessie and stretch (https://forums.bunsenlabs.org/viewtopic.php?id=2522)

The MB2 README seems to be incorrect for Debian - specifically the png libraries. This is what I found was needed to compile the source...

Debian Stable(jessie):
Code:
sudo apt-get install build-essential libqt5gui5 qt5-default libpng12-0 libpng12-dev qttools5-dev qttools5-dev-tools libgomp1

Debian Testing/Unstable (stretch/sid):
Code:
sudo apt-get install build-essential libqt5gui5 qt5-default libpng16-16 libpng-dev qttools5-dev qttools5-dev-tools libgomp1

Thank you for this information. I will correct README file.