Logo by bib - 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: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. April 24, 2024, 06:08:23 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: Help on first fractal maker  (Read 1978 times)
0 Members and 1 Guest are viewing this topic.
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #15 on: November 18, 2010, 10:23:05 PM »

I barely know any c based language so that was a bit confusing.
I'll have to look into it though because I know it will be faster than what I am using.


Probably my fault for writing it in a mix of C and BASIC syntax smiley
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
kronikel
Navigator
*****
Posts: 79



« Reply #16 on: November 18, 2010, 10:27:16 PM »

Any ideas on an equation?
I'm pretty stumped but I feel like I'm over thinking this
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #17 on: November 18, 2010, 10:33:04 PM »

I think you missed it:

http://www.fractalforums.com/programming/help-on-first-fractal-maker/msg24585/#msg24585

"^" is "to the power of" - in standard c you might have to use "scale = pow(2, 2-n)" I think - or is that "scale = pow(2-n,2)" ?
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
kronikel
Navigator
*****
Posts: 79



« Reply #18 on: November 18, 2010, 10:40:23 PM »

Ahah! I didn't see that and I didn't think of that because my brain wanted to shut off when approaching negative exponents for some reason.
Output:= Pow(2, 2 - Input);

I think that's all I needed I'll try to throw it together and see what I get.
Logged
kronikel
Navigator
*****
Posts: 79



« Reply #19 on: November 18, 2010, 11:33:58 PM »

Everything is working but I'm still left with the problem of it taking a lot longer to render when zooming in.
Now it does each pixel only once and I'm sure of it.
It does not execute more lines of code by zooming in on the fractal at all.
The only difference I see is that the numbers is uses get a log bigger.
Does computing a number like 1.203592928220659 take a long longer than just 1.2?
I've never noticed it before so I'm thinking even if larger numbers do take more time it can't make this much of a difference.
Logged
ker2x
Fractal Molossus
**
Posts: 795


WWW
« Reply #20 on: November 19, 2010, 01:24:11 AM »

Does computing a number like 1.203592928220659 take a long longer than just 1.2?

No. They are both 64bits floating point numbers on a 64bits CPU, it take exactly the same time.
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
kronikel
Navigator
*****
Posts: 79



« Reply #21 on: November 19, 2010, 02:01:44 AM »

Edit:
Uggh I was changing the wrong variable when I was testing the max iteration problem and that actually was it.
If I set it lower I can render a high magnification in under a second now.
« Last Edit: November 19, 2010, 02:15:03 AM by kronikel » Logged
Tabasco Raremaster
Iterator
*
Posts: 172



WWW
« Reply #22 on: November 19, 2010, 03:01:58 AM »

"I can't figure out how to zoom in on the fractal without the time it takes to draw it increasing.
Every time I zoom in it takes a lot longer to draw out than the last time, even though the area drawn is the same size"

For as far as I know there is no fractal rendering program in where the rendering time does not increase with a higher zoom.
My sugestion is : Figure it out. Just do it!
Logged

http://tabasco-raremaster.deviantart.com/

If you dislike it press; Alt+F4
ker2x
Fractal Molossus
**
Posts: 795


WWW
« Reply #23 on: November 19, 2010, 09:03:01 AM »

A lot of people seem to be talking about these complex and imaginary numbers.
I understand for the most part what they are but I don't use them in any way that I'm aware of.

You are drawing the mandelbrot set, the formula is : z = z²+c where z and c are compex numbers.

your code :
Code:
xtemp:= x*x - y*y + px;
y:= 2*x*y + py;
x:= xtemp;

is doing z = z²+c with
"px" -> real part of c
"py" -> imaginary part of c
"x" -> real part of z
"y" -> imaginary part of z
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #24 on: November 19, 2010, 03:38:08 PM »

Everything is working but I'm still left with the problem of it taking a lot longer to render when zooming in.
Now it does each pixel only once and I'm sure of it.
It does not execute more lines of code by zooming in on the fractal at all.
The only difference I see is that the numbers is uses get a log bigger.
Does computing a number like 1.203592928220659 take a long longer than just 1.2?
I've never noticed it before so I'm thinking even if larger numbers do take more time it can't make this much of a difference.

Zooming in taking longer to render is pretty unavoidable if you're zooming into areas on the boundary of the Set, in particular if the image has large areas of "inside", this is simply because more iterations are necessary on average per pixel to decide if the pixels are inside or outside.
As you say a solution is reduce the max iteration value but of course doing this results in loss of detail and the more you zoom in the greater the loss of detail will be, in fact normally one would actually want to *increase* the max iterations on higher magnifications.
One way of offsetting the speed problem that is emploiyed in many fractal programs is early detection of "inside" points where the orbit of the point concerned is tending to a fixed value (point attractor).
To do this on each iteration before calculation of the new z value, store the current value as say zold, then after calculating the new z value test the value of (z.x-zold.x)^2+(z.y-zold.y)^2 against a small threshold (smallbailout), say at largest 1e-3 and if the calculated value is less than 1e-3 then assume the point is "inside" and stop iterating. The problem with this method is if the theshold value (here 1e-3) is too large then this test in itself will introduce "errors" in the render i.e. reduce the detail level.
The thing to do to render a given view of an escape-time fractal in an optimum manner speedwise is to use a correct balance of the 3 values - the bailout value, the max iteration value and this small bailout test value (here 1e-3). Speedwise of course one should always use the minimum possible bailout value, e.g. testing z.x^2+z.y^2 against 4.0 for the z^2+c Mandelbrot (and z^2+c Julias), the optimum max iterations and smallbailout test value will depend on individual views but in general the more zoomed in you are then to avoid gross loss of detail then the larger you need to make max iterations and the smaller you need to make the small bailout test value.

For a better guide on fractal orbits see:

http://www.fractalgallery.co.uk/orbits.html
« Last Edit: November 19, 2010, 03:41:32 PM by David Makin » Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
ker2x
Fractal Molossus
**
Posts: 795


WWW
« Reply #25 on: November 19, 2010, 05:47:18 PM »

Everything is working but I'm still left with the problem of it taking a lot longer to render when zooming in.
Now it does each pixel only once and I'm sure of it.
It does not execute more lines of code by zooming in on the fractal at all.
The only difference I see is that the numbers is uses get a log bigger.
Does computing a number like 1.203592928220659 take a long longer than just 1.2?
I've never noticed it before so I'm thinking even if larger numbers do take more time it can't make this much of a difference.

Zooming in taking longer to render is pretty unavoidable if you're zooming into areas on the boundary of the Set, in particular if the image has large areas of "inside", this is simply because more iterations are necessary on average per pixel to decide if the pixels are inside or outside.
As you say a solution is reduce the max iteration value but of course doing this results in loss of detail and the more you zoom in the greater the loss of detail will be, in fact normally one would actually want to *increase* the max iterations on higher magnifications.
One way of offsetting the speed problem that is emploiyed in many fractal programs is early detection of "inside" points where the orbit of the point concerned is tending to a fixed value (point attractor).
To do this on each iteration before calculation of the new z value, store the current value as say zold, then after calculating the new z value test the value of (z.x-zold.x)^2+(z.y-zold.y)^2 against a small threshold (smallbailout), say at largest 1e-3 and if the calculated value is less than 1e-3 then assume the point is "inside" and stop iterating. The problem with this method is if the theshold value (here 1e-3) is too large then this test in itself will introduce "errors" in the render i.e. reduce the detail level.
The thing to do to render a given view of an escape-time fractal in an optimum manner speedwise is to use a correct balance of the 3 values - the bailout value, the max iteration value and this small bailout test value (here 1e-3). Speedwise of course one should always use the minimum possible bailout value, e.g. testing z.x^2+z.y^2 against 4.0 for the z^2+c Mandelbrot (and z^2+c Julias), the optimum max iterations and smallbailout test value will depend on individual views but in general the more zoomed in you are then to avoid gross loss of detail then the larger you need to make max iterations and the smaller you need to make the small bailout test value.

For a better guide on fractal orbits see:

http://www.fractalgallery.co.uk/orbits.html


Mmm, it may be interesting for my openCL buddhabrot code smiley
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #26 on: November 20, 2010, 06:45:46 PM »

Of course with respect to using a "smallbailout' to test for point-attractors so you have early detection of "inside", you can extend this to test for attractors of higher period - for instance period 2 attractors are almost as easy to detect as point attractors but here you need z, zold and zolder and would test the value of (z.x-zolder.x)^2+(z.y-zolder.y)^2 against a smallbailout.
There are also reasonably quick (but less efficient) algorithms to test for periodic attractors of arbitrary period.
Of course for particular Julia Sets (at least for z^p+c) then one only needs test for a specific periodic attractor in order to detect "inside" early, though obviously the period would be best known at runtime for maximum efficiency.
To state the obvious, the larger the period then the less effective testing for periodic attractors becomes.
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Pages: 1 [2]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
independent film maker requires help from fractal animators Let's collaborate on something! teamfresh 6 1096 Last post March 25, 2010, 02:38:40 AM
by teamfresh
Animation maker Ipol bug for Lightning parameters bug reporting schizo 0 1335 Last post September 01, 2014, 10:19:07 PM
by schizo
Meet My Maker The Mad Mandelbox Mandelbulber Gallery mclarekin 0 683 Last post September 02, 2014, 02:22:35 AM
by mclarekin
animation maker does not stop his loopfunction. Help & Support jacqsvd 2 386 Last post February 19, 2015, 02:35:08 PM
by jacqsvd
Fractal Maker Others scream 0 2541 Last post April 20, 2016, 03:10:22 AM
by scream

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.162 seconds with 24 queries. (Pretty URLs adds 0.011s, 2q)