The fun stuff has started now!
Here’s my first RayTracing attempt, this was to see if I could pick out the primitives with the rays I’m casting. It came out as a outline of them all. There is a plane running along the ground in the bottom half, two spheres popping out, and a light in the sky (there’s another light somewhere else too, but it can’t be seen from this angle).
Next I updated this so that instead of using “white” it uses the primitives’ material colour.
Alright, getting somewhere now! But, they’re still just outlines at the moment, this needs some diffuse lighting.
Something didn’t quite go right there. It should have been a smooth gradient transition, instead there are two extreme colours here, white and black. I tried scaling the colour values down a bit.
YES! Now this is more like it! This is looking a bit boring though, all grey? Let’s add a little bit more colour.
Awesome.
I’m happy with my progress with this, but I think I need to go back and modify the diffuse lighting calculations as I’m not entirely sure the lighting is exactly as it should be. That’s for another day though.
If anyone is interested in doing a similar project, my current source of information for this project is an article on DevMaster.Net by Jacco Bikker. I’m personally trying to use as little source code from his examples as possible and focus on just the theory, but it is there for anyone who does want to examine it. I did more or less copy the scene that he is using though so I could compare my results.
-Thomas




