Archive for August, 2009

Going up in the world

Recently I have been focussing on how to put together `higher level` objects made from multiple curves and straight lines. An `object` in this sense is, for example, a solid filled irregular shape which might require a few or even many curves, straight lines, corners etc to complete it. The idea is to be able to build such objects with commands that `add a curve`, `add a point`, etc. When the shape is finally closed then it is ready for rendering. I’ve got most of the code done to make this happen.

The flow of object construction sort of goes like:

a) Create a bunch of control points which either will define curves or individual polygon vertices
b) Join then all together sequentially in a bunch of arrays ready for conversion to vertices
c) Pass the arrays to a system of `generators` which take the control data and turn it into vertices/triangles
d) Pass the vertex data to OpenGL for rendering.

Eventually this might be optimized, like a single function call that creates objects and tessellates and renders them with texturing and gradients all in one step. It could optimize the speed.

Another thing I’m working towards is filled gradients and texturing. I haven’t written any code on the gradients yet but I have some stuff for textures that is partially done. The idea with gradients is that you either are generating them in realtime as a triangle mesh with vertex colors, or you are doing that at some point and saving it to a texture ready for later texturing. Somewhere along the line there should be gradient and texture warping ie where you can drag around `vertices` within the gradient mesh to shape it how you want it. Of course there’ll be the usual standard gradients – linear, radial, spherical etc. I still have to think about how to translate a realtime gradient mesh into the vertex colors of a bezier shape – it will require some interpolation.

As far as texturing is concerned, it’s going to work much the same as the gradients – either applying a single texture across a shape, or making it out of a mesh, or even my `SuperTexture` which is a collage of multiple textures. Getting that to map to the vertices of a bezier shape is also going to be tricky, especially to deal with how the bezier moves and deforms, and especially if I do anything in 3D. Being able to manipulate vertices of a mesh which don’t map to vertices of a vector shape is the hard part. The first step is just to get a single texture mapped to a curved shape, which should be straightforward.

Gradually I’m working toward a simple editor where I can add tools to manipulate and generate shapes, apply textures, edit gradients and add other effects, so that I can actually start to use it toward a game. I am still aiming for a small game to be released this Christmas, but I am not sure there is time – only about 3 months to go!

Movin’

Hey folks.

Okay so it’s been a little while since the previous bloggage and there’s a good reason for that. We just moved to a new apartment. It was a lot of hard working moving boxes and furniture and getting it all unpacked, but we’re almost done. So I hope to be writing something more useful here in the coming weeks.

I am still working on a library of routines for filled vector-graphics. I have the bezier calculation stuff sorted out, and a working prototype of filled realtime curved objects, complete with really nice antialiasing. The part where I left off a week or so ago was in creating additional library functions to handle more complex/compound objects, and starting to look at things like constructive solid geometry operations. I’m pretty happy with the speed of it all and am confident that a visually impressive game can be created with animated filled shapes, on pretty average graphics hardware.


Welcome

Enjoy the fun and excitement of computer games, but even moreso, the creative expression of developing your own. And the graphics are cool too. :-)

What was that?

Categorically speaking...

Game Development Graphics Uncategorized

What just happened?

  • 1,403 hits