Sunday, March 21, 2010

Interpolation (and memory leaks)

Am I graduating with a degree in computer science? Are you serious? Because...I just found out I could look at the Task Manager to check for memory leaks in my program. And you know what? It was leaky. And here I thought I was managing memory quite well all this time. I really don't know how I ever got by all those programming classes with good grades...(though being a temp grader has given me a hint). Well, anyway...the point is, this project has taught me a lot about programming practice in general, especially w.r.t. passing by reference, memory management, and getting different open source libraries to play nicely with each other.

Okay, so...interpolation. Progress so far is displayed below. Please note that HyperCam chews up some of my CPU power, so the program runs a bit faster than what is shown (yes, it's slow...but not that slow). The memory leaks aren't as bad as they were before I discovered the Task Manager trick, but there are still some there (I think). So, I still need to track down memory leaks and do more memory clean ups (std::vector's clear() function does not free memory automatically like I thought it did...). Other remaining issues (in addition to the ones mentioned in the previous post):
  • when two key hairs are very far apart (as is the case for the two on either side of the nose), interpolation between them causes blatant hair-head intersections, so I think I should implement a distance check before interpolating adjacent (in terms of growing from the same face) key hairs
  • the convex hull decomposition step tends to yield hulls that lie just under the original head mesh surface; ideally, I would want the collider to completely encompass the original head mesh (i.e. have the red mesh completely surround the tan mesh); I think this would prevent the hair from falling below the scalp and causing bald patches; there are several ways I could go about doing this: (1) after reduction and before decomposition, scale the head mesh so that it is slightly larger than the original (I like this option), or (2) ask the user to provide a scalp that floats a little bit above the head

I should bring my focus back to the rendering side of the project, if I can. You know, those opacity shadow maps... x__x

No comments:

Post a Comment