Texture conservation
by Nmuta Jones · in Torque Game Engine · 10/08/2005 (6:49 am) · 8 replies
I have found some good low poly retail tree packs that I am considering purchasing.
I am trying to gauge how many different types of trees I should feature in my game before I run into the danger of consuming all of my client's VRAM. Of course, this is dependant upon how many OTHER textures I'm using, so, for the sake of argument, let's say I'm using the same terrain texture load as is in the TGE demo, the same amount of interior textures the buildings use, and the same skies, etc.
But then add to the equation about 8 unique character models (all of whom may be on the screen at the same time but not neccessarily), each with one 512X 512 map.
Let's also say that I scale my tree textures so that each tree has two 512 X 512 diffuse maps and one alpha transparency map each.
Based on that, I am estimating that if I take out the trees currently in TGE and replace them with my new trees, and add the characters that I mentioned above, that I could fit at least 5 new varieties of trees in there and have no significant problems on video cards 32MB and up.
What do you think? Is this a fairly reasonable estimate?
I am trying to gauge how many different types of trees I should feature in my game before I run into the danger of consuming all of my client's VRAM. Of course, this is dependant upon how many OTHER textures I'm using, so, for the sake of argument, let's say I'm using the same terrain texture load as is in the TGE demo, the same amount of interior textures the buildings use, and the same skies, etc.
But then add to the equation about 8 unique character models (all of whom may be on the screen at the same time but not neccessarily), each with one 512X 512 map.
Let's also say that I scale my tree textures so that each tree has two 512 X 512 diffuse maps and one alpha transparency map each.
Based on that, I am estimating that if I take out the trees currently in TGE and replace them with my new trees, and add the characters that I mentioned above, that I could fit at least 5 new varieties of trees in there and have no significant problems on video cards 32MB and up.
What do you think? Is this a fairly reasonable estimate?
About the author
Lead Developer for MediaBreeze Multimedia
#2
In Torque, if a mesh has 2 separate texture maps, will it render slower than one texture map the same size as both combined?
In most engines this is the case, but I just wanted to make sure before I invest all of this time combining all of these maps and re-doing the UV coords for each element. The trees I got each have up to 3 maps a piece, and it's going to be a little work combining all the maps and redoing the texturing for each one.
10/08/2005 (9:55 pm)
My main concern now is my "follow up" question, and another related one:In Torque, if a mesh has 2 separate texture maps, will it render slower than one texture map the same size as both combined?
In most engines this is the case, but I just wanted to make sure before I invest all of this time combining all of these maps and re-doing the UV coords for each element. The trees I got each have up to 3 maps a piece, and it's going to be a little work combining all the maps and redoing the texturing for each one.
#3
10/09/2005 (11:21 am)
No suggestions? What is the maximum number of textures recommended per tree? Two? Three? Any artists online? I have resized all my maps to be no bigger than 512; most are approx 256 square and smaller. But each tree, presently, has 3-5 maps each. These are very high quality very low poly trees I bought from Turbo Squid for game dev.
#4
In other words, will 10 trees placed individually as static shaps render slower OR consume more texture memory than items placed using the fxShapeReplicator? (In Blitz, for example, there's a way to clone a mesh so that the original and the clone both have the same "surface" and are rendered as one item, rather than two separate items).
10/10/2005 (10:11 pm)
OK , looking at some .mis files, I see that the best way to place trees is using the fxShapeReplicator. Does using the fxShapeReplicator do anything in terms of rendering optimization, or is it more so for convienece of placing things in the engine?In other words, will 10 trees placed individually as static shaps render slower OR consume more texture memory than items placed using the fxShapeReplicator? (In Blitz, for example, there's a way to clone a mesh so that the original and the clone both have the same "surface" and are rendered as one item, rather than two separate items).
#5
If anyone has any input it would be helpful. Thanks!
10/11/2005 (8:12 am)
I've assumed that these questions are so basic that most won't bother to respond, but if anyone could at least verify that my reasoning is correct that would help. I have a pretty good understanding of optimization in games in general, but each engine has it's own optimization tricks and I'm sure Torque is no exception.If anyone has any input it would be helpful. Thanks!
#6
"will the end user see a performance hit if too many similar trees are placed in the engine based on the repetition of the same texture several times?"
no in fact the opposite is true. you should repeat textures as much as possible. using the same texture uses less time since the processor doesnt need to fetch new textures. in fact, if possible, I would suggest embedding multiple character and object textures into the same image. however, i think in terms of actual rendering time, there wouldnt be much of a performance difference in general.
"Is there a way to combine all of the "surfaces" into one model, so that they render faster?"
i would imagine combining models would be more efficient but may cause rendering problems since dts objects are culled as soon as the center of the object is off screen. i think this technique would be more feasible for dif objects. if you can restrict or control what the player can see, combining objects may be somewhat useful.
"OK , looking at some .mis files, I see that the best way to place trees is using the fxShapeReplicator. Does using the fxShapeReplicator do anything in terms of rendering optimization, or is it more so for convienece of placing things in the engine?"
from what ive heard the fx objects dont optimize rendering, they only optimize network transmission...whatever that means. =) they also do make creating foliage and scenary much easier.
thats all the information i can give. I dont own the engine source so I cant give any engine specifics. however, if you want advice on optimization i would suggest:
a. use LOD, i think this is the area where youll achieve the most dramatic optimization results.
use a billboard and ditch the alpha transparency for the lowest detail level.
b. make textures as small as possible. I'm using 256x256 textures for all my game objects and characters and I feel going any larger should be an exception rather than the standard.
c. i think for some objects, trees specifically, you can get away with using a tiny texture, say 32x32 for the trunk. you can manually tile this texture by scaling and moving all the faces over it. you can have a few larger more detailed trees use the larger textures to make the scene look more lifelike while using the generic tiling technique for the smaller less noticeable trees. if you want to create a dense forest, i would highly suggest doing this.
d. do not simply populate your forest with a multitude of 3d trees with alpha textures for the leaves. it just wont work. theres a reason you rarely see forests done like that in commercial games. frequent use of LOD and billboards are where your efforts should lie in optimizing torque.
e. consider that creating a dense forest scene is very difficult(especially for a fps) and no matter what tricks you try its quite possible that you may never achieve the look or performance you want. if you can achieve even a reasonable facsimile of what you envisioned, consider that a major accomplishment.
10/11/2005 (9:18 am)
Nmuta im still a noob at all this but i'll try to offer some information ive gathered in my own research."will the end user see a performance hit if too many similar trees are placed in the engine based on the repetition of the same texture several times?"
no in fact the opposite is true. you should repeat textures as much as possible. using the same texture uses less time since the processor doesnt need to fetch new textures. in fact, if possible, I would suggest embedding multiple character and object textures into the same image. however, i think in terms of actual rendering time, there wouldnt be much of a performance difference in general.
"Is there a way to combine all of the "surfaces" into one model, so that they render faster?"
i would imagine combining models would be more efficient but may cause rendering problems since dts objects are culled as soon as the center of the object is off screen. i think this technique would be more feasible for dif objects. if you can restrict or control what the player can see, combining objects may be somewhat useful.
"OK , looking at some .mis files, I see that the best way to place trees is using the fxShapeReplicator. Does using the fxShapeReplicator do anything in terms of rendering optimization, or is it more so for convienece of placing things in the engine?"
from what ive heard the fx objects dont optimize rendering, they only optimize network transmission...whatever that means. =) they also do make creating foliage and scenary much easier.
thats all the information i can give. I dont own the engine source so I cant give any engine specifics. however, if you want advice on optimization i would suggest:
a. use LOD, i think this is the area where youll achieve the most dramatic optimization results.
use a billboard and ditch the alpha transparency for the lowest detail level.
b. make textures as small as possible. I'm using 256x256 textures for all my game objects and characters and I feel going any larger should be an exception rather than the standard.
c. i think for some objects, trees specifically, you can get away with using a tiny texture, say 32x32 for the trunk. you can manually tile this texture by scaling and moving all the faces over it. you can have a few larger more detailed trees use the larger textures to make the scene look more lifelike while using the generic tiling technique for the smaller less noticeable trees. if you want to create a dense forest, i would highly suggest doing this.
d. do not simply populate your forest with a multitude of 3d trees with alpha textures for the leaves. it just wont work. theres a reason you rarely see forests done like that in commercial games. frequent use of LOD and billboards are where your efforts should lie in optimizing torque.
e. consider that creating a dense forest scene is very difficult(especially for a fps) and no matter what tricks you try its quite possible that you may never achieve the look or performance you want. if you can achieve even a reasonable facsimile of what you envisioned, consider that a major accomplishment.
#7
I agree with the small trunk strategy. Also, I think the MOST optimized option for the entire tree model (higher LOD tree) would be to put ALL of the textures for each tree, (bark, leaves, etc.) on ONE 256 X 512 texture, and unwrap the trees and map the entire tree on one map. But whether or not I actually do that depends on my time.
10/11/2005 (12:11 pm)
Thanks, Sean H.. that is very helpful. I was already planning to do L.O.D., but I did not think about billboards for the lower levels of LOD and I will certainly implement that. I am not making a dense forest; my environment is actually semi-arid , but closer to the rivers and water sources there will be several trees. I agree with the small trunk strategy. Also, I think the MOST optimized option for the entire tree model (higher LOD tree) would be to put ALL of the textures for each tree, (bark, leaves, etc.) on ONE 256 X 512 texture, and unwrap the trees and map the entire tree on one map. But whether or not I actually do that depends on my time.
#8
10/11/2005 (12:33 pm)
That sounds like a good idea nmuta. placing the textures for multiple objects in the same graphic should speed up rendering a bit. i still also think you can optimize things even further by reusing texels by placing faces over each other in the texture map. i cant be sure though since ive never tried it.
Torque Owner Nmuta Jones
For example, I may want to put 20 trees of the same type in one area by a lake. What kind of performance will 20 identical textures pose as compared to three? Is there a way to combine all of the "surfaces" into one model, so that they render faster? Many engines handle rendering this type of thing differently, so I need some guidance in this area. Thanks.
And yes, as I mentioned before, my target market are users with 32 MB vram and up.