Logo by AGUS - Contribute your own Logo!
News: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. October 24, 2014, 06:04:35 PM


Login with username, password and session length



Pages: [1]   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: Possible modification an unit vector addition  (Read 662 times)
0 Members and 1 Guest are viewing this topic.
Alef
Fractal Schemer
****
Posts: 1010



WWW
« on: March 25, 2012, 09:39:34 PM »

Looking at last two posts of time tested 2D formulas should be in 3D I just could not to post this possible _modification. It is not an age old time tested formula, posted in december, and found after few beers.  A Beer Cup http://www.fractalforums.com/index.php?topic=4881.msg39515#msg39515
They say intoxication connects your soul to celestial spheres where information is obtained, but in a dangerous way.

I was trying implementing amazingbox formula together with some variations to play with. Well, this is with bug filled double y no z folded amazingbox, and not with normal amazingbox.

z=amazingbox (z) + c
if |z| !=0
z=z/cabs(z) * complex(-0.1,0.5) + z  (division first seems to be faster.)
else
z=z+1.0E-10

Positive factor shrunk the fractal, negative bloated it, imaginary value rotated fractal. Alsou modification made fractal more natural floral looking. Quaternionic factor slowed it, so I kept it complex.


And nice julia.


Alsou tested unmathematical things from TMA2.ufm. Round function truncated the render.
z=mandelbox (z) +c;
if round(z) !=0
z=z/round(z) * complex(0,1) + z


Alsou after a mandelbulb formula and factor j=1 got this plant curved bulb.
z= mandelbulb(z)+c
z=z/cabs(z)* quaternion(-0.2,0,1,0) +z


p.s.
Yeah, there are just two who can implement, and they don't want to lower quality standarts;) And its pretty time consuming. So just as notice, until there will be no ideas for 249th formula. The code are in mandelbulb and amazingbox http://www.chaospro.de/formulas/display.php?fileid=222
« Last Edit: March 28, 2012, 07:15:03 PM by Asdam » Logged

P.E.A.C.H. - please examine and critique honestly.
Alef
Fractal Schemer
****
Posts: 1010



WWW
« Reply #1 on: March 28, 2012, 06:59:57 PM »

Allredy posted 7 degree mandelbulb modified by z/round(z), just to show how this works with mandelbulbs.
z=mandelbulb^7(z)+c
z=(  z/round(z)  )*quaternion(1,0,0,0) + z




And an unit vector addition modification of normal bug free amazingbox / mandelbox with fold=1, min r=0.5, scale=-1.5 First modulus squared as || in Ultra Fractal, second a bitt modified modulus.
z=amazingbox(z) +c
z=(  z/|z|  )*complex(0.6,0) + z


« Last Edit: March 28, 2012, 07:19:29 PM by Asdam » Logged

P.E.A.C.H. - please examine and critique honestly.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 1666


The spaghetti formula coder


« Reply #2 on: March 29, 2012, 11:37:35 AM »

It is a nice idea, a more consistent formula may be;

s=amazingbox (s) + c
m = cabs3d(s) = s.x^2 + ... + s.z^2
if m < 1e-23
s=s/m * Rotate(3angles) + s  (division first seems to be faster.) (impossible!)  wink

// else (not needed)
// z=z+1.0E-10 (not needed)

I can not do it btw for now undecided
Logged

Formulas are never too much (?)

Alef
Fractal Schemer
****
Posts: 1010



WWW
« Reply #3 on: March 31, 2012, 08:27:44 PM »

It seems much smother code, just that with else z=z+1.0E-10 was simpler to write down embarrass  

Maybe it sometimes got faster, sometimes not, realy not shure;)
In help files I found claims that functions using many registers (or something like that, I m not a programmer) such us sqr should be placed first, and then must go simpler functions like multiplication. Becouse then processor can use its registers or something alike (used for sqr) for a multiplication. If multiplication goes first, processor still has to keep sqr function data.  
I was thinking that division too could have such property. At least having old PC helps to test speed;)

the same pics
http://www.fractalforums.com/images-showcase-(rate-my-fractal)/mandelbox-tree/
« Last Edit: March 31, 2012, 08:33:36 PM by Asdam » Logged

