Jump to content

Recent Entries

Recent Comments

- - - - -

It's hip to be square

4: Adsense

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]

Note: GameDev.net moderates comments.