Monday, October 18, 2010

CPU - DEM Simulation


This is my first attempt for a CPU based DEM (discreet elements method) simulator ( more info here: )

It's based on a Nvidia demo I saw running with the GPU, It was really cool, so I tried to do the same but with the CPU and multithreaded. Of course is not so fast as the GPU version, but it´s not too bad. 100000 particles - 18 fps.
Note that the drawing is not optimized at all, so it´s much slower when I draw spheres. Probably it could be used for a sand simulation or something like that. I made tests at around 1fps with one million particles. I'm now writing a plugin for Houdini.

Wednesday, February 17, 2010

Realtime Raytracer

Hi, I wrote a very simple GLSL raytracer. Just spheres, ground and sky, with refraction and reflection. Not too much to explain, you can control de number of bounces, the IOR (index of refraction), the light direction and that's all!
I'm thinking about extending it to triangle meshes (I hate triangles...), global illumination and all the real good stuff, so... no more realtime :D And GLSL with my ATI is giving me some really stupid problems with arrays, so I'm not sure if GLSL is the way to go for a bigger project...
Anyway, hope you like it!

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!