P.E.A.C.H. - please examine and critique honestly.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 1666


The spaghetti formula coder


« Reply #4 on: March 31, 2012, 11:58:05 PM »

Dunno, normally I code sqr with a simple fpu instr.:
fmul st,st
that computes in a very small time wink
See you and thanks friend
Logged

Formulas are never too much (?)

Alef
Fractal Schemer
****
Posts: 1010



WWW
« Reply #5 on: April 06, 2012, 03:28:41 PM »

Sqr are very fast even on old PC. So in Chaos pro sqr(sqr(z)) compiled is by some percents faster than long multiplication of z*z*z*z or sqr(z)*sqr(z), throught the code then are very ugly;)
Not shure what instructions it uses, but I could guess, the same.
« Last Edit: April 06, 2012, 04:53:24 PM by Asdam » Logged

P.E.A.C.H. - please examine and critique honestly.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 1666


The spaghetti formula coder


« Reply #6 on: April 06, 2012, 05:12:05 PM »

I have added it to my formulas, try it and see what happens. A bit more flexible - custom rotation and scale of your term. grin Luca

Code:
A cool 3D transform suggested by Asdam in the forums;

vec3d += Scale * Rotation * vec3d / cabs3d(vec3d)

Where cabs3d(x,y,z) = sqrt(x*x + y*y + z*z)

Somewhat similar to a pinch/punch effect.

LucaGN & Asdam 2012
Logged

Formulas are never too much (?)

David Makin
Global Moderator
Fractal Senior
******
Posts: 2269



Makin' Magic Fractals
WWW
« Reply #7 on: April 06, 2012, 07:50:07 PM »

Sqr are very fast even on old PC. So in Chaos pro sqr(sqr(z)) compiled is by some percents faster than long multiplication of z*z*z*z or sqr(z)*sqr(z), throught the code then are very ugly;)
Not shure what instructions it uses, but I could guess, the same.

If coding for a decent compiler with optimisations set correctly then the compiler *ought* to choose the best method anyway.....and does in some cases, however generally you only find that out by trial and error or if you actually wrote the compiler wink
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Alef
Fractal Schemer
****
Posts: 1010



WWW
« Reply #8 on: April 16, 2012, 06:14:55 PM »

Copy past from helpfiles.

Quote
modifying your expressions so that the FPU is used more efficiently. That means a*sin(c) will be transformed into sin(c)*a. Why is sin(c)*a faster? Well, what happens if you calculate a*sin(c)? At first a gets fetched into the internal registers. After that c gets fetched. Then the program recognizes that the sine of c should be calculated. The Intel-Pentium FPU has only 8 registers. Now 4 registers are already used: two by a and two by c. In order to calculate sin(c) the routines need 5 registers. Thus a must be unloaded, sin(c) calculated, a loaded and then the multiplication can be done.
But if the expression is sin(c)*a, then c gets fetched into the internal registers. The sine of c can be calculated, because 6 registers are free. After having calculated sin(c) only two registers are blocked (by sin(c), i.e. the result only). a can be fetched without problem, and the result can be multiplicated. As a general rule: Operators get exchanged so the most expensive operations are done at first.

elimitating constant expressions:

Helpfile stated that compiler eliminates nostant expressions, but I doubt that, at least loss of spead don't indicates this.)
Logged

P.E.A.C.H. - please examine and critique honestly.
Pages: [1]   Go Down
  Print  
 
Jump to:  


Related Topics
Subject Started by Replies Views Last post
Unit Vector Mandelbulb (variations) New Theories & Research Alef 1 220 Last post February 08, 2012, 07:03:41 PM
by Alef
Cheater's Brot... and spokes modification Theory M Benesi 0 1059 Last post February 29, 2012, 05:35:30 AM
by M Benesi
_asdamTrans (Unit Vector ) use Tutorials Alef 7 615 Last post July 31, 2012, 04:30:43 PM
by Alef
Do fractal-artists actually know which modification effects what in MB3D ?How..? Help & Support psYnfinite 1 164 Last post June 03, 2013, 07:27:46 PM
by vinz

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines

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