PDA

View Full Version : PBO + texture non 2n sized texture



tiboy
04-15-2008, 02:06 AM
Hello,

we want to download a PBO into a texture, we use glTexSubImage2D but it works with only 2n sized (512x256) texture but we want to use a 640x480 for example.. Is someone know a function to do this can he help me ???

Thanks

Dark Photon
04-15-2008, 05:09 AM
we use glTexSubImage2D but it works with only 2n sized (512x256) texture
What makes you think so? OpenGL supports it just fine. It's more likely your hardware/driver does not support other than power-of-two textures.

However, to be sure, see if your implementation supports either of these extensions:
ARB_texture_non_power_of_two (http://www.opengl.org/registry/specs/ARB/texture_non_power_of_two.txt) ARB_texture_rectangle (http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt)If it does, you can create and manipulate non-power-of-two textures.

ProsperLOADED
04-15-2008, 08:03 AM
You can also create a power of two texture bigger than the dimension you actualy need and only use a subset of it (in your example, a 1024x512 texture would be fine).

Of course, this wastes some video memory but at least it works on all video cards.

Also, be aware that some cards may support NPOT textures but are quite slow when you use them (some may fall back to software mode), especially if you apply linear filtering to it.

V-man
04-15-2008, 05:12 PM
Hello,

we want to download a PBO into a texture, we use glTexSubImage2D but it works with only 2n sized (512x256) texture but we want to use a 640x480 for example.. Is someone know a function to do this can he help me ???

Thanks

Specifically, what GPU, OS, driver are we talking about?
Can you provide code and binary so that people can test?