Author Topic:   Memory needed?
New Member
posted February 13, 2000 11:17 AM            
Something must be wrong in my calculations, or I don't get something. It's about the variance trees again. I calculated this:
for a terrain that's (2^n)+1 you have a maximum of split levels of (2*n)+1
for a 17X17 terrain the maximum level is 9, which means about 500 bytes for a side, 1K for a diamond. for a 1025X1025 terrain, the max is 21 levels, giving 4 megs of memory for the maximum variance tree for the diamond. is this right?


Bryan T
posted February 15, 2000 11:23 PM            

Hmm.. let me chew on the numbers a sec...

First: Use patches instead of the entire terrain. Seumas says Tread Marks uses terrain maps of 1024x1024 pixels, but that is cut into an 8x8 grid of patches which are only 64x64 pixels.

Now, given a 64x64 patch, the variance tree (at full depth) should be no more than 13 (14 is actually redundant). This is 8K of memory for one tree times 2 trees per patch = 16K of RAM.

I store only 9 levels (I think Seumas said he ignored the last 3, so his would be 10). This is 512 bytes x2 per patch = 1024K of RAM.

I also got a few odd artifacts with 12 levels, this may be an error in my code, but it was significantly slower to calculate the variance trees, and not worth the added detail.