org.lwjgl.opengl.OpenGLException: Invalid value (1281)

Started by JudoVana, November 02, 2006, 10:35:23

Previous topic - Next topic

JudoVana

The whole report:

org.lwjgl.opengl.OpenGLException: Invalid value (1281)
org.lwjgl.opengl.OpenGLException: Invalid value (1281)
at org.lwjgl.opengl.Util.checkGLError(Util.java:56)
at org.lwjgl.opengl.Display.swapBuffers(Display.java:567)
at org.lwjgl.opengl.Display.update(Display.java:583)

It hapend to me whan im trying to manipulate too big textures.
But it hapend to me also if i relese all textures holded (using glDeleteTexts)and load a new big one. (which i was able to upload to "fresh memory."

In fact im not sure how memory handling of graphic card is working.

Are there any restrictions? OGL does not "DISCARD" textures when programmer is tryying to upoad new one? I have ge force 6600 256m
intel centrino, 1g ram, win xp

ndhb

Usually this error message is thrown when you use the GL API in undefined ways. That is, using values outside specifications. There's a reserved error message for running out of memory (GL_OUT_OF_MEMORY) and this is not it. You should look for errors in the values you supply to the driver. Please try and post the source code that generates these errors and what you're trying to accomplish with it.

JudoVana

Code is simple. Load an jpeg image. (non square, but not worse then 1:2), and drawt like gl_quad. The txture is realy big about 1500*2000 px. The laoding procedure works perfect(on litle images ). And maping is aso tested deeply(even in 3ds files).
The errors ocuures in flush() or finish() or swapbuffers. Not in "my code"
I feer that this is "not enough memory: in graffic card and this is the part of programing i do not know much.

ndhb

Well. I and many others have no problems whatsoever loading textures size 4096x4096 and using them. You shouldn't have memory problems if your card has 256Mb thats obvious. It's after flusing/swapbuffers that LWJGL checks for errors and throws an exception if something is wrong. What is the EXACT size of your texture?

JudoVana

Applcation is for working with photos; so textures are photos. Even scenned ones. So a) no 2^m x 2^n is respected. b) the proprtion is (in the worst case 3:1; more (panoramas:)) is cut to this proportion)   somewere around 9:13 :)
Photos larger then 6000000px^2  are resized to this value. All is working in RGBA mode.

ndhb

What do you mean by "Photos larger then 6000000px^2 are resized to this value" - 6.000.000^2 is 36 * 10^12 - magnitudes larger than max. texture size...

What does your driver rapport about max. texture size? Use glGet* or HardwareInfos (http://www.ozone3d.net/hardware_infos.php).

Have you tried using a texture with a dimension of 2048x2048 and see if you have same problem?

JudoVana

No no. It means that I resized all textures greater then n x m pixels (in original size) (where m*n >6000000 to p*q<600000 where p*d=n and q*d=m. My graphics card have an max texture size 4096x4096 (what about unot square txtures?) thanx for glGet idea.

yes. I used texexture 2048*2048 befor - no problems

ndhb

Are you building mipmaps? (could the error come from GLU?). It's hard to guess the problem without more information, should consider posting the source.

JudoVana

No i do not create mipmaps (becasue of memory)
I will try to prepare an source code for "extern using" (it wos only for mi private using so i do no comment and so on and so on...)I t is netbeans proect an it have a lot of data (images) whitch are nesesary for running the aplication. But i mus admit that the problems now stopped. I dont understand.  Mayby it get scared you wil doscover them;)

wolf_m

Commnting won't be necessary unless you do some really scary stuff  :wink:
And we won't attempt to run the source, at least not me.

It would be helpful if you reproduced the error, debugged the application to find out where the error occurs and then show us all code that is directly related to that incident. I'm not sure, but I think it's not related to your source images, could be wrong though.

You can check for GL errors by calling GL11.glGetError()  and checking whether the result is GL11.GL_NO_ERROR. That way, you can easily spot where the problem occurs. Don't forget to get the call out of your code once you're done because it really slows down things.

JudoVana

Thanx you very much. The error was thrown because i exceted maxtexture size. In siomething lik < x <= :((  
And pls... Do you know how old cards dysplais nonsquare and not 2^&m x 2^n textures?
And... haow to use glGetInteger(GL..., ???);

IntBuffer i=BufferUtils.createIntBuffer(100000);
 GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE,i);

this code stil throw nullpointerexception