It's hip to be square

posted in Perpetual Alpha
Published July 06, 2008
Advertisement
So, I have had this idea bumming about for a while. Mostly involving using some of the really nice fluid simulation stuff here, especially the super-viscous fluids stuff to make some nice deformable terrain. And the game as of now should be some kind of platformer, so I think for the sake of making things easy I'm going to tie everything down to a 2d plane.

Before I start messing with navier-stokes and other brain melters, I want to get the rendering out of the way. Enter marching cubes, but since this is going to be tied to a plane, reduce it down to marching squares.

This is the first time I've done anything involving dynamic vertex buffers. So I'm not really sure how I should be courting them. Right now I'm generating the vertex data in an array in RAM and then memcpying it to the locked vertex buffer. Its working grand atm, but I want to look into if it's better to keep the buffer locked for a longer period of time and not have that memcpy. Or hell, if I'm doing dynamic vertex buffers just plain wrong as well.

Well this is what I have so far:


That's from a hardcoded grid of values that is marching-squared, and new geometry generated, every frame. I'll be adding sides to the regions defined by the algorithm, which is trivial enough. It'll be a while before I get things looking the way I want, and after that I can get down to making it fast [smile]
Previous Entry GA fun
Next Entry Then again...
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement