Alexander Stohr wrote: > > > > (This is based on the idea that a full set of mipmaps packs > > perfectly to take > > > up two times the size of the base texture). That's also > > not true for all > > > architectures... > > > > Ok, that explains a bit. However, in some circumstances we > > may loose a > > level. The mipmaps don't double the size, the only increase > > it by 1/3. > > Then there are architectures like MGA the can't use all 11 mipmaps. > > Okay, me was odd. > (this always happens when i am thinking with the stomach...) > > But now i will try to go into deep and get to final formula of > (4/3 * Lvl_size) > for the maximum of expected pixels in the total amount of data > stored in a squared level stack. Further i will point out to > the goods and bads of the mentioned bithshift formlua and the > alternative method of looping. In the end i will point out to > reverse calculation methods and to specific implementations > that finally might break or at least complicate the overall > systematics of pyramid stack calculations. > > grafically: > > n=2 n=1 n=0 > #### ## # > #### ## > #### > #### > > mathematically: > level width = 2^n > level size = (2^n)*(2^n) = 2^(2*n) > size increse ratio per level increment = 4 > = (2^(n+1))*(2^(n+1)) / ((2^n)*(2^n)) > = (2^(n+1-n))*(2^(n+1-n)) > = (2^1)*(2^1) > = 2*2 = 4 > > summarized size of all levels = sum(x=0, x=n, 2^(2*x) ) > (sorry, i dont have the math book handy for solving that here)
just FYI the formula is $$ \sum_{k=0}^n q^k = \frac{q^{n+1}-1}{q-1} $$ in this case $$ \sum_{x=0}^n 2^{2x} = \sum_{x=0}^n 4^x = \frac{4^{n+1}-1}{3} $$ and hence the ratio $$ r = \frac{4}{3} - \frac{1}{3 4^n} $$ I hope that this latex code is self-explaining for those who aren't used to it ;-) Regards, Andreas Karrenbauer _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel