Title: 2d ray traced julia Post by: lycium on February 28, 2007, 02:49:46 AM i resurrected some old code i had lying around (based on an article i wrote long ago: http://mysticgd.com/thomas/lycium.cfxweb.net/2dgi.html) and rendered this with it:
(http://www.fractographer.com/images/specular_julia.png) Title: Re: 2d ray traced julia Post by: cKleinhuis on February 28, 2007, 12:57:59 PM way cool :)
the caustics look really amazing ;) how long does it take to render? have you tried to implement refraction also ? Title: Re: 2d ray traced julia Post by: lycium on February 28, 2007, 01:07:48 PM thanks, i have indeed implemented refraction and although the result wasn't correct, it did look neat :) the next implementation of refraction will be wavelength-based.
a friend of mine, exceptionally good programmer, is helping me write a little opensource sampling framework so that i can efficiently render such images (or anything that can be sampled in 2d, for example your own fractals). it's a progressive (non-terminating) rendering technique based on metropolis-hastings sampling. i'll write the cpu-based code and he's writing a hardware-accelerated implementation. Title: Re: 2d ray traced julia Post by: cKleinhuis on February 28, 2007, 01:17:17 PM this would make indeed a nice post processing step ;)
when talking about 2d rendering would it be possible to give the points a height value ? this would complicate the rendering process even more ;( Title: Re: 2d ray traced julia Post by: lycium on February 28, 2007, 01:24:54 PM any 2d sampling procedure can be used. i give (x,y) and you give me a colour, that's it! all the magic is inside the black-box sampling method.
i plan to 3d ray trace using this framework eventually; (x,y) -> ray -> intersecion -> colour. the ray tracing will of course be 3d fractals... this is only the tip of the iceberg ;) Title: Re: 2d ray traced julia Post by: gandreas on February 28, 2007, 05:26:58 PM Interesting. Definitely got lots of potential!
The article you mentioned refers to taking the normal to object. However, the generalized Julia set doesn't have a normal (it's "infinitely rough", except for a few degenerate cases) - so you do you just cheat and pick an arbitrary depth of evaluation? Title: Re: 2d ray traced julia Post by: lycium on February 28, 2007, 05:40:00 PM Interesting. Definitely got lots of potential! interesting that you mention potentials; the normal is just the gradient of a (julia) potential field. it's true that fractals have very poorly defined normals, even when formulated as implicit objects via a potential field. i've found that using more than 9 or 10 iterations, depending on resolution, really stresses all those sampling methods; the reason i used a particularly smooth surface approximation here is because it makes those nice specular reflection caustics :) Title: Re: 2d ray traced julia Post by: lycium on February 28, 2007, 06:01:50 PM another, bigger&better render: http://www.fractographer.com/images/specular_julia_newbig.png
Title: Re: 2d ray traced julia Post by: David Makin on February 28, 2007, 06:14:31 PM Interesting. Definitely got lots of potential! interesting that you mention potentials; the normal is just the gradient of a (julia) potential field. it's true that fractals have very poorly defined normals, even when formulated as implicit objects via a potential field. i've found that using more than 9 or 10 iterations, depending on resolution, really stresses all those sampling methods; the reason i used a particularly smooth surface approximation here is because it makes those nice specular reflection caustics :) You may find that using the smooth distance estimator method produces nicer results than using smooth iteration/potential (it's certainly more optimum for ray-tracing 3D fractals). Title: Re: 2d ray traced julia Post by: lycium on February 28, 2007, 06:35:43 PM i'm actually just following the 8 iterations and working with the magnitude of that last z value; with few iterations it's plenty smooth.
anyway, this 2d ray tracing stuff is just a momentary hack to test the new sampling engine. with that thing i'll ray trace 3d fractals, also with full+exact global illumination ;) Title: Re: 2d ray traced julia Post by: gandreas on February 28, 2007, 09:06:38 PM I'd suggest that you stick with 2D for a while here because fractals are not "well defined" in 3D (2D via complex numbers yes, 4D via quaternions yes, but 3D, not so much since there is no "triternions"), and there are a number of things which attempt to do 3D raytracing (after coming up with some way to produce a 3rd dimension).
On the other hand, 2D stuff is well defined and very rich (giving you lots to start from), and your raytracing appears to offer something new and exciting (I'm curious what something that was more "holes" like a Newton fractal would look like, and do you still get caustics with the more convex Mandelbrot set) Title: Re: 2d ray traced julia Post by: lycium on February 28, 2007, 09:12:09 PM i've done plenty of 3d fractals :) frankly i can't wait to see them all with area lights, glossy surfaces and rendered to exact physical accuracy!
there will always be a special place for 2d graphics (fractal or otherwise) in my heart, and this sampling engine will be great for rendering those. the future calls, however... it's 2007 and high time i ray traced some real 3d fractals :) Title: Re: 2d ray traced julia Post by: gandreas on February 28, 2007, 09:22:55 PM Kids these days and their "glossy surfaces". I remember back when all we has was black and white, and if you wanted gray, you had to blink fast! And we liked it that way!
(Seriously, I remember writing software that, during the VBL interrupt, would change the graphics page to get more depth - two frames from one, one frame from the other, and instant head-ache inducing grayscale) Title: Re: 2d ray traced julia Post by: lycium on February 28, 2007, 09:47:27 PM this is getting to be a huge aside, but since i haven't got an introduction in that section of the forum.... ;)
surprisingly (for a not-such-a-kid-anymore this day) i've done my fair share of to-the-metal coding, and still know some binary x86 opcodes for 32bit instructions cuz my basic compiler only supported 286 inline asm (0x66 for 32bit prefix, 0xf3 for rep, 0xab or 0xa5 for one of stosd or movsd)! i've written fast gouraud-shaded triangle fillers for little mode 13h 3d engines, done many demoscene effects, and that was all nice and dandy until... ... i learnt about ray tracing and monte carlo methods ;) seriously, there's been realistic ray tracing since way back (kajiya's rendering equation dates to 1986, cook and porter did distributed ray tracing before that even) and that's more or less when i was born, so it's entirely fair that i get to pursue the 1995 state-of-the-art in 2007 :P [realistic rendering is a great way to appreciate good maths, btw! that in itself makes it worthwhile, and it's a rare instance where mathematics is plainly appreciable - all the images in this thread are purely equation-driven] Title: Re: 2d ray traced julia Post by: Nahee_Enterprises on March 01, 2007, 03:06:53 AM Glenn Andreas (gandreas) wrote:
> > I'd suggest that you stick with 2D for a while here because > fractals are not "well defined" in 3D (2D via complex numbers yes, > 4D via quaternions yes, but 3D, not so much since there is no "triternions").... That's interesting about "there is no 'triternions'". ;) You may wish to tell Russell Walsmith, Paul Bourke, and a few other individuals that have been creating these using some formulas written to run under FractInt: http://local.wasp.uwa.edu.au/~pbourke/fractals/triternion/ (http://local.wasp.uwa.edu.au/~pbourke/fractals/triternion/) http://www.miscoranda.com/106 (http://www.miscoranda.com/106) http://ixitol.com/html/triternions.html (http://ixitol.com/html/triternions.html) http://ixitol.com/Triternions.pdf (http://ixitol.com/Triternions.pdf) http://www.research.att.com/~njas/sequences/A112259 (http://www.research.att.com/~njas/sequences/A112259) http://home.att.net/~Fractals_3/FotD_06-10-07.html (http://home.att.net/~Fractals_3/FotD_06-10-07.html) http://home.att.net/~Fractals_2/FotD_02-12-10.html (http://home.att.net/~Fractals_2/FotD_02-12-10.html) http://www.mathsong.com/casaraku/pages/022/20051108.htm (http://www.mathsong.com/casaraku/pages/022/20051108.htm) Title: Re: 2d ray traced julia Post by: lycium on March 01, 2007, 06:30:54 PM younger viewers may need to avert their eyes for this zoomed-in view of some caustics...
(http://www.fractographer.com/wip/boob_caustics.png) i added a little blue light inside the julia, just for fun; it's vey difficult to render without direct light computation, but metropolis-hastings works like a charm! :D Title: Re: 2d ray traced julia Post by: gandreas on March 01, 2007, 09:01:27 PM I believe that the key phrase from the PDF is "This novel approach to 3-space may
eventually prove to be as fertile as are complex numbers in the plane." but since the "T set" is basically just an extruded M set, I don't see that it would be worth the effort to build a fractal renderer based on it at this time (when you can just pick 3 of the 4 axes of a quaternion and get much more interesting results, or even rendering 3D height maps of 2D fractals). It's one possible way to provide a group on R3, but by no means the only one (in their example, it's all about transposition from the generating symmetry group C6, as opposed to being based on axes - a quick perusal of http://en.wikipedia.org/wiki/Hypercomplex_number (http://en.wikipedia.org/wiki/Hypercomplex_number) shows all sorts of concepts). At the very least, it seems a bit of a misnomer to call them triternions, since they've got very little in common with quaternions (complex numbers are a subset of quaternions which in turn are a subset of octernions, but complex numbers are not a subset of triternions, nor are triternions a subset of quaternions - and at this point I really wish everything was unicode compliant so I could just type real "blackboard" characters and other math operators). Perhaps we ought to take this to a different thread... Title: Re: 2d ray traced julia Post by: cKleinhuis on March 01, 2007, 09:53:03 PM Quote At the very least, it seems a bit of a misnomer to call them triternions, since they've got very little in common with quaternions (complex numbers are a subset of quaternions which in turn are a subset of octernions, but complex numbers are not a subset of triternions, nor are triternions a subset of quaternions - and at this point I really wish everything was unicode compliant so I could just type real "blackboard" characters and other math operators). ehrm, i like the other way round even more, real numbers are subsets of complex numbers ;) Title: Re: 2d ray traced julia Post by: Nahee_Enterprises on March 02, 2007, 04:45:11 AM Thomas Ludwig (lycium) wrote:
> > i added a little blue light inside the julia, just for fun; The added color was a nice touch to the image!! :) Title: Re: 2d ray traced julia Post by: lycium on March 02, 2007, 02:25:48 PM complex numbers are a subset of quaternions which in turn are a subset of octernions R, C, H and O are the only (real) normed algebras (http://mathworld.wolfram.com/RealNormedAlgebra.html), but is H really a subset of O? Title: Re: 2d ray traced julia Post by: gandreas on March 02, 2007, 04:55:44 PM R, C, H and O are the only (real) normed algebras (http://mathworld.wolfram.com/RealNormedAlgebra.html), but is H really a subset of O? O can be viewed as H^2 (just like H can be viewed as C^2), and if you have quaternion (A,B,C,D), it is equivalent to octonion (A,B,C,D, 0,0,0,0) And while octonions are non-associative, octonions of the form (A,B,C,D, 0,0,0,0) are associative (just like quaternions). You can take it one step further with Sedenions http://www.geocities.com/zerodivisor/ (http://www.geocities.com/zerodivisor/), but at that point, all that you've got left is power associativity... (and it isn't a normed algebra, because there are zero divisors, i.e., there are sedenions S and T such that S != 0 and T != 0, but S x T = 0 (so |S| x |T| != |S x T|) Similarly, complex ({a + bi}, where i*i = -1) and dual numbers ({a + be}, where e*e = 0, e != 0) are both subsets of complex duals ({{a + bi} + {c + di}e}) (complex (A,B) is complex dual (A,B,0,0) and dual number (A,B) is complex dual (A,0,B,0) - see "Dual Polynomials and Complex Dual Numbers for Analysis of Spatial Mechanisms" in "Proceedings of 1996 ASME Design Engineering Technical Conference and Computers in Engineering Conference") Title: Re: 2d ray traced julia Post by: lycium on March 09, 2007, 04:38:48 AM produced while messing around with negative reflection and boolean object combiners...
(http://fractographer.com/wip/negative_reflection_2d_sierpinski_circlecut.png) Title: Re: 2d ray traced julia Post by: bradorpoints on April 26, 2007, 06:23:18 AM fantasitc image! |