Archived

This topic is now archived and is closed to further replies.

NotTaxes

Is there a fast way to do biology?

Recommended Posts

I''m trying to create an amoeba-ish creature... actually, more like a cross between an amoeba and a starfish. The tricky bit is animating it. I can do it as a completely pre-rendered animated mesh, but I''d much rather have it move and more realistically interract with the environment so... What I''ve done so far is I have about 500 point sprites that make up the body. Each one is told that it can move a set distance away from it''s neigbour, after which point it is ''forced'' to move closer to its neighbour. Each sprite is then moved according to normal physics laws (gravity, slopes, acceleration etc). If I move the center sprite (the head of the beast?), all of the other ones move according to their own laws and neighbour rules. This creates a really nice effect, and if you squint your eyes a bit you can almost imagine that the thing is a blobby bag of fluid moving over the terrain. The trouble is that as you rotate the camera, the sprites start to get drawn over each-other (''coz you have to disable the z-buffer to get ps to work?) and at high-speed the whole thing starts to seperate out, allowing you to see the gaps between the sprites, which is just ugly. Ideally I''d like to switch from point-sprites to connected polygons, making the whole thing look a lot more reallistic (''coz it''d be a skinned blob). The problem being just plain speed. I can draw the 500 point sprites and my FPS drops by about 1. If I switch to polygons and draw with drawprimitive, my fps drops by around 30 (''coz it''s drawprimitive and ''coz the number of poly''s required is around 2500). I understand that bit about using skeletal animation, but this thing just doesn''t have a skeleton... Obviously if I use a VB then the performance is much better but... the VB isn''t easilly open to modification. I guess I''m just fishing here, but does anyone have any ideas on how to make this thing work at high-speed? Is there not, perhaps, a DX command like D3d8DrawFluidBlob ? ''Doing the impossible is kind of fun'' - Walt Disney

Share this post


Link to post
Share on other sites
Consider using vertex shaders. even if you don''t have DX8 class hardware, the software implementations are pretty fast. Look at the shader based skinned mesh examples. I''m thinking you could have several matrices that are driven by the physics you describe and then fed to the vertex shader, affecting different parts of the mesh with different "weights".

Consider a starfish-like beastie. You could have one matrix for the head and one for each arm. The values of the matrix are derived you your physics model and sent to the shader. Follow the SDK examples for more...

Share this post


Link to post
Share on other sites