Logo by Timeroot - 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: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. March 29, 2024, 02:33:50 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 ... 4 5 [6] 7   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: A few formulas (For Luca... :D)  (Read 12371 times)
Description: Who can change the name of this thread... :D
0 Members and 1 Guest are viewing this topic.
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #75 on: November 17, 2015, 07:47:04 PM »

Random programmer comment/observation: if you'd like to "future proof" these formulae, or simply make them usable in other systems, there should also be a plain C (or Pascal, or whatever) version besides the assembly code. I think x87 code written in 2015 (!!!!!) has way too high chance of being "lost in the sands of time", and this seems like a good effort so it would be a shame.
Hi!

  Well, there are .frags of the majority of this stuff.  I've also posted the math in various threads here, so it can be ported to various formats.  I think I put the math in the .m3f descriptions, for the most part.

  The code isn't even optimized yet- a few extra instructions here and there, and maybe better ways of doing stuff (not sure if fsqrt is as fast as fsqrtss in Core2?). 

  Ohh, and I think mclarekin is porting it to Mandelbulber- and that is some form of c code, I think.
Logged

lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #76 on: November 17, 2015, 07:54:33 PM »

IMO the question of performance is meaningless when talking about x87 assembly. It is EXTREMELY slow compared to SSE/AVX, even without considering vectorisation (i.e. doing 4-wide, 8-wide or even 16-wide instructions just for the 1 result). Even then, instruction scheduling and register allocation is something best done by a compiler, which can throw combinatorial optimisation at nice clean source code; this approach is so much better, it's not really worth considering "alternatives".

I'm sure there are plenty of good explanations on the difference between x87 and modern instructions on the net, if not I can give a quick summary of the benefits here.
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #77 on: November 17, 2015, 08:01:43 PM »

Question...
What does BenesiPoly do?
Is it the same of polyfolding? I hope no... wink

  No  :d.  Definitely not...   cheesy   I'm assuming the folding one probably folds over planes, this one stretches a circle to a polygon (technically the polygon's incircle).  

Although polyfolding does interesting stuff with the T1 pine tree (put in between t1 and pine tree).  cheesy
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #78 on: November 17, 2015, 08:24:09 PM »

IMO the question of performance is meaningless when talking about x87 assembly. It is EXTREMELY slow compared to SSE/AVX, even without considering vectorisation (i.e. doing 4-wide, 8-wide or even 16-wide instructions just for the 1 result). Even then, instruction scheduling and register allocation is something best done by a compiler, which can throw combinatorial optimisation at nice clean source code; this approach is so much better, it's not really worth considering "alternatives".
  So... I should write c code and compile it... instead of struggling through assembly?  cheesy  Which free c compiler should I jump on, gcc?

I'm sure there are plenty of good explanations on the difference between x87 and modern instructions on the net, if not I can give a quick summary of the benefits here.

  I'm looking around, but I'd appreciate your input. 
Logged

lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #79 on: November 17, 2015, 08:57:24 PM »

A quick summary of the benefits of using a newer instruction set like SSE/AVX over x87:

* Registers are random-access, meaning you don't have all these fxchg instructions clogging up your precious instruction decode bandwidth
* Way more registers, so less register pressure/spilling
* Access to all these superfast new instructions
* x87 performance has not been a priority since Pentium 3 (P4 and newer are all about SSE throughput).


Yes, you should definitely compile some higher level code instead of using assembly language. GCC is a good choice if you can handle its pedantry, but then again, coming from asm coding that is highly unlikely to the be a problem cheesy
Logged

lycium
Fractal Supremo
*****
Posts: 1158



WWW
« Reply #80 on: November 17, 2015, 09:02:35 PM »

Funny thing: around 2006 on this forum there was this crazy assembly language fanatic going on and on about hand optimised asm code, and it was all super slow x87 stuff.

So that's nearly 10 years of telling people not to use asm on this forum  afro
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #81 on: November 18, 2015, 01:19:07 AM »

A quick summary of the benefits of using a newer instruction set like SSE/AVX over x87:

* Registers are random-access, meaning you don't have all these fxchg instructions clogging up your precious instruction decode bandwidth
* Way more registers, so less register pressure/spilling
* Access to all these superfast new instructions
* x87 performance has not been a priority since Pentium 3 (P4 and newer are all about SSE throughput).
  Out of these... the only thing that would benefit the majority of the things I do, up til now, is fast "new" instructions.  I'm basically doing some very simple, streamlined, linear math operations (for M3D), so I don't think I can (I could be wrong... that happens all the time) take advantage of the "vectorization" of parallel instructions.  M3D passes stuff to the code I write, then stuff is passed back to M3D- so there can't be 2 things running at once, unless I wrote some super fancy code that hacked M3D... which is way too much for now.

  What would be really awesome is an x87 to SSE recompiler, that takes x87 code and optimizes it by passing what it can to SSE.  That would be something worth working on.   

