Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2007-04-09 00:28:17

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

ray tracing quaternion fractals

i made a thread a while ago, on work i did with ray tracing Quaternion Julia Sets

ive recently been learning how to write vertex and fragment shaders for more advanced rendering capabilities, like per pixel lighting and bump mapping etc, so i decided to re-write a quaternion julia set ray tracer, but usitilising a fragment shader to performt the ray tracing on the GPU instead of the CPU

Here are 3 renderings ive made from it, a singe point light given off diffuse and specular highlights, with self shadowing on the julia set

in my old CPU based app. it took about 5 minutes to render a small image. these take about 3 seconds to render.


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#2 2007-04-09 00:32:56

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

Re: ray tracing quaternion fractals

basicly, the OpenGL side of it, is it renders a single quad to the screen.

then the vertex shader gives for each corner, the ray origin and direction, which are interpolated automaticly by opengl accross the quad to the fragment shader, which using the ray origin and direction, does the ray tracing for each pixel of the quad that is covering the screen, basicly, its a procedural texture, like if you wrote a fragment shader to give a marble texture to a triangle, or a checkerboard texture, or a perlin noise procedural texture, this is a julia set quaternion ray traced procedural texture being applied to a quad if you will tongue


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

#3 2007-04-09 10:43:57

MathsIsFun
Administrator
Registered: 2005-01-21
Posts: 7,713

Re: ray tracing quaternion fractals

That is ... impressive!

From 5 minutes to 3 seconds is like a miracle.

And they look good enough to eat.


"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

#4 2007-04-09 10:47:56

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

Re: ray tracing quaternion fractals

the middle one does kind of remind me of the mess you can get when pulling chewing gum that is stuck to something


The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

Board footer

Powered by FluxBB