OpenGL set a texture with non power of two

Previous topic - Next topic

Schranz0r

Hey my friends,

i have a question about OpenGL:
If i try to set a texture (100x100 pixel) to  GL_QUADS it works fine.
But if i try to draw only 1/4 of the texture (25x25 pixel) it doesen't work anymore...

If i try a texture in Power of Two it works fine.

My head begins to explode :D

texturecoords are:

0, 0
0.25, 0
0.25, 0.25
0, 0.25


any ideas?
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

MrTAToad

Perhaps there is a minimum size when a non-power-of-two graphic is used...

kanonet

Yes there is a minimum texture size. When texturing something you should always use power of two size.
BTW I recommend to use GL_STRIP instead if GL_QUADS, since quads are not supported on mobiles and are generally considered outdated.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Schranz0r

THX, i think i stay on power of 2 textures
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard