More concerns about using opengl for all graphical applications

Started by
17 comments, last by aewarnick 19 years, 1 month ago
Quote:Original post by aewarnick
The number I posted above is a power of 2.


I'm not sure I agree... ;¬)

Anyway, if you want to operate on images larger than the maximum supported by your vid card, you could always split them into smaller images as long as you remember to handle edge cases correctly (e.g. overlap onto the bordering texture). Should be a snap with GLSL.
[size="1"]
Advertisement
_the_phantom_ - 999x999=998001
Did I do something wrong?
*C++*->
Quote:Original post by aewarnick
_the_phantom_ - 999x999=998001
Did I do something wrong?


Power of two is 2^n.
2^0 = 1
2^1 = 2
2^2 = 4
2^3 = 8
...
2^10 = 1024
etc.

EDIT: 998001 would be between 2^19 (524288) and 2^20 (1048576)
Wrong, but hardly inexcuseable ;¬) By 'power of 2' we mean a texture where the length/width is '2 to the nth power' and you interpreted it as 'n to the second power'. Hardly surprising given the way the term is thrown around, really.
[size="1"]
A power of 2 is say, 2^16 2^32 2^999, 999 * 999 is NOT a power of 2, it is 999 ^ 2. 2^x will be power of 2, x can be any whole number (positive nonzero integer, er maybe 0 is whole also ive forgotten) hope that helps
-Dan

PS: why would you ever need to modify an image that big anyways? unless your doing some poster work or something...
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
The extreme image size was just to illustrate my point.
Still confused about this power of 2 thing.
Would it be 2*999*999?
*C++*->
No.

A texture has a width and a height. Both of these need to be a power-of-two. So the width can be 2^0=1, 2^1=2, 2^2=4, 2^3=8, 2^4=16....2^x. The height can be a different number, but it has to be one of those numbers as well.

So if you want to use a texture with width and height 999 (as in your example) that wouldn't work. However, you can put that square of 999x999 into a larger texture of size 1024x1024 (1024 is 2^10). And you can go larger than that if you want.
Quote:Original post by aewarnick
The extreme image size was just to illustrate my point.
Still confused about this power of 2 thing.
Would it be 2*999*999?


no, it is 2*2*2*2*2*...(add 993 more '2*' here)...2

Now I understand perfectly!
BTW, someone should tell the moderators that the rating page needs to be a separate page that pops up then closes when you rate like vbforums.com does. I get tired of going back to the page I was on and scrolling down again.
*C++*->

This topic is closed to new replies.

Advertisement