Tuesday, July 19, 2011

Writing a ray tracer

I have written earlier about the simple rasterizer I wrote some time ago. Well, I have been feeling somewhat more adventurous of late, and I decided to write a ray tracer. The good news is that it is mostly working. The bad news is that making pretty pictures is more work than fun and messing around with the internals is lots more fun, so nothing worth posting here as yet.

Things I learnt,

a) You might need to link with -lgomp with gcc, in addition to -fopenmp, if your code was initially compiled with -c option.

b) Parallelizing code can make you clear up your understanding of your own code by a lot.

c) OpenMP rocks. But GPUs rock even more.

It needs some secondary rays goodness and some more work for it's acceleration structure. I think I'll do the latter first.

No comments: