|
Author Topic:   TreadMarks Texturing
JohnMancine
Member
posted October 05, 1999 07:27 PM            
Seumas,

I decided to try my hand at this message board because it seems like a great way to share info. =]

Basically, I am wondering about how you handle the memory management for the terrain texture. I realize that you are breaking up the texture into 64x64 blocks, and using several small textures as the color per height sample. But heres what I don't understand....

a) Wouldn't the memory requirements be the same for just loading in a 1024x1024 texture(assuming you didn't care of anything else ... ie. card rquirements etc.) If you are building this texture on load-time really, based on the eco tags, then doesn't it take the same amount of mem as a 1024x1024 tex would? (obvoisly takes more memory on disk... but once you build it in memory, i would think it would be the same.)

b) How do you decide which pixel you want to grab from the smaller textures when an eco tag calls for a specific 'terrain type'? Ie. if it says, "give me grass here" how do you decide which pixel of the grass to grab? (trivial question probably... but i'm still interested.)

One of these days I might just be able to grasp all this stuff. =]

I think we all need to give you a hand for your willingness to help all of us out with this message board. Theres some great info in here.

Cheers...
John

IP:

LDA Seumas
unregistered
posted October 06, 1999 05:38 AM           
Hi John,

a) Yes, the memory would be the same if it was downloaded as one big 1024x1024 texture. There are a couple of reasons why that wouldn't be a good idea though. First, a lot of cards can't handle textures that big, notably the Voodoo line, which can only handle 256x256 textures. Also, especially with lower view distances (on, e.g., slower cards), only a small fraction of the landscape will be visible each frame, so having to keep the entire color map in texture ram would be a waste. With 64x64 blocks, it's possible for the driver to swap out the pieces of terrain texture that aren't currently in use, and swap them in only when they're called for.

b) Just XCoord MOD TilingTextureWidth, though I actually use XCoord & (TTW - 1), which is gobs faster, but only works on power of 2 widths and heights. If you think about it, for every texel in the 1024 map, there is a corresponding texel in each of the smaller tiling ecosystem texture maps.

And I'm glad you're finding all this useful.

------------------
-- Seumas McNally, Lead Programmer, Longbow Digital Arts

IP:

JohnMancine
Member
posted October 06, 1999 07:19 AM            
Seumas,

Ahh. Ok. I get it now. =] I thought some how you managed to make a 1024x1024 16 bit color texture magically turn into an 8 bit or something of the sorts. Thanks for the explanation.

Take care,
John

IP: