Sunday, January 24, 2010

Realtime fractal raytracing

Hi! I'm back with another video showing a couple of new features.
- Dynamic lighting, now you can adjust the lighting manually as you can see in the video. The shadows are raytraced too so they adjust in realtime.

- Now there's a parameter to set the power (n) of the formula z->z^n+c so you can get different versions of the fractal as showed in the video.

- Frame rate is vastly improved, now all the work is passed to the GPU, including the render plane and ray direction computations.

Some tech data:
- The lighting is a mix of a simple lambert model with a orbit trap that simulates occlusion. Although it's not real occlusion or global illumination, seems to work ok.

- The normal of the surface is computed by central differences.

- The Raymarching is still basically brute force. But with a first step to compute the intersection with a sphere surrounding the fractal.

I'm thinking about putting this tool available for download. I'll add a couple of things and probably next week you can download it from this blog. Hope you like it!! :)

Sunday, January 17, 2010

GPU Raytracer

it's been a long time since the last update, but my neurons were quite busy with Avatar, so programming at home was out of the question. Anyway, I'm back again with something different. Some weeks ago I read that someone had found a nice way to use the famous z->z^n+c formula in 3D to render something like the classic Mandelbrot fractal in three dimensions, you can find more info here: Mandelbulb . So I decided to give it a shot with the gpu and this is what I have, this time with n=8.
Remember that this is not a 3D Texture, or a polygon mesh so it's not the fastest thing in the world, basically for two reasons, my graphic card is not so great and I didn't use a Distance Estimator, so it's pure raymarching and iterating the mandelbrot function every step. Even with that limitations, it runs at interactive rates. I'll work to improve the framerate. Hope you like it!