Texture Impact on Framerate
by Florian · in Technical Issues · 03/17/2007 (4:21 pm) · 13 replies
Hi,
Ive been wondering lately what the impact of textures is on the framerate.
Does your game run slower when using higher dimension textures, if so, why?
Also, does a texture that is higher in MB run slower?
Or if I use a 512*512 texture and tile it 4 times, or use one 1024*1024 and dont tile it, does the smaller texture run faster? basicly they both use as much texels..
Can someone answe these questions?
Ive been wondering lately what the impact of textures is on the framerate.
Does your game run slower when using higher dimension textures, if so, why?
Also, does a texture that is higher in MB run slower?
Or if I use a 512*512 texture and tile it 4 times, or use one 1024*1024 and dont tile it, does the smaller texture run faster? basicly they both use as much texels..
Can someone answe these questions?
#2
If all the textures needed to render a frame take up more video card memory that you have you'll get what is called thrashing. This is when the video driver needs to swap out textures from system memory to video memory. If it all doesn't fit then on every frame this has to happen and it can impact performance tremendously if you have a lot of large textures. So you want to avoid that at all costs.
Next don't waste texture memory.
Hope this helps.
03/18/2007 (11:22 am)
@Florian - First a few things to consider about textures. If all the textures needed to render a frame take up more video card memory that you have you'll get what is called thrashing. This is when the video driver needs to swap out textures from system memory to video memory. If it all doesn't fit then on every frame this has to happen and it can impact performance tremendously if you have a lot of large textures. So you want to avoid that at all costs.
Next don't waste texture memory.
- If your texture doesn't need alpha don't put it in a 32bit PNG... the video card will happily load up a 32bit texture when only a 24bit one is needed.
- If you for instance put a crazy high resolution texture on a rock and in your game you never get close enough to see any of the detail... your wasting texture space. Really think about the context your using a texture and the expected video resolution your game will be played in when you decide a size.
- Forget PNG or JPG... learn about the different DXT compression formats and use DDS textures... DXT1 can give you 8 to 1 compression in video memory. This not only effects disk size, but the size in system memory, how fast it is uploaded to video memory, and even rendering performance.
- When you can use detail texturing so that you can get away with a smaller base texture.
Quote:Does your game run slower when using higher dimension textures, if so, why?Depends... if your over video memory size you get thrashing which will effect it sometimes very dramatically. If not then really it depends on alot of factors, but not so much to worry about. Concentrate more on effectively using the space and not thrashing.
Quote:Also, does a texture that is higher in MB run slower?As Caylo pointed out size and MB are linked, so the answer above applies here as well.
Quote:Or if I use a 512*512 texture and tile it 4 times, or use one 1024*1024 and dont tile it, does the smaller texture run faster?Effectively it doesn't make a difference. Although i believe that there are some cards out there that don't perform as well with > 512 textures (and some that won't load them at all), but those are pretty old cards. So the more important question is what is your target video hardware for your game.... as long as your not targeting older cards your fine.
Hope this helps.
#3
03/19/2007 (7:26 pm)
Does TGEA support DDS?
#4
03/19/2007 (7:42 pm)
Yes, TGEA does have DDS support.
#6
03/21/2007 (4:48 am)
Hi, Tom, do you mean it supports DDS before applying the fix (and how?), or the fix is for caching issue?
#7
As far as how it is supported... just reference a .dds texture in place of where you normally reference a .png or .jpg.
03/21/2007 (9:13 am)
@Peng - Yes TGEA supports DDS, but the implementation doesn't cache textures. This means if you request the same texture twice from the resource manager you'll get two unique copies of the texture and not one with a reference count of 2. The fix corrects this issue.As far as how it is supported... just reference a .dds texture in place of where you normally reference a .png or .jpg.
#8
03/21/2007 (9:18 am)
There isn't DDS support in TGE however... So png is still the way to go.
#9
On average, the NUMBER of textures is more important for performance than the SIZE (pixel dimensions)?
03/21/2007 (11:11 am)
So...just to be absolutely clear:On average, the NUMBER of textures is more important for performance than the SIZE (pixel dimensions)?
#10
03/21/2007 (12:00 pm)
@Scott - It's not that simple to generalize like that, but normally... i would say yes. Less textures usually means less memory (aka size) and less draw calls which can mean better performance.
#11
also, is a standart PNG 24bit?
and about the DDS compression, is that only compression as Hard Disk Spage Usage or does this also affect the texture size loaded in the VRAM because textures get uncompressed when loaded right?
And also this means that for TGE(so no shaders and stuff) Geometry is the most demanding process(staying in the graphics, so no AI and such)?
And thus when making art for low-mid end PC's the most importing thing that should be watched it clean meshes and texture sizes doesnt reaaally mather als long as there aren't to much textures to be loaded?(asuming there is no trashing)
03/21/2007 (3:49 pm)
K, this is very helpfull to build up some basic 3D knowledge base =)also, is a standart PNG 24bit?
and about the DDS compression, is that only compression as Hard Disk Spage Usage or does this also affect the texture size loaded in the VRAM because textures get uncompressed when loaded right?
And also this means that for TGE(so no shaders and stuff) Geometry is the most demanding process(staying in the graphics, so no AI and such)?
And thus when making art for low-mid end PC's the most importing thing that should be watched it clean meshes and texture sizes doesnt reaaally mather als long as there aren't to much textures to be loaded?(asuming there is no trashing)
#12
DDS is compressed on disk, in system memory and on the video card. So it's always compressed which is why it is so much better than PNG or JPG.
The other questions i don't understand. :)
03/21/2007 (3:57 pm)
@Florian - PNG supports alot of formats internally, but 24bit and 32bit PNGs are the norm.DDS is compressed on disk, in system memory and on the video card. So it's always compressed which is why it is so much better than PNG or JPG.
The other questions i don't understand. :)
#13
I think a little explanation is in place(i admit, my question is a bit akward)
Anyway, what i meant to ask was that, when working on game content, the amount of triangles on the screen have the most impact on the framerate?
03/24/2007 (8:58 am)
XD, but thank youI think a little explanation is in place(i admit, my question is a bit akward)
Anyway, what i meant to ask was that, when working on game content, the amount of triangles on the screen have the most impact on the framerate?
Torque 3D Owner Caylo Gypsyblood
The only way textures effect frame rate is when switching render states( many textures on one shape- and this is mostly only a problem with older non- Hardware T&L video cards), or not enough video ram, causing the video hardware to seek its needed data from computer system RAM..