Fractal with ICE - WIP

Discussions about SOFTIMAGEs© Interactive Creative Environment©
User avatar
gustavoeb
Moderator
Posts: 587
Joined: 21 Jul 2010, 00:33
Skype: gustavoboehs

Re: Fractal with ICE - WIP

Post by gustavoeb » 17 Oct 2012, 14:58

Veeery intersting indeed Daniel! Good job!
Looking forward to see what else you can come up with
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Fractal with ICE - WIP

Post by Daniel Brassard » 22 Oct 2012, 19:13

OK, here is my first request to AD Dev:

Can you build some factory ICE nodes that would give access to the C++ standard library of complex numbers such as:
  • ICE node complex number real x + imaginary y as input, complex number x + yi as output
    ICE node complex constant real a + imaginary b, scalar input, a + bi as output
    ICE node complex that give you access to the real and imaginary part of the complex number as output
    ICE node abs that return the absolute value of complex (like vector length)
    ICE node arg that return the phase angle of complex (like vector angle/direction)
    ICE node norm that return the squared magnitude, defined as the addition of the square of both the real part and the imaginary part (without the imaginary unit).
    ICE node conj that return the complex conjugate i.e x - yi
    ICE node polar that return complex from polar components
    ICE node functions: cos, cosh, sin, sinh, tan, tanh, exp, log, log10, pow, sqrt all working on the complex number (or modify the existing one to work with complex number)
    ICE node operators for complex numbers (add, subtract, multiply, divide, etc.)
That would be sweet!

Dan
Last edited by Daniel Brassard on 22 Oct 2012, 20:22, edited 2 times in total.
$ifndef "Softimage"
set "Softimage" "true"
$endif

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: Fractal with ICE - WIP

Post by Bullit » 22 Oct 2012, 19:27

What about we make here a thread like Chris Chia bug/improvement thread in xsibase - don't remember the title of it - putting requests like this all over place no one caches it.

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Fractal with ICE - WIP

Post by Daniel Brassard » 22 Oct 2012, 20:20

That would be a good idea Bullit, so that we have a proper thread to track these enhancement requests. I don't know if Chris Chia is a member of this forum but I am willing to contribute. I will also go on subscription and sent the above request directly!

P.S. I have sent an enhancement request to AD. The priority may be very low, but I made the effort.

Cheers!
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Fractal with ICE - WIP

Post by Hirazi Blue » 22 Oct 2012, 20:44

