Vidya Sagar wrote:
Hi all,
Why the texture mapping hardware restricts the
dimensions of a texture to be in powers of two. Is
there any specific reason behind it? My guess is...
may be the interpolations become easy during the
filtering operations. Is it correct? Are there any
more explanations?
Any answers are appreciated!!!
Think that you need to access pixel at coordinates 45x37. With power of
two dimensions, location in memory will be something like
37<<n + 45
(where n is number of bits in width) which is VERY fast, especially that
you do not even need an addition - simple OR is enough
37<<n | 45
plus the fact that you do not need to wait for left side to evaluate, as
right side will never go over it.
With non-power-of-two size, you would need to do something like
37*width+45
and this is at least order of magnitude slower - and you need to make
texture lookups VERY, VERY often inside hardware (especially if you will
consider bi/trilinear filtering etc).
Additionally it simplifies mipmapping etc, but major reason is just a
speed of access to a random pixel.
Artur
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".