Yes, you should definitely compile some higher level code instead of using assembly language. GCC is a good choice if you can handle its pedantry, but then again, coming from asm coding that is highly unlikely to the be a problem cheesy

  That might be a bit easier than what I'm doing: using a debugger, typing code in hex... etc.  wink   I'm supposed to grab GCC anyway... so... it's on the list.
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #82 on: November 18, 2015, 01:22:10 AM »

Polyhedral and polygonal transforms.  

  If you're using them with a cube, like the Menger, you need to use the Spheric transform with them.  If you're using them with T1 and the Pine Tree, you just use one or the other (I like the polygonal! nice and neat!) before the Pine Tree portion.
Hexagon, 6x6 polyhedron transform
 

* _BenesiPolyhedral.m3f (1.44 KB - downloaded 84 times.)
* _BenesiPolygonal.m3f (0.68 KB - downloaded 88 times.)
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #83 on: November 18, 2015, 04:05:51 AM »

Ok, I made hedron to sphere transforms for the polys these formulas generate- so you can switch back and forth, which is.. maybe useful for certain applications.  Like this Menger:



Code:
Mandelbulb3Dv18{
g.....s/...c3...w....2....UI8bZW0Fw..vflouuR5q1Enkzd96a2YwXP7ms3oA8xzKslPr8Q.WzD
........................................kz1........Y.VC0................y.2...wD
...Uz6....k4/.../s/0/.....Up....l/....E3.....omEQgisq6pD/s/........m0dkpXm1....U
./....kD12..0..........wz.................................U0.....y1...sD...../..
.z1...sDolFZd9iBmx1..........KzJxr2fLrdjgAZeBnNCHuHP4fJZymxOzslPySyorRqDPaV0iHmo
KuHDcNPuHTrNzayP2AdjQjqDU.....oA3...DD........sD.6....sD..G.....................
.............oAnAt1...sD....z...........................................P....k1.
.....Ksulz1.......kz.wzzz1.U..6.P....U5...EB....m....c3....F....6/...I1.....SF52
...U.qFG9yzb2zzz....zrm4..6.3c..zXCc...UCW0tRhyD66HNL1YPWz1..........E.UGwTl140.
.QHoLim.bz1.i72fW/hkz0EQ7YQrodyj2EkFzjzbB/..LHY2t2Apzu/kX/pMbQyD.6jPr72F9zP.2c..
zzzz.............0...................2./8.kzzzD............8....................
/EU0.wzzz1...................................2CcN/UvNPcveeWCNq0.yRiibHJJUk1f..XR
SvBmx3CcN/UvNPcvQsLsUa3.ibhVi1bTV1OK.sSq4uCly3CcN/UvNPcvMwLsUa3.ibhVinqTV1OK.sSq
4uCkz3CcN/UvNPcv..EsUa3feeWCNqGQIJ36wk8EwyLsUa3f................................
E....Ek.l2E.....I....Q....EHZtqNZ7LG4B3.rJaQ..............................U/4M..
...................0./........zD........kz1........sz...........................
................................................................................
.....................2.....3....0....wZEZtKNnZ4IjlKScJ4Nm34P....................
.............................U.E........M.2.....................................
................................................................................
................................/....E/...U.....T7INiJqQd/pPgZ5OZFaQVl4JjB3QcJaQ
Z/......................................E.2........2./..........................
................................................................................
..........................................U.....I....Q....EHZtqNZ7LG4B3.........
..........................U/4M.....................0./........zD........kz1.....
...sz...........................................................................
........................................................}
{Titel: cool menger 2}

* _BenesiPolyhedralToSphere.m3f (1.46 KB - downloaded 86 times.)
* _BenesiPolygon_YZ_ToCircle.m3f (2.5 KB - downloaded 79 times.)
« Last Edit: November 18, 2015, 05:20:10 AM by M Benesi » Logged

mclarekin
Fractal Senior
******
Posts: 1739



« Reply #84 on: November 18, 2015, 05:51:22 AM »

Looking great.   afro afro afro

BTW I think you should write all formulas in C++ grin grin grin
because I am too slow and you write new formulas too fast grin

( and I much prefer exploring than coding).
Logged
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #85 on: November 19, 2015, 01:42:58 AM »

 You might have a little break mclarekin.  I'm stuck on the tetrahedral transform- I have to align the tetrahedron with the transform and scale the transform correctly, and the Sierpinski already looks good combined with the Menger sphere.  The whole point of that transform was to combine the 2 of them... and they already combine quite wonderfully.  

  I do think I'll try some stretching and bending transforms... but I think they are already written!  

  cough.. but... I did change the rotatin'pine'square to a rotatin'pinepolygon... and probably will change the rotatin'pinecube to the more general polyhedron formula.. despite really liking the polygons. 

* BenesiT1yzRotatinPinePolygon.m3f (3.09 KB - downloaded 101 times.)
« Last Edit: November 19, 2015, 03:14:51 AM by M Benesi » Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #86 on: November 20, 2015, 05:59:54 AM »

Since I told mclarekin they'd get a break, I won't post the formula for these things until tomorrow.  I've got to clean and complete the code... parts of the code aren't finished, and I want to add something to it.  Basically, the code adds or subtracts from the x coordinate of the fractal (most of the were done on the 3rd iteration), so you can stretch and warp it using certain parameters.  

    
« Last Edit: November 20, 2015, 06:08:31 AM by M Benesi » Logged

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


Fragments of the fractal -like the tip of it


« Reply #87 on: November 20, 2015, 10:24:15 AM »

Those new variations are wonderful but please use shorter names - are you inspired by Mandelwerk? cheesy
(Example instead of amazing surface I used AmazingSurf and it is already long wink )
Logged

No sweat, guardian of wisdom!
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #88 on: November 20, 2015, 09:11:21 PM »

Those new variations are wonderful but please use shorter names - are you inspired by Mandelwerk? cheesy
 Isn't that the name Yohan uses for his fractal artwerk?  Since that it the case, I think that would be up to Yohan, if he'd like the name he uses associated with the formulas that we're (the community) producing.  

  Mandelwerk voor toekomstige Mandelspelen???  Google translate... wink
(Example instead of amazing surface I used AmazingSurf and it is already long wink )

  Ahh... I see.  They don't fit in the formula selection window, so you can't tell which is which!!  Don't include them with the officially released formulas until we get everything finalized (at least in the 1.0 stage of development!  These are all betas!).

  I'm thinking we can rename the formulas like the following:

    BT1withPine1  
    BT1withPine1+        //this will have the yz-plane rotation and polygon transform, will take a bit longer to calculate
    BT1withPine1++      //this will have generalized rotations and polygon transform, will take even longer to calculate
    BT1withPine1+++    //this will have rotations, polygon transforms, and skews... and will take even longer to calculate!
    BT1withPine1++++  //this will have optional T2 through T5 in addition to the other options... even slower!!

  Then  BT1withPine1.1 when it's updated...  sound better?  

  For the transforms:
  _BTransform1v1
  _BTransform14dv1
  _BTransform14dv1Clamped   //will this fit???
  _BTransform2v1

 
  _PolygonToCircle   and _CircleToPolygon need to be spelled out...  because that is what they do!!!!  I need to change them to be around arbitrary axes...  but that's in the future.
  Maybe change the second name to  "_PolygonFromCircle", so that they are together in the menu!

 _PolyhedronToSphere and _PolyhedronFromSphere (instead of _SphereToPolyhedron) need to be spelled out as well.



  There are bugs in the formulas too!!!  The rotatin'pinepolys have y and z switched in the wrong place, so I need to fix that for symmetry.  Lots of stuff to be done before they are complete.  
Logged

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


Fragments of the fractal -like the tip of it


« Reply #89 on: November 21, 2015, 12:12:10 PM »

No hurry at all  A Beer Cup do it good Azn
Logged

No sweat, guardian of wisdom!
Pages: 1 ... 4 5 [6] 7   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
has anybody tried using ifs formulas with the mandelbuld/mandelbox formulas? 3D Fractal Generation cKleinhuis 4 9431 Last post May 05, 2010, 03:17:07 PM
by Power 8
More Formulas? Mandelbulb 3d The Rev 2 3793 Last post November 21, 2010, 11:51:25 PM
by The Rev
Rot Box formulas Mandelbulb 3d The Rev 7 4712 Last post December 21, 2010, 01:37:13 PM
by Power 8
Formulas Mandelbulb 3d scheven_architect 5 5571 Last post April 28, 2011, 05:51:13 PM
by DarkBeam
Using formulas Mandelbulb 3d « 1 2 3 » Martial 43 5530 Last post February 09, 2012, 02:04:00 PM
by Jesse

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