Logo by Pauldelbrot - 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: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. April 26, 2024, 12:48:31 AM


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]   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: 4D Quaternion Julia Set ray tracing and inverse method  (Read 9477 times)
0 Members and 1 Guest are viewing this topic.
lechoo
Guest
« on: November 13, 2011, 03:46:40 PM »

Hi,
I wrote shader for VRay renderer which renders 4D Quaternion Julia Set. Works flawlessly. I also wanted to give user some preview in viewport using inverse method similar to proposed by John C. Hart. Works too but problem is that it gives slightly different results. When I change first 3 components of quaternion both methods give exactly same result, they stop matching as soon as I change last comoponent, w in my case.

Code:
Quaternion c; //constant
//set c
for (int r=0;r<iNRots;++r)
{
//initial point
q.x = 0.0f;
q.y = sin((rot/iNRots) * PI);
q.z = cos((rot/iNRots) * PI);
q.w = 0.0f;

//now i'm iterating backwards
q1 = sqrt(q - c));
q2 = -sqrt(q - c));
}

Points are drawn using first 3 components of a quaternion. I've tried different aproaches but neither of them works. Ray tracing part of my code is rather ok because my results are consistent with examples I've found on various sites. I hope I gave enough information. I'll apprecitate any help.
« Last Edit: November 13, 2011, 03:51:54 PM by lechoo » Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #1 on: November 14, 2011, 12:41:17 AM »

Why would you use the inverse method ?
The normal distance estimation method on GPU even in plain shader 2 should be at least interactive speed (even on iOS or Android).
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
lechoo
Guest
« Reply #2 on: November 14, 2011, 08:27:01 AM »

It is easier to implement. You do all calculations once (not per viewport) and you don't have to recalculate everyting when user moves camera in 3d scene. Any idea why these methods don't give consistent results?
Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #3 on: November 14, 2011, 10:49:06 AM »

Slice vs projection.
When raytracing you do it in a 3D slice of the 4D quaternion space but in the inverse method you are projecting 4D points onto a 3D space.
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #4 on: November 14, 2011, 10:48:12 PM »

Hmmm - I must be missing something here, obviously "Hart's" inverse method and standard contractive IFS must be completely different animals even though it appears that that's what is used.
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #5 on: November 14, 2011, 10:57:19 PM »

Slice vs projection.
When raytracing you do it in a 3D slice of the 4D quaternion space but in the inverse method you are projecting 4D points onto a 3D space.

If that's correct then it's fairly obvious why it doesn't look the same as viewing 3D slices (the conversion from 4D to 2D is so different that the appearance will definitely vary - one completely ignores a dimension and the other doesn't - since using the inverse method the 4D projection to 3D is then projected to 2D to give the viewport image but using the DE method a dimension is completely ignored and the remaining 3 projected to 2 for the viewport image).
Did I understand that correctly ?
Logged

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

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
knighty
Fractal Iambus
***
Posts: 819


« Reply #6 on: November 15, 2011, 12:03:40 PM »

Yes, exactly. smiley
Logged
lechoo
Guest
« Reply #7 on: November 18, 2011, 04:06:34 AM »

Thanks guys, I think I understand it a little bit smiley Are there other methods that I could use to avoid using ray tracing? I'm looking for solution which isn't view dependant. That's why I choose Hart's method.
Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #8 on: November 18, 2011, 04:38:31 PM »

I strongly recommend this online book which describes rendering methods of julia sets both using sphere tracing and inverse iteration.
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #9 on: November 18, 2011, 09:07:54 PM »

Thanks guys, I think I understand it a little bit smiley Are there other methods that I could use to avoid using ray tracing? I'm looking for solution which isn't view dependant. That's why I choose Hart's method.

Voxel - using DE to decide very quickly if each box needs subdividing - of course just to be sure to use a min DE threshold of say 2.5* to 3* the voxel size at each sub-division level to be sure of not missing anything - compared to doing an old-fashioned voxel method (i.e. not using DE) this should be both fast and accurate and of course voxel gives you a complete model for fast rendering from any direction - provided you use 4D voxels rather than 3D of course 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
lechoo
Guest
« Reply #10 on: November 18, 2011, 10:05:08 PM »

Thanks a lot guys!
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #11 on: November 18, 2011, 10:26:56 PM »

Whoops - missed that other post - a clever algorithm could combine surface tracing with DE to generate voxels *very* quickly indeed - especially good if the fractal to be rendered is guaranteed "connected" 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
lechoo
Guest
« Reply #12 on: November 20, 2011, 02:35:46 PM »

Just implemented it. Woks great!
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Imitations of classical Julia set using Newton's method General Discussion gamma 5 4823 Last post January 29, 2009, 05:05:00 AM
by HPDZ
Julia Set Inverse Iteration... IFS - Iterated Function Systems Chris Thomasson 14 12681 Last post May 20, 2015, 07:32:07 PM
by youhn
Quaternion Julia to flames Fractal Flames cyseal 4 3739 Last post September 25, 2015, 11:48:33 AM
by DarkBeam
Quaternion Julia Lace Gasket Fragmentarium Gallery phtolo 0 1844 Last post March 01, 2016, 08:51:21 PM
by phtolo
New method for rendering Julia sets of rational exponents (no branch cuts) (new) Theories & Research laser blaster 4 1662 Last post January 15, 2017, 09:35:05 AM
by Tglad

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