Saturday, April 30, 2011

Joy (and Lament) of Computer Graphics

Some of my vanilla Computer Science friends took classes in computer graphics this semester. Their reaction to the experience was enjoyable:

"I could see what I was doing on the screen!"

"People who didn't know what I was doing were impressed!"

"I wrote it and then it was there!"

I think this is one of the real joys of doing computer graphics; a deep satisfaction is seeing something (almost) tangible as a result of your efforts, and the instant appeal of great results.

I think this is closely tied to some of the greatest challenges in your computer science: the difficulty of installing automated and repeatable tests in code, and in verifying that large amounts of numerical data are correct. It's very hard to assert specific facts about a graphics system in test code. For example, suppose you want to assert that some particular aliasing artifact doesn't appear. How would you without human eyeballs? Image differences? Machine learning/computer vision (recognize the bad patterns)? Spectral analysis (make sure some frequencies don't show up?)

Similarly, it is much harder to verify the results of a large numerical computation than of a small logical one. Not only are the answers "fuzzier", there many, many, more of them. If you are lucky (as with matrix arithmetic) you could assert some large property about the numbers as a whole (maybe the matrix has a certain rank). If you are also lucky, maybe you could assert some point-wise fact (they are all positive). For anything in between, it's very difficult. Often, as anyone who has spent alot of time in Matlab knows, the best answer is plotting the data. This helps with the here-and-now, but doesn't solve the automated and persistent problem.

I'm not sure what a good solution to this is, if there is one.

No comments:

Post a Comment