In theory a bug thread is a good idea. I would however advise against one single thread in favor of a couple of threads, each for the relevant subforum (Modeling, Animation... etc.). Making them all "stickies" (which I'd be willing to do) should help with their general accessibility, while separating them per topic should make them more understandable, clear and manageable by all.

As to the membership status of mr. Chris Chia: he isn't a member yet. But if you feel you need a bug thread, I wouldn't wait for his membership... I have personally invited him to join here twice. He hasn't.
Stay safe, sane & healthy!

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Fractal with ICE - WIP

Post by grahamef » 22 Oct 2012, 22:32

Daniel Brassard wrote:OK, here is my first request to AD Dev:

Can you build some factory ICE nodes that would give access to the C++ standard library of complex numbers such as:
  • ICE node complex number real x + imaginary y as input, complex number x + yi as output
    ICE node complex constant real a + imaginary b, scalar input, a + bi as output
    ICE node complex that give you access to the real and imaginary part of the complex number as output
    ICE node abs that return the absolute value of complex (like vector length)
    ICE node arg that return the phase angle of complex (like vector angle/direction)
    ICE node norm that return the squared magnitude, defined as the addition of the square of both the real part and the imaginary part (without the imaginary unit).
    ICE node conj that return the complex conjugate i.e x - yi
    ICE node polar that return complex from polar components
    ICE node functions: cos, cosh, sin, sinh, tan, tanh, exp, log, log10, pow, sqrt all working on the complex number (or modify the existing one to work with complex number)
    ICE node operators for complex numbers (add, subtract, multiply, divide, etc.)
That would be sweet!

Dan
You could use quaternions (well, except for cos, cosh, etc.), which are essentially an extension of complex numbers and just leave j and k at 0. I believe that ICE uses W for the real part and X for i, but it doesn't really matter as long as two of the XYZ values are 0. Things like the conjugate would be fairly simple compounds.

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Fractal with ICE - WIP

Post by Daniel Brassard » 22 Oct 2012, 23:02

You could use quaternions (well, except for cos, cosh, etc.), which are essentially an extension of complex numbers and just leave j and k at 0. I believe that ICE uses W for the real part and X for i, but it doesn't really matter as long as two of the XYZ values are 0. Things like the conjugate would be fairly simple compounds.
Thanks for the hint Graham. I'll investigate this as well. :-bd

Dan
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Fractal with ICE - WIP

Post by Daniel Brassard » 17 Dec 2012, 05:44

A little experiment in fractal visualization using 4 reflective mirror balls arranged in tetrahedral configuration.
Attachments
Mirror_Balls.jpg
$ifndef "Softimage"
set "Softimage" "true"
$endif

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Fractal with ICE - WIP

Post by Daniel Brassard » 17 Dec 2012, 05:50

Well, I hit a snag with the Mandelbrot Set. I can generate up to 19 iterations, but at 20 iterations i get this message:

Cannot allocate xxxxxxx bytes of continuous memory. XSI may become unstable from now on.

Then XSI just crash.

I tried many things to optimize the ICETree but I can't find a way to get around that message. Well maybe someone can help. I attached the scene file if somebody care to test.

Some helpful tips is greatly appreciated. I am using Softimage 2013.

Dan
Attachments
Mandelbrot_19.jpg
Fractal_Mandelbrot5.zip
(129 KiB) Downloaded 124 times
$ifndef "Softimage"
set "Softimage" "true"
$endif

Chris_TC
Posts: 411
Joined: 22 Mar 2010, 17:43

Re: Fractal with ICE - WIP

Post by Chris_TC » 17 Dec 2012, 17:33

With your default settings, 20 iterations worked, as did 30 (RAM consumption only about 500 MB). But at 30 iterations I then doubled the X subdivisions to 8, and that made the scene crash after a while.

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Fractal with ICE - WIP

Post by Daniel Brassard » 17 Dec 2012, 18:55

Thanks Chris_TC for the test.

With my old machine, I can't pass 500MB so crash more often than you. Even when I change the setting from 19 iteration to 10 iterations, you would think it's less work, the machine would not crash, but it does!

My new machine in the other hand will be a beast (Asus P9X79 / 32 MB Ram / I7 Quad Core 3820). Just have to choose the right Graphic card for the job.

Well, back to the drawing board, may have to code that one. I wonder if I could do the Mandelbrot via script and feed the PointCloud with the color attribute .....
$ifndef "Softimage"
set "Softimage" "true"
$endif

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Fractal with ICE - WIP

Post by grahamef » 17 Dec 2012, 23:22

I think the problem is that you are using a While loop inside a Repeat loop. In fact the outer loop looks fishy to me -- why do you need to loop by the size of the ParticlePosition array?

I'm attaching a simplified example. Not sure how high you can go before it breaks.

EDIT: So far I've done a 1000x1000 grid with 5000 iterations with a bunch of other apps open. It gets slow but doesn't seem to require more memory with increased iterations.
Attachments
Mandelbrot_gf.zip
(111.16 KiB) Downloaded 100 times
mandelbrot_gf.png

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Fractal with ICE - WIP

Post by Daniel Brassard » 18 Dec 2012, 03:58

Hi Grahamef,

Thank you for taking the time to look at my ICETree.
In fact the outer loop looks fishy to me -- why do you need to loop by the size of the ParticlePosition array?
The size of the ParticlePosition array is used to determine how many particle position I have.

Each particle position give me the x and y position that I need to feed the mandelbrot algorithm with.

I use the ParticlePosition to cycle each particle for the while loop. Maybe I don't need to do that.

I will look at your solution obviously as it does not crash like mine. Always learning some tricks with ICE.
$ifndef "Softimage"
set "Softimage" "true"
$endif

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Fractal with ICE - WIP

Post by grahamef » 18 Dec 2012, 16:32

I let it run overnight with 100000 iterations. Starting to see some nice fractal effects at the edges, but losing the gradient -- I might try running the value through a power function before look-up.
mandelbrot_gf_100000iter.png

grahamef
Posts: 281
Joined: 23 Jun 2009, 21:01

Re: Fractal with ICE - WIP

Post by grahamef » 18 Dec 2012, 16:46

Daniel Brassard wrote:
Each particle position give me the x and y position that I need to feed the mandelbrot algorithm with.

I use the ParticlePosition to cycle each particle for the while loop. Maybe I don't need to do that.
Doing it one particle at a time is the problem. Do them all at once (which you can't do with an object array, you need a per-component set of values) and let ICE chop them up into buckets for multi-threading.

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Fractal with ICE - WIP

Post by Daniel Brassard » 18 Dec 2012, 22:28

Do them all at once (which you can't do with an object array, you need a per-component set of values) and let ICE chop them up into buckets for multi-threading.
Interesting, almost a new thread that need to be opened to show that trick in action.

Maybe you can provide a simple example of this (this part of the ICE workflow is still a bit hard for me to grasp)
$ifndef "Softimage"
set "Softimage" "true"
$endif

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests