#### Archived

This topic is now archived and is closed to further replies.

# Power of 2??? (Simple answer:)

This topic is 6200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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!!!

##### Share on other sites
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

##### Share on other sites
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

##### Share on other sites
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

##### Share on other sites
Lol! Cheerz Dragonus

1. 1
2. 2
3. 3
Rutin
21
4. 4
5. 5
gaxio
10

• 14
• 30
• 13
• 11
• 11
• ### Forum Statistics

• Total Topics
631778
• Total Posts
3002310
×