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!

6 comments:

Ruben Penalva said...

Nice work. :) IMHO, If you feel comfortable using glsl, you dont want to bother changing to another tech, you want to focus on the algorithms and you are not going to do any big "professional" work I would keep using it. That being said, if I were you I would also give a try to CUDA, OpenCL, sse, openmp and multithreading, just for the sake of fun.

One of the funny things of glsl is that the ati compiler is (or was, at the moment) "more standard" than the nvidia one. So, if you want to be sure that you are under the glsl standard make sure it compiles on the ati compiler! :)

Diego F. Goberna said...

Great!! Raytracers will rule the world!

I see it preety fast, why don't you try to do Ambient Occlussion? It's preety straightforward, and maybe with not many samples it will be still realtime :)

great stuff! it seems you have free time after work, that's always nice :)

El Tony said...

Hi Ruben!
Thanks, yep, I'm thinking about giving a try to CUDA or OpenCL, but I don't know... Id' really wish to learn just ONE language! Openmp is nice, I'll try it for the cpu renderer. The problem with the ATI drivers is they simply fail sometimes with very simple stuff, like float kk[9] works and float kk[10] doesn't work. I've read they have some kind of problem with memory allocation of arrays... I didn't want to believe it but there are many people with the same problem.

Hey Diego! thanks man, yes, I'll do ambient occlusion, in fact, it's already done as well as the soft shadows with area lights. I'll post another video when I optimize it a little bit. :)

Aearon said...

Jaja Tony, ya estas preparando la demo? flipante las cosas que pones :-D

has pensado usar optix de nvidia?
http://www.nvidia.com/object/optix.html

A ver si nos juntamos en Londres!!

iker said...

¡Hey, un Tony haciendo render en tiempo real! Mola :-)

¡Hey, un Rubén y un Kai! Mola :-)

¡Hey, un Iker que se va a Londres a currar! Mola :-)

A Diary of a Painter said...

mola tony mola muchooooooooooooooooooooooooooooooooooo!!!

Eres un crack ,

Lauren ;)