Not having to recreate objects?
I have been playing around with the basics of OpenGL for a little while now ... but I am wondering, like in large games such as Doom3 they dont have to go through a coordinate array every cycle to redraw the world do they? is there a way to draw an object from data but not have to do through the data again to redraw the object?
I have read through parts of the red book and google to find out but dont seem to find anything that makes sense to me inreguards to this exact problem.
Any help is appreciated,
Thanks :-)
Many many ways to solve this (ordered from oldest to latest, linked to random google output):
- Display lists
- Vertex Arrays
- Vertex Buffer Objects
Have fun,
Pat
- Display lists
- Vertex Arrays
- Vertex Buffer Objects
Have fun,
Pat
well i dont no exactly wat u mean but in games like that, they only draw wat u see. Lets say ur in a room, all that would be rendered would be that room nothing behind u or past it. So this way, it would not draw the entire world which would lag like a mother with FSAA and anisotropic filtering all at max settings with a res of 1600x1200.
Quote:Original post by xyuriYep, they do. That's not to say that they do all those glVertex calls each frame like you do; they're more likely to use display lists, vertex arrays, and/or VBOs. I suggest that you read up on those options.
I have been playing around with the basics of OpenGL for a little while now ... but I am wondering, like in large games such as Doom3 they dont have to go through a coordinate array every cycle to redraw the world do they?
EDIT: so, darookie becomes damaster! CURSES!
Basically, what doom III and other games do is something called "instancing" which means they keep the same model data (what i assume your referring to as coordinates) and retransform it, using matrices, like in the simplest of cases:
while (true)
{
//message handling
for (UINT i = 0; i < NumInstances; ++i)
{
glTranslatef(Instances.Position.x, Instances.Position.y, Instances.Position.z);
DrawModel(Models[Instances.ModelIndex]);
}
}
you know, something like that, so its the same model, multiple instances can have the same model, but different Positions
EDIT: not only was i beaten, but i guess i misinterpreted the question, lol
hope that helps
-Dan
while (true)
{
//message handling
for (UINT i = 0; i < NumInstances; ++i)
{
glTranslatef(Instances.Position.x, Instances.Position.y, Instances.Position.z);
DrawModel(Models[Instances.ModelIndex]);
}
}
you know, something like that, so its the same model, multiple instances can have the same model, but different Positions
EDIT: not only was i beaten, but i guess i misinterpreted the question, lol
hope that helps
-Dan
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement