Sunday, March 21, 2010

Plugging in Bullet (Step 2)

Goal: Add the ability to render the Bullet soft body key hairs as lines
Check. Some issues that still need to be cleared up:
  • For heavy hairs, the contact jittering gets really bad (you can see it when I zoom in). I've tried messing with all sorts of soft body parameters, but no dice. The only thing that guarantees less "wigging out" is a lighter mass. I'll poke around in the Bullet forums to see what the Bullet equivalent of "skin thickness" is. Unfortunately, light hairs don't have the kind of motion I'm looking for (they look like they're moving around in water). On the other hand, since this is all still on the CPU, the simulation is moving really slow to begin with...so I think I'll leave the parameter tuning for later on when I've (hopefully) found a way to bring the simulation rate up.
  • When I rotate the collider to test the simulation, things get a little crazy. Heavy hairs pull on the collider more (i.e. influence its inertia), so unless the collider-to-hair mass ratio is very high, the collider will oscillate around wildly. I thought I had bumped this ratio up enough (see the videos of my Bullet tests) to get rid of oscillations, but perhaps I tweaking parameters messed things up. If I can somehow set the position/orientation of the collider at each frame without continuity issues, then maybe this issue would go away.
The GUI could use the following additions (though these aren't necessary, so I'll hold off on sticking them in for now):
  • an output line that gives the user feedback (error messages or status messages other than the ones associated with bad file parsing)
  • memory freeing (I'm being sloppy with it at the moment)
  • a loading bar for importing head meshes (because the convex hull decomposition step can take a while)
  • automatic scaling to accommodate input meshes of different sizes (this would include grid size, camera movement increments, light position, control node size, and key hair parameters)
  • interactive control over the control node (the ability to choose between playing KF data or entering an interactive mode that lets you move the control node with keyboard input)
Next step: draw interpolated hairs (as lines) between the key hairs. The problem with this is the fact that the key hairs could be moving at every frame. As a result, it's a waste of time/memory to store a collection of interpolated hairs, since I'd have to go through and update the collection at each simulation step. The fastest approach would be to interpolate and draw all in one pass. I'll give that idea a go and let you know how it plays out.

No comments:

Post a Comment