Power of 2??? (Simple answer:)

Started by
3 comments, last by TerraX 22 years, 8 months ago
A quik question ............. OpenGL textures have to be to the power of 2...... BUT... what does that mean? TerraX<---Fik I know textures have to be 16x16, 128x128, 512x128 etc But What I''m asking is, what exactly does "The power of" mean? A simple math question I know, but I#ve forgotten!!!
Advertisement
2^0 = 1
2^1 = 2
2^2 = 2 * 2 = 4
2^3 = 2 * 2 * 2 = 8
2^4 = 2 * 2 * 2 * 2 = 16
2^5 = 2 * 2 * 2 * 2 * 2 = 32

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
Cheerz GKW, I knew the answer really, I was just testing ya!!!

The reasone I asked is because, in a forum somewhere, someone asked how to display 800x600 textures without wasting space and using 1024x1024 ones, someone replied to this with something like this.....

"You can use textures to the power of 2, try using 804 x 512 as these dimensions are to the power of 2"

Not the exact wording, but the 804 part was definatly correct and that''s why I got confused

Was this person that was replying drunk? Or what!?

Well, 804 is definitely not a power of 2 (unless you count 9.651015 to be a valid power ). However, you don''t have to use powers of 2 if you mipmap the image. I don''t remember the tut number of NeHe''s that does that, but mipmapping kills the restriction of images having to be 2^n x 2^m for some integers n and m.

~ Dragonus
Lol! Cheerz Dragonus

This topic is closed to new replies.

Advertisement