PDA

View Full Version : Duplication of Complex Models



05-23-2003, 07:01 AM
I have huge 3D models loaded into my game. The game is running very slowly because I have so many of them. However, I have only 5 models with thousands of duplicates for each. Is there any way I can create copies of the models and load them quicker than actually drawing them?

Thanks

05-23-2003, 08:01 AM
Just to check: are you culling the viewing frustum to prevent unseen objects from even going to OpenGL?

This can have an enormous performance advantage.

If not, check out the (excellent) article by Mark Morley (http://www.markmorley.com/opengl/frustumculling.html) for further help.

Also, are you (re)using Display Lists to keep the numbers of memory bound objects to a minimum?

Obli
05-23-2003, 11:52 AM
Impostors?
Even better, depth-sprites?

EDIT:
I read the post again...
"..thousands of duplicates for each.." if they are visible at the same time (kinda strange to me) the above will buy you INSANE performance boost. They will become tricky to manage however.

I also raccomand you a frustrum culling. Looks like you need it.

[This message has been edited by Obli (edited 05-23-2003).]

05-24-2003, 10:47 AM
Thank you for the advice. Display lists seem to work. (Is there a maximum number you can have at once?) I will try frustrum culling soon. But what the hell is a depth sprite?

chennes
05-24-2003, 05:32 PM
There is a maximum number of display lists, which I am sure there is a function to query (it's implementation dependant, I believe), but you'll probably never hit it. Besides, from your original description it sounds like you only need 5. Way, way below any such limit.

Obli
05-24-2003, 11:08 PM
Do you remember old 2D FPS games?
They used sprites to simulate real models.
In today's words, a sprite is a quad with a texture on it. The quad is billboarded with the camera so the texture is always displayed. The texture itself can be generated on the fly.

The problem of this approach is that it is almost impossible to get correct results from intersecting sprites.
Those kind of sprites are often referred as 'impostors'.

Depth sprites (aka nailboards) are its natural evolution. By defining some parameters, you can make it so the Z value of the polygon is modified by the texture. In this way you can get decent results from intersecting nailboards and/or real geometry.

The problem is that this needs some advanced rasterization algorithms. As far as I know, you need NV_texture_shader (the op should be DOT_DEPTH_REPLACE_NV or something like that, don't remember right now) or even better, a fragment-program extension.
Ati has a nice demo on that about volumetric explosions. It's in D3D but the concept is the same. nVidia has a good amount of demos for that one in GL, and they look cool.

mhayenga
05-25-2003, 03:39 AM
There is a maximum number of display lists, which I am sure there is a function to query (it's implementation dependant, I believe), but you'll probably never hit it. Besides, from your original description it sounds like you only need 5. Way, way below any such limit.
Damn straight. http://192.48.159.181/discussion_boards/ubb/smile.gif According to the redbook, the number of display lists you can nest (displaylists within displaylists) is guarenteed to be atleast 64... So however many normal display lists must be huge...

chennes
05-25-2003, 05:52 AM
Now that I think of it, the limit is probably more along the lines of a memory limit than a constant number (though maybe sizeof(int) or something like that).