OpenCL RayTraced Quaternion Julia

offonoll's picture

Hi!

From this site: http://www.gamedev.net/community/forums/topic.asp?topic_id=553643

I went to this other http://www.cs.caltech.edu/~keenan/project_qjulia.html

where I found this http://developer.apple.com/mac/library/samplecode/OpenCL_RayTraced_Quate... Compile the aplication, its a nice OpenCL RayTraced Quaternion Julia-Set.

In Keenan Crane's web site says there is the open GL Code can be ported to any other lenguage.

Is it possible to take the code GLSL in QC?

Don't miss this site eather http://frictionalgames.blogspot.com/2009/11/fractional-fun.html and watch some videos!

cheers!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

toneburst's picture
Re: OpenCL RayTraced Quaternion Julia

Hiya,

I did a GLSL port of Keenan's Julia renderer a while back, in fact. http://machinesdontcare.wordpress.com/2008/05/01/quaternion-julia/

I'll share the QTZ if you're interested.

a|x

psonice's picture
Re: OpenCL RayTraced Quaternion Julia

I've seen the quarternion julia raytraced in glsl before, so yes (check out IQ's blog: http://www.iquilezles.org/www/articles/juliasets3d/juliasets3d.htm ).

But anyway, how about we get the mandelbulb running in QC instead? IQ made a not-realtime-but-interactive-speed version, another guy has done it with voxels in realtime:

http://www.icare3d.org/blog_techno/gpu/gigabroccoli_the_mandelbulb_into_...

offonoll's picture
Re: OpenCL RayTraced Quaternion Julia

Sure I am interested! :D

How come the apple app is in real time and in QC isn't?

offonoll's picture
Re: OpenCL RayTraced Quaternion Julia

The last link @ the first post you can find a mandelbulb app http://unbirthgame.com/MathFuncRenderer-Mac.zip but it requires OpenAL 'Audio open cl' http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx I found broken package so I can't use it, if some one can use it, let me know!!

Thank's!

psonice's picture
Re: OpenCL RayTraced Quaternion Julia

Yeah, it's extremely low quality though judging by the video. And it's slow in higher quality. Besides, how do we apply our own effect chains to it? :)

toneburst's picture
Re: OpenCL RayTraced Quaternion Julia

Here you go. It's not very fast though...

a|x

PreviewAttachmentSize
QuaterionJuliaSet GLSL 0.0.qtz50.07 KB

psonice's picture
Re: OpenCL RayTraced Quaternion Julia

Great stuff! Runs pretty realtime here too, so long as the window's not too big. No major slowdown with shadows too :)

It's lacking a way to rotate the object though - any ideas? :)

cybero's picture
Re: OpenCL RayTraced Quaternion Julia

Yeah, it stubbornly resists any Trackball manipulation for a start of, the only means of rotation is through the orbit axis and in effect all else is like a 2D canvas, with which one can produce interactive results , x, y position.

vade's picture
Re: OpenCL RayTraced Quaternion Julia

if you could get the modelview matrix and pass that in somehow you could get it to 'obey' the trackball patch.

toneburst's picture
Re: OpenCL RayTraced Quaternion Julia

Ah.. I think this might be an early version. It took me ages to work out how to rotate the thing. I eventually did it by creating my own custom rotation matrix in JavaScript, then passing that in as 4x vec4s (or 16 floats). I will try and find the later version later today. Having said that, isn't there a Kineme GL Tools patch to fetch the gl_ModelViewMatrix? Or I might be imagining it...

Either way, you still need to pass a 4x4 rotation matrix into the GLSL shader to rotate the texture coords and camera position in the Vertex Shader.

a|x

offonoll's picture
Re: OpenCL RayTraced Quaternion Julia

You need to change the splitter 360 to 1, a full rotation range is from 0 to 1. :D

toneburst's picture
Re: OpenCL RayTraced Quaternion Julia

You're right about the ranges there. There's something definitely weird about the rotation, though. I've just had a look at it, and there's definitely something not right there. It actually looks quite interesting, having said that. It kinda turns itself inside-out as you rotate it.

I think I failed to notice before, because on my old laptop, it was taking several seconds to render each frame, so I didn't really get a feel for how the controls worked at the time.

I'll have to have another look when I get a chance (don't have time right now, sadly).

a|x

toneburst's picture
Re: OpenCL RayTraced Quaternion Julia

That's because the actual geometry that the the Julia set is rendered into is a simple 2D GLSL Grid. To rotate the set, you have to manipulate the texture coordinates in the GLSL Vertex Shader.

a|x