About

Remote Shepherd is the capstone project for Long Shot Games, a group of five graduate students in RIT's Game Design and Development masters program. The game allows the player to step into the shoes of a group of vigilantes who have decided to put their skills gained as Marine Scout Snipers to use in cleaning their city of criminal organizations. This blog will track both the ongoing design and development of the project.

Thursday, April 21, 2011

Havok, Vertex Buffers, Maya 2011

So, it's been a while since I posted. We ran into an interesting situation where we learned that Havok was exporting our referenced meshes as unique meshes within our level. This led to each mesh having its own unique vertex and index buffers. Now, with trees, paths, POIs, and other content, this led up to having 5600 unique vertex and index buffers.

That, for lack of any better words, is a lot of content. That's also a lot of state changes between graphics calls. So, how did we fix this?

Well, we first attempted to export our files using the Havok exporter in Maya 2011, using the "Find Mesh Instances" filter. This filter is supposed to remove duplicate meshes from the scene, but does not detail how it does so.

We at first assumed that any file that was referenced in would be considered a duplicate mesh. Then, when that didn't work, and we had a 50 MB level, we tried doing reference copies. That didn't work either. Well, I then systematically attempted to figure out how "Find Mesh Instances" worked. Turns out, I couldn't find a way for it to work (at least not using the filter).

But, after talking with Eric, I found a nice way around this.

So, the solution was instead to do this:

  1. Reference in the object / model you want to use from the file of your choice.
  2. After placing your reference, select the object in the Viewer or Outliner.
  3. Go to Edit->Duplicate Special (click the square next to it to set it up)
  4. Select Geometry Type as Instance and Group Under as World.
  5. Click Duplicate Special.

What this does is creates an instance of the reference that was loaded, which has its own transforms separate of its parent. However, because it is an instance of the reference, its materials, vertex data, etc will be changed when the reference is updated. Likewise, when you execute the shortcut now, these parameters will already be set up.

When you export using the Havok Content Tools exporter for Maya 2011, "Find Mesh Instances" will report not finding any duplicate meshes. However, only a single instance of the mesh will be loaded and referenced in the scene. For us, this insures we only create one index and vertex buffer per referenced mesh, greatly reducing the size of our level files and increasing run-time performance for the game.

1 comment:

  1. Thank you for taking the time to provide us with your valuable information.
    https://www.technokryon.com/hire-developers

    ReplyDelete