GSoC/GCI Archive
Google Code-in 2012 Copyleft Games Group

PySoy: Vertex Packing

completed by: Samuel Kim

mentors: Amaury Medeiros, Arc Riley, Tony Young, David Czech, Mayank Singh

Currently we use a VBO (vertex buffer object) packing each vertex as position (3d), normals (3d), texcoords (2d), tangent (3d). We used to add to the end of this the TSLVs and fog depth, since those were calculated on the CPU (vs GPU) so updating just the tail end of the VBO required less bandwidth than updating the entire VBO every frame.

This sort of fixed setup has a few disadvantages - it wastes GPU memory on features that won't be used for every object, it places TSLVs and fog depth away from the rest of the cooresponding vertex data making rendering slower, and will make both Orc and vertex shader functions to calculate TSLVs and fog depth much more difficult to write.

Write a Body method which takes source arrays for position, normals, texcoords, and tangents - and outputs a packed vertex array in the same format we use now. Modify Box.gs to output to different arrays and then pack them to a the VBO array using this new function. In the future this function may, for example, leave off the texcoords and tangents if a plain Colored material is used, or leave off the tangents if bumpmapping isn't used. These additional cases may be the goal of future GCI tasks.

While working on this task you should join and remain in #PySoy on Freenode to get help, feedback, and guidance from mentors and other developers. Code updates which may affect your work are also announced here as they happen. This is especially important for this task as other GCI tasks may be worked on to modify the same classes.

When you've done, commit your work and post the resulting changeset url to this task.