OpenGL and large texture bitmaps

I’m trying to use a large (1024x1024) bitmap as a texture. I started
with the texbind.rb example in the ruby opengl package.

The problem is that this code gives me a GL_INVALID_VALUE error for any
bitmap larger than 256x256. I’ve tried using both RGB and RGBA formats,
with appropriate modifications to the GL calls.

This is probably not a problem with the ruby opengl package, but with my
understanding of opengl, so it may be off topic. But if anyone here
wants to take a look, the two files are at:

http://PATH.Berkeley.EDU/~vjoel/ruby/texture-bug/

The first few lines of bug.rb explains how to generate the problem (in
the 1024x1024 and 512x512 cases) and how to avoid the problem (by
cutting the image down to 256x256). Thanks for any help!

I think I saw this on ‘comp.graphics.api.opengl’ yesterday.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&threadm=bajfug%24eoic%241%40ID-44132.news.dfncis.de&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DISO-8859-1%26safe%3Doff%26q%3Dopengl%2Btexture%2Bsize%2Bmax%2Bbindtexture

···

On Tue, 27 May 2003 06:12:21 +0900, Joel VanderWerf wrote:

I’m trying to use a large (1024x1024) bitmap as a texture. I started
with the texbind.rb example in the ruby opengl package.

The problem is that this code gives me a GL_INVALID_VALUE error for any
bitmap larger than 256x256. I’ve tried using both RGB and RGBA formats,
with appropriate modifications to the GL calls.

This is probably not a problem with the ruby opengl package, but with my
understanding of opengl, so it may be off topic. But if anyone here
wants to take a look, the two files are at:

http://PATH.Berkeley.EDU/~vjoel/ruby/texture-bug/

The first few lines of bug.rb explains how to generate the problem (in
the 1024x1024 and 512x512 cases) and how to avoid the problem (by
cutting the image down to 256x256). Thanks for any help!


Simon Strandgaard

What graphics hardware are you using? IIRC, many of the Voodoo-based
cards cannot handle textures larger than 256 pixels square.

Paul

···

On Tue, May 27, 2003 at 05:12:21AM +0900, Joel VanderWerf wrote:

The problem is that this code gives me a GL_INVALID_VALUE error for any
bitmap larger than 256x256. I’ve tried using both RGB and RGBA formats,
with appropriate modifications to the GL calls.

Paul Brannan wrote:

···

On Tue, May 27, 2003 at 05:12:21AM +0900, Joel VanderWerf wrote:

The problem is that this code gives me a GL_INVALID_VALUE error for any
bitmap larger than 256x256. I’ve tried using both RGB and RGBA formats,
with appropriate modifications to the GL calls.

What graphics hardware are you using? IIRC, many of the Voodoo-based
cards cannot handle textures larger than 256 pixels square.

Ah. It’s an Intel 815 (on a 2 yr old sony laptop). I will try to find
someone at work with a decent card.

Anyone happen to know an other way of displaying a bitmap as a
background for an OpenGL scene? (I guess I should ask this on
comp.something.else.)

Paul Brannan wrote:

What graphics hardware are you using? IIRC, many of the Voodoo-based
cards cannot handle textures larger than 256 pixels square.

Ah. It’s an Intel 815 (on a 2 yr old sony laptop). I will try to find
someone at work with a decent card.

I don’t know of any such limitations on the i815 chipset, but I’m not up
on laptop graphics.

Anyone happen to know an other way of displaying a bitmap as a
background for an OpenGL scene?

You can load the images as separate 256x256 textures, and display the
image using multiple polygons instead of a single rectangle. This will
ensure that your code will work on a wide range of graphics hardware.
You should be careful with the way you scale the images, so that no
seams appear between them.

A better solution might be to use glDrawPixels to draw the background
image.

A final alternative is to use non-opengl primitives to draw the
background image, then use opengl to draw your scene.

(I guess I should ask this on comp.something.else.)

Probably so.

Paul

···

On Wed, May 28, 2003 at 01:00:00PM +0900, Joel VanderWerf wrote: