Error - java.lang.RuntimeException: Image width and height cannot be larger than

edited November 2016 in Using Processing

Hope someone can provide insight on a really bizarre error. I have lots of sketches that write to very large PGraphics. Never a problem. It's been a few months but earlier today I found that none of the several sketches I tested worked anymore. I'm on WIndows 7 with a NVIDIA GeForce GT 555M graphics card and running Processing 2.1 in 64bit mode. Critically, one thing all these sketches have in common is that they use P3D mode.

As of today, I get the following error on each sketch I tried to run:

Framebuffer error (unknown error), rendering will probably not work as expected Read http://wiki.processing.org/w/OpenGL_Issues for help.
OpenGL error 1286 at bot beginDraw(): invalid framebuffer operation
OpenGL error 1286 at top beginDraw(): invalid framebuffer operation
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Image width and height cannot be larger than 4096 with this graphics card.
    at processing.opengl.Texture.setSize(Texture.java:1131)
    at processing.opengl.Texture.init(Texture.java:210)
    at processing.opengl.Texture.<init>(Texture.java:157)
    at processing.opengl.PGraphicsOpenGL.loadTextureImpl(PGraphicsOpenGL.java:5434)
    at processing.opengl.PGraphicsOpenGL.initOffscreen(PGraphicsOpenGL.java:6027)
    at processing.opengl.PGraphicsOpenGL.beginOffscreenDraw(PGraphicsOpenGL.java:6073)
    at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:1642)
    at noiseRecedingShapePNG.setup(noiseRecedingShapePNG.java:56)
    at processing.core.PApplet.handleDraw(PApplet.java:2281)
    at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:799)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:590)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:574)
    at javax.media.opengl.awt.GLCanvas$9.run(GLCanvas.java:1218)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1036)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:911)
    at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1229)
    at javax.media.opengl.Threading.invoke(Threading.java:193)
    at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:492)
    at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:546)
    at sun.awt.RepaintArea.paintComponent(Unknown Source)
    at sun.awt.RepaintArea.paint(Unknown Source)
    at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Already called beginDraw()
java.lang.NullPointerException
    at processing.mode.java.runner.Runner.findException(Runner.java:926)
    at processing.mode.java.runner.Runner.reportException(Runner.java:871)
    at processing.mode.java.runner.Runner.exceptionEvent(Runner.java:797)
    at processing.mode.java.runner.Runner$2.run(Runner.java:686)

If I drop the size of the PGraphics down to smaller than my actual screen size, I get the following error:

Framebuffer error (unknown error), rendering will probably not work as expected Read http://wiki.processing.org/w/OpenGL_Issues for help.
OpenGL error 1286 at bot beginDraw(): invalid framebuffer operation
OpenGL error 1286 at top beginDraw(): invalid framebuffer operation
OpenGL error 1286 at top endDraw(): invalid framebuffer operation
OpenGL error 1286 at bot endDraw(): invalid framebuffer operation

Just for grins I decided to ditch the P3D qualifier on the size() and createGraphics() statement. Surprise - the sketches run fine.

My question is what the heck happened that I can apparently no longer use P3D in sketches?

Addendum: I run Processing 3 on my Linux laptop which also uses an NVIDIA card. Unfortunately I had to do a rebuild and post rebuild I discover that I'm getting the same error message over there (different sketches but using P3D and I have not dug as deep troubleshooting that one because I had to re-reinstall Ubuntu and haven't yet reinstalled Processing)

Thanks in advance to the wizard who can provide insight into this strange problem.

Answers

  • That says it's a texture size limitation, which will be graphics card specific (although 4096 is pretty standard). I don't know if something has changed recently so it uses textures for offscreen graphics.

    Depending on what you are doing you can probably keep the P3D on size, just not the create.

  • Hi Koogs, The thing is these are all sketches that were working fine. I have made no changes to this computer - or Processing - so why now, a few months since running any of these sketches, have they suddenly stopped working? That has me mystified.

    And note that the "fail" persists even when I drop the PGraphics to a size that is smaller than the stated size limit. While the size error and null pointer errors disappear, I get an OpenGL and framebuffer error.

    Note that I also have the Intel GPU in this laptop but I have configured Processing so that it runs using my NVIDIA card and I have confirmed that it is still doing so. Also as far as I can tell, NVIDIA is still working (made some cool glitch art on my old computer when its graphic card started to fail).

    I was really hoping that someone else had experienced this problem and had been able to trace it. For example, could this mean that something in the OpenGL environment has become corrupted - or that the driver became corrupted - in such a way that only Processing is impacted?

    This fail has me at a loss.

  • is this anything:

    noiseRecedingShapePNG

    ?

  • Hi Koogs, noiseRecedingShapePNG is the name of the sketch file itself.

  • Brainstorming: could a loaded graphics file have been replaced with a higher rez version? Could the sketch be loading a file over the internet, and the data at that URL has changed?

  • Hi Jeremy, No file loading over the internet. And no to the higher rez. Note that one of the sketches that fails loads nothing - it simply creates a PGraphics from scratch.

  • edited November 2016

    Are any of the problem sketches short enough / can any be made short enough that you could share the code of an MCVE here?

    Possibly report on github as a Processing issue?

  • Hi Jeremy,

    Re MCVE, unfortunately I don't have to. Taking the very simple P3D example from the current Processing doc - with the code following:

    float x,y,z;
    void setup() {
      size(200,200,P3D);
      x = width/2;
      y = height/2;
      z = 0;
    }
    void draw() {
      translate(x,y,z);
      rectMode(CENTER);
      rect(0,0,100,100);
      z++; // The rectangle moves forward as z increments.
    }
    

    I get the following error: Framebuffer error (unknown error), rendering will probably not work as expected Read http://wiki.processing.org/w/OpenGL_Issues for help. OpenGL error 1286 at bot beginDraw(): invalid framebuffer operation OpenGL error 1286 at bot endDraw(): invalid framebuffer operation

    It's a complete mystery to me as to where in the chain from sketch to screen the problem is happening. You will not that this OpenGL error is the same one I was getting with my original program once downsized to below the size exception error.

Sign In or Register to comment.