Archived

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

Xero-X2

Textures on terrain (size vs amount)

Recommended Posts

I have been planing a terrain engine. I plan to use software during loading process to merge an X amount of textures into a set of textures that will be used on the terrain. The question I have is Size vs Amount, should I make Large textures and switch textures less. or have more smaller textures and switch more. textures are all RGB no alpha. and I don't plan to do any multitextureing unless for shadowing or some purpuse I will think of later, (Im not doing this to AVOID useing extentions tho im just trying to save proformance) I guess the question is pretty simple. Im just wondering what would be best from those experienced with textures. ps: I do know glBindTexture is a slow down, im wondering if the size of a texture will kill render speed if it is too large for only useing a portion of it. I hope my question was clear enough. [edited by - Xero-X2 on July 27, 2003 12:42:16 AM]

Share this post


Link to post
Share on other sites
best is to set a (or several) one dimensional textures, that are mapped in relation to the heigth of a vertex. additional to this you should use a "detail"-texture, with a high repeat rate. tiling textures is no longer usefull with todays graphic cards

Share this post


Link to post
Share on other sites
quote:
Original post by VanKurt
I've made good experience with a single, large texture (4096x4096).
But you should compress such textures to speed the whole thing up...


I am planing to use compresstion as an option, so useing the largest possible texture on the card will not cause any slowdowns that could be sovlded with a lower res texture?

quote:
Original post by 666_1337
best is to set a (or several) one dimensional textures, that are mapped in relation to the heigth of a vertex. additional to this you should use a "detail"-texture, with a high repeat rate. tiling textures is no longer usefull with todays graphic cards


what do you mean 1d textures that are mapped in relation to the height of a vertex? to make sure there is no streaching? im not quite understanding what you are saying. I may or may not use detail texture/s because of the varity of diffrent textures that can be placed on the ground.

thanks for the repiles so far.

[edited by - Xero-X2 on July 28, 2003 11:07:00 AM]

Share this post


Link to post
Share on other sites
I have been doing some tests that have come up with some interesting results

size (fps Uncompressed) (fps compressed)
128 (50 49 48) (52 52)
256 (48 49) (52 53)
512 (48 49) (52 53)
1024 (48 49) (51)
2048 (48 49) (49 50)
4096 (48 49) (37 38)

Geforce 3 ti 200, the test was extream to bring out any problems. and by looking at this data compressed textures work best with smaller textures. this test did not simulate the glBindTexture calls that would be made for diffrent texture sizes. it just tiled them.


size (fps Uncompressed) (fps compressed)
128 (45) (48)
256 (47) (50)
512 (47 48) (51)
1024 (48) (51)
2048 (48 49) (49 50)
4096 (48 49) (37 38)

Geforce 3 ti 200, this test was done taking into account glBind calls. NOTE: this is not done with any optimization so It glBinds as it draws across with proper otimization these results will improve.

Edit: I noticed I typoed 4096 as 4095

window size rememained the same, total drawing space remained the same, and no extra processing was done.

[edited by - Xero-X2 on July 28, 2003 4:37:44 PM]

Share this post


Link to post
Share on other sites
Well Xero-X2, the answer is simply if you neglect difficulty in coding.

Pick the largest texture unit your target card supports and use it as your patch size. Now like I said this obviously doesn't consider cost of implementation and the benefit of absolutely maximzing the usage of the largest texture size is probably not worth it.

That being said, pick a reasonably large texture that still makes sense. (this being a relative term). Then break your terrain into X textures of that size. Create a pool of them representing the most that could be shown on screen at one time. When a portion of terrain being drawn for first time appears or when its texture has been swapped out, grab the least recently used texture and call glTexSubImage.. with appropriate args.

Optional bonus credit: Create multiple pools of texture sizes, when terrain first pops into visibility generate its texture into the lowest resolution pool and slide them forward (into larger side texture pools, using subimage) as they near.

Jeff

[edited by - duke on July 28, 2003 9:31:35 PM]

Share this post


Link to post
Share on other sites
quote:
Original post by Xero-X2

what do you mean 1d textures that are mapped in relation to the height of a vertex? to make sure there is no streaching? im not quite understanding what you are saying. I may or may not use detail texture/s because of the varity of diffrent textures that can be placed on the ground.



you have a 1d texture with gradients on it. now if your terrain represents a mountain environment, the 1d texture will have a green->grey->white gradient on it, and you map it onto the terrain so that higher parts get higher texcoords

Share this post


Link to post
Share on other sites
I know it possible im just aiming for best proformence, thinks for the repiles,
quote:
Original post by 666_1337
quote:
Original post by Xero-X2

what do you mean 1d textures that are mapped in relation to the height of a vertex? to make sure there is no streaching? im not quite understanding what you are saying. I may or may not use detail texture/s because of the varity of diffrent textures that can be placed on the ground.



you have a 1d texture with gradients on it. now if your terrain represents a mountain environment, the 1d texture will have a green->grey->white gradient on it, and you map it onto the terrain so that higher parts get higher texcoords




thats kinda funny that is how I did my water, didn''t even understand what you where saying.. ok, I have learned quite a bit about them, I think im going to use 512x512 textures and stich them across my terrain. I may do some extra shading with 1d textures, but im not sure yet.

Share this post


Link to post
Share on other sites