Big texture vs. lots of small textures?
by Kostiantyn Teterin · in Torque Game Engine · 10/18/2006 (9:58 am) · 9 replies
Hello!
I am wondering, what method is better for Torque - to make a big texture and use it for several models, or to make individual small texture for each object?
Thanks!
I am wondering, what method is better for Torque - to make a big texture and use it for several models, or to make individual small texture for each object?
Thanks!
About the author
#2
For me, it is no matter how to make models. I am wondering how is better for optimal rendering.
10/18/2006 (10:05 am)
You mean that the rendering speed doesn't depends from it?For me, it is no matter how to make models. I am wondering how is better for optimal rendering.
#3
AIUI, when a texture is loaded into video memory,
the whole texture is loaded,
even if only one small corner of it is actually used.
10/18/2006 (11:04 am)
Lots of little textures is generally better, imo.AIUI, when a texture is loaded into video memory,
the whole texture is loaded,
even if only one small corner of it is actually used.
#4
10/18/2006 (11:05 am)
But, that large texture is only ever loaded once.
#5
10/18/2006 (11:14 am)
Besides, there are some small amount of time required for GPU to change texture from one to another, and in some cases you can get better berfomance with the one big texture, especially if you are using a lot of objects (like I plan to do in my game, which will be the RTS project). But I would like to know, which method Torque is optimized for.
#6
I would definatly consider using the same texture if they share any of the same areas in that texture, saves you some valuable memory.
10/18/2006 (12:31 pm)
I said it depends on your game. Will you be rendering all of these objects at once? Will you have the textures loaded no matter if those objects will be displayed or not? For instance, multiple missions or levels. Will these objects share any of the texture material? For instance, two rifles that share the same scope.I would definatly consider using the same texture if they share any of the same areas in that texture, saves you some valuable memory.
#7
10/18/2006 (12:40 pm)
I will render some amount of objects at once. As for other questions, how is faster? I assume, that it is better to preload all textures for the level. And I guess that shared materials works faster then individual (i.e. big texture for all objects should work faster then little textures because it doesn't required to change texture while rendering them). But I don't know how is better for TGE. Anyway, I believe that my assumptions are correct, so it must be the better way to have one big texture.
#8
There is no texture/state batching whatsoever in TGE.
10/18/2006 (2:02 pm)
Well, TGE will probably re-bind the textures for each individual model, without checking if they are the same, I think. If so, it's depends on whether there is a penalty for doing so in OpenGL or not.There is no texture/state batching whatsoever in TGE.
#9
of course there is a cost penalty for changing textures.
as for texture size, OpenGL Likes increments of 512, and of course power of 2.
but this is most likely a hardware question.
depending on what type of hardware you are running you will see different results.
for example, the crappy Intel 82852/855GM card does not accept anything larger than 2048x2048
as for if you can gain performance by consolidating textures to one image, I dont really know forsure or not.
code it up and check the profiler :)
but before you even worry about that optimization, there are a bazillion other places to spend your optimization time.
for example if you game is using multiple object's that are texture the same, or if they are running the same geometry, then you need to implement batching.
10/18/2006 (2:12 pm)
In the fps game as this one it really could benifit from batching/sorting and not changing textures unless necessary.of course there is a cost penalty for changing textures.
as for texture size, OpenGL Likes increments of 512, and of course power of 2.
but this is most likely a hardware question.
depending on what type of hardware you are running you will see different results.
for example, the crappy Intel 82852/855GM card does not accept anything larger than 2048x2048
as for if you can gain performance by consolidating textures to one image, I dont really know forsure or not.
code it up and check the profiler :)
but before you even worry about that optimization, there are a bazillion other places to spend your optimization time.
for example if you game is using multiple object's that are texture the same, or if they are running the same geometry, then you need to implement batching.
Torque Owner Stefan Lundmark