Jump to content
  • Advertisement
Sign in to follow this  
xyuri

OpenGL Not having to recreate objects?

This topic is 4900 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :-)

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Quote:
Original post by xyuri
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?
Yep, 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.

EDIT: so, darookie becomes damaster! CURSES!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Thank you all for youre very fast responses ! At least now I know what OpenGL stuff I need to search for to get this effect happening :-)

Thanks again :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!