video card resource questions

Started by
2 comments, last by sqpat 15 years, 9 months ago
the articles that i find that talk about this stuff generally are dated, talking about 16 mb vram (i have 256 on my 3 year old laptop) and such. Anyways, i was wondering about what kind of balance i should be looking for between saving VRAM and saving processing time in a couple instances. I saw one article mention having no more than 500 or so draw calls per game loop due to overhead. Again, this article was a few years old. However, at the moment, im calling a draw per quad of a 32x32 terrain map. I'm drawing indexed primitives and everything is ordered, so there'd be no problem drawing it all at once; except there are different terrains on each tile. So i was wondering, would it be much more economical to make one huge terrain map to save time and not do the 1000ish draw calls involved, even at the cost of about 4 MB in vRAM? One other thing i need is space for four 8x128 sheets of 64x64 sprites in 256 color (so we're looking at about 16 MB of VRAM here) to represent character graphics. i want them all preloaded so theres no lag loading them as needed. (i've seen other engines do this and come up with a bit of lag or delay.) 16 MB ram looks pretty big, maybe it really isn't i dunno. But is there some way to limit the space it takes up in vram, like utilizing compression? Or would the time to constantly uncompress that data take way too long anyways? Does using PNG files automatically do this, or are the files stored in vram in a bitmap format anyways? My gut says make the big texture to save all that processing time, and don't worry about the huge spritesheets. But I figure i ought to be sure.
Advertisement
Well, think it through all the way.

If you are worried about a measly 4MB of vram wouldn't that suggest that you are worried about performance on an older card and thus and inordinate number of draw calls seems worse?

In general Draw calls should be cut down whenever possible. They are the number one killer. 1000ish would bring my 8800 to it's knees. ;)
okay, ive been searching for this technique to combine several textures from file into one larger texture in memory for a while now, but i have no idea what the name of it is so im having trouble finding it. Can someone help?
Nevermind. a clever approach gets me the best of both worlds.

Basically, i used run length encoding with my texture map, i.e. if i had 5 of the same 64x64 texture in a row, i drew all five at once (using drawIndexedPrimitive). I managed to cut my draw calls by about 75-80% on average, doubling my current uncapped fps (i.e. more than a 50% decrease in frametime) and adding no VRAM.

This topic is closed to new replies.

Advertisement