Archived

This topic is now archived and is closed to further replies.

mux

Managing Vertex Buffers / Loading Lvl Formats

Recommended Posts

Some questions on Vertex Buffers and Object Loading. If you have a level format consisting of several static object how will you load and manage the vertex and index buffers? If a level format consists of hierarchical, empty ''groups'' (ie. car) which are formed by objects (ie. tires) will you just load vertices, indexed primitives, normals into one big vertex & index buffer in order to apply spatial divisioning (octree, abtree, whatever)? Or do you create the octree while loading the level, storing the data in its leaves and only use the buffers on those small piece of geometry data? Please bare with me, now how do you actually ''synchronize'' the raw geometric data which is stored in an octree/vertex buffer/whatever with the ''game data'' (ie a door and its behavior, triggers for quests). I mean if you subdivide the whole scene into boxes with a treshold you could end up with only part of the actual geometry data forming the ''game object''. Do you have to propagate a separate, linked ''game object'' tree? Ok this doesn''t make any sense at all, but this is my current state of confusion

Share this post


Link to post
Share on other sites

What you do is each QuadTree represent a spacial tile so .

QuadTreeNode has pointer to WorldTile
WorldTile contains all objects with an x, y in that tile.

When rendering first iterate through the tree and render visable terrain ( WorldTile) , then iterate through and render all other objects (WorldTile.Objects[]) .

It is not cost effective to have very detailed culling code , just eliminate objects according to the terrain tile they are in.


Ben

Share this post


Link to post
Share on other sites