Saturday, May 21, 2005

Vertex/Index Buffer Demo

Okay, it is time for an update on the MBLib. I am currently working on the mesh interface of the MBGraphics component. I have created a simple mesh interface (MBGraphics_Mesh). Its purpose is to manage the locations in the vertex and index buffers of where an objects data is stored. This works well with batch loading and rendering of mesh objects. The idea is to be able to sort mesh objects by the vertex buffers they reference. This way when the renderer loads a vertex buffer all mesh objects that reference that vertex buffer and are visible by the camera will be rendered at that time. This will increase rendering performance because vertex buffers are not being switched out frequently causing the rendering pipeline to stall.



Above is a screenshot of a demo that shows the use of the mesh and the vertex/index buffer interfaces. It displays two mesh objects, a cube and a prism, and rotates them on unique axes. The vertices and indices of each mesh object share the same vertex/index buffers. Each mesh stores its location into these buffers so the render knows how to draw them to the display.

There is still some work that needs to be done with the mesh interface. There will be a high level manager that manages all mesh objects needed by an application. The idea behind this is to have one mesh be used by multiple objects. This is often referred to as "instancing". This cuts back on the memory usage because each object references a single mesh in memory.

Also to be added are some utility operations for loading mesh model formats such as 3DS, OBJ, and Milkshape3D models. I am still debating on coming up with a universal format that converts those formats into a proprietary one, or just relying on those. I am not totally sure of the pros/cons of either decision, but I will keep you posted after I do more research.

Also, the terrain interface is still being designed. I will post a description of the interface and a demo once that is completed.

Well, that's all I have for today...back to the lab

OOH OOH EEH EEH

No comments: