Thursday, February 17, 2011

Wacom Tablet

I'm thinking about getting a Wacom graphics tablet.  I'm not a visual artist at all, but now that I am engaged in long-distance collaboration, the ability to sketch directly into digital form would be indispensable.  Especially since I don't have a scanner with which I could quickly digitize sketches on paper.  Good-sized ones are a few hundred bucks...but I'm about to get a nice fat tax refund from the IRS, so maybe I can spend some of that on a tablet.  We'll see.

Friday, February 11, 2011

Please Bang Head [Here]

XNA 4.0 presents Vertex and Pixel Shaders 3.0, which support Hardware Instancing.

Hardware Instancing works like this: Say you have an object (e.g. a projectile of some sort) that you want to draw a whole bunch of times (a barrage of said projectiles).  It's really CPU intensive to make a bunch of draw() calls with separate transformation matrices.  Instead, one can load all the transformations into a separate vertex buffer and let the GPU sort it out with a single call to draw() (which it will -- it will automatically duplicate the mesh vertices for each transformation matrix).

Sounds great, right?  Definitely.  Instancing is a critical technique for exactly the kind of situation I described (a lot of projectiles flying about).  Unfortunately, there's a catch.  A slight difference in behavior between running on Windows and on Xbox.  Let me esplain.  No--there is too much.  Let me sum up:

A Model (the logical representation of one complete object) can be made up of multiple Meshes (the logical representation of all vertices that make a single solid part of said object).  In Windows, instancing an entire Model works perfectly.  On Xbox, however, what makes it to the screen is one complete model (the first instance), and then a bunch of copies of the first mesh for the rest of the instances.  Say your Model is a rocket, made up of Meshes for the body and individual tail fins.  Say that a tail fin happens to be the first Mesh in the Model.  Now imagine that you're trying to draw a bunch of rockets flying around, but what you get is one whole rocket and a bunch of disembodied tail fins flying around.

One workaround is to combine all the vertices in the entire Model into a single Mesh.  This is bad for a number of reasons.  First of all, for me, it means hand-editing the .fbx file that stores the Model data.  It's possible; the file is human-readable, but it's a really awful task.  The second reason it's bad is that it screws up texture mapping.  Each vertex in a Mesh has a set of texture coordinates, that can refer to exactly one set of textures for the entire mesh.  This is exactly why Models often have more than one Mesh, so that different sets of textures can be used for each part of the Model.  So for a single-Mesh Model, you'd have to squeeze all your textures into a single image and re-map the entire model.  Possible, but hugely impractical for my operation.

Anyway, this leads to much head-to-wall banging for me as I try to work around the problem.  I've posted a thread in the XNA community forum for assistance; hopefully one of the really smart folks will jump in and help me out.

Thursday, February 3, 2011

Making Friends

I've just made contact with a potential collaborator; someone who can do decent low-poly-count models.  This is exciting.  Not being able to decently model anything much more complicated than a box (and being almost a total write-off in the texturing area) is something of a setback for me.

So, hopefully I'll be able to form a working relationship with this individual, if she is willing to work for promises (I can only pay if/when the game sells...).

For that matter, if anyone's out there reading this who's also got any artistic talent, particularly in 3D modeling or music, and willing to work for the love of it, drop me a line!