I had a thought on how to do some basic unit testing to eliminate one possibility for error in my code. Each of the distribution functions I've implemented has never been tested, just copied out of the book (or worked up by myself) and assumed correct. This includes the code to distribute rays from a spotlight. So, I decided to write a quick program that would visualize each of these distribution functions as a way of verifying them (and also a first step towards testing the spotlight code).
Here's some images for each distribution:



I found, by doing this, that there was an error in my equal distribution function. Namely, it was distributing rays in the entire sphere not just the hemisphere. Easy fix. this would results in lots of lost photons and did help brighten the photon simulation which is always good considering how much darker it is than the raytracing version.
Here's the spotlight with different 'outter' values:



This all looks good so I think the spotlight code is correct assuming I've interpreted the parameters correctly.
No Trackbacks/Pingbacks for this post yet...
Info about progress on my Google Summer of Code 2009 project on Advanced Lighting & Shading in CrystalSpace.
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| << < | > >> | |||||
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 | |
If this error persits, please report it to the administrator.
MySQL error!
Table 'evo1_sessions' is marked as crashed and should be repaired(Errno=1194)
Your query: Sessions: get list of relevant users.
SELECT sess_user_ID
FROM evo1_sessions
WHERE sess_lastseen > "2013-05-18 15:34:47"
AND sess_key IS NOT NULL