Archived

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

Greenbean

Directx Api, object handling optomisation

Recommended Posts

Theory question that focuses on how the directx API does things and efficiency concerns Lets say you''ve got 100 spaceships. Now if you create 100 ships, that will mean 100 objects containing 100 sets of textures and 100 sets of meshes, all of them being identical probably (maybe a few variations on the types of ships). I think I can make a work around that a ship will subclass my d3dMesh class such that only one copy of the texture and mesh is stored (using directx vertex buffers etc, pretty much straight out of the dx sdk). Now the question is this: will I take a huge cpu/gpu hit for asking the processor(s) to move that 1 copy of the mesh and texture to 100 different locations per frame? Or is this the standard sort of work that the api does anyway, or would I be better off with 100 unique copies of the space ship in the game eating that memory up?

Share this post


Link to post
Share on other sites
If it was me I would make them all seperate objects. Especially if they each need to be able to face different directions at different times.
I made a program that put 1,000 animated sprites that bounced around the screen WITHOUT any slowdown. In other words: Your computer can handle it!

--Lowell N. Manners
lowell@makevideogames.com
MakeVideoGames.com

Share this post


Link to post
Share on other sites