We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOpenGL and 3D Libraries › Errors trying to use the glgraphics examples
Page Index Toggle Pages: 1
Errors trying to use the glgraphics examples (Read 1560 times)
Errors trying to use the glgraphics examples
Oct 29th, 2008, 11:57pm
 
I get this:
Exception in thread "Animation Thread" java.lang.VerifyError: (class: codeanticode/glgraphics/GLTexture, method: getImage signature: (Lprocessing/core/PImage;)V) Bad access to protected data
at BasicUse.setup(BasicUse.java:41)
at processing.core.PApplet.handleDraw(PApplet.java:1372)
at processing.core.PApplet.run(PApplet.java:1300)
at java.lang.Thread.run(Unknown Source)

When attempting to use the 0.8.3 version of the glgraphics lib. I've got other gl-powered sketches going, so I know that the gl lib works and that my drivers are working. Is there any way to get this lib working for me? I'd -reeeeally- like to be able to have some soft glow working for my gig tomorrow Cheesy

I've tried it on proc 152, on xp and vista, and a radeon 9800 as well as an nvidia 8800, with fresh drivers everywhere.
Re: Errors trying to use the glgraphics examples
Reply #1 - Oct 30th, 2008, 5:38am
 
Does running on 0154 give the same error?
Re: Errors trying to use the glgraphics examples
Reply #2 - Oct 30th, 2008, 6:09am
 
No! It works in 154! \o/ Thanks!!!
Re: Errors trying to use the glgraphics examples
Reply #3 - Oct 30th, 2008, 8:57am
 
Hmmmm okay, well the examples worked...
but the built-in renderer that supports off-screen rendering, GLConstant.GLGRAPHICS, seems to be missing, in the latest version of GLTexture.

I tried a dozen combinations of
draw()
{
//draw a bunch of arcs, for example
loadPixels();
//copy the pixels to the GLTexture somehow
//then run them through the filters and .renderTexture
}

... I could only get the filters working on images loaded off of disk, I couldn't get the screen buffer loaded into the GLTextures to get filtered. Sad I was able to mess around with the pixels[] array manually inside a loadPixels();updatePixels(); pair... just couldn't get the sparks to fire, no matter how hard I banged the rocks together. I'm just trying to do the most basic filtering on the screen contents. Manual pixel-pushing is ---just--- not quite fast enough.
Re: Errors trying to use the glgraphics examples
Reply #4 - Oct 30th, 2008, 6:12pm
 
I'm not sure how you are trying to do off-screen rendering, the idea is to create a GLGraphicsOffScreen object where you draw to:

Code:

GLGraphicsOffScreen offscreen;

void setup()
{
size(640, 480, GLConstants.GLGRAPHICS);
offscreen = new GLGraphicsOffScreen(this, 320, 240);
}

void draw()
{
offscreen.beginDraw();
// All elements to be drawn to offscreen buffer go in here:
offscreen.fill(230, 50, 20);
offscreen.ellipse(10, 10, 40, 50);
...
offscreen.endDraw();

// The texture containing the off-screen image is drawn
// to the screen.
image(offscreen.getTexture(), 0, 0, width, height);
}


A more complete example is included the OffScreen sketch that comes with the library.

You can use the texture returned by offscreen.getTexture() to apply filters (glow, blur, etc):

Code:

offscreen.getTexture().filter(blurFilter, outTex);
image(outTex, 0, 0, width, height);

Re: Errors trying to use the glgraphics examples
Reply #5 - Oct 31st, 2008, 5:34am
 
This line fails:
 size(640, 480, GLConstants.GLGRAPHICS);
the constant isn't recognized.
Re: Errors trying to use the glgraphics examples
Reply #6 - Oct 31st, 2008, 7:00am
 
That's weird... did you remember to add

import processing.opengl.*;
import codeanticode.glgraphics.*;

at the beginning of your sketch?
Re: Errors trying to use the glgraphics examples
Reply #7 - Dec 7th, 2008, 9:32am
 
I just copied and pasted this sample code and it doesn't do anything.  Nothing's drawn onscreen and the canvas is just a default grey.

offscreen.set(50,50,color(255,0,0)); does draw a dot.

offscreen.rect(0,0,50,50); doesn't do anything.

offscreen.rect(0,0,offscreen.width,offscreen.height); does fill the screen.

Strangely, the Offscreen example provided with GLGraphics does work.

I'm on Processing 1.01 and GLGraphics 0.8.9.1.
Re: Errors trying to use the glgraphics examples
Reply #8 - Dec 7th, 2008, 9:07pm
 
yes, you are right, there is a problem with the projection matrices used for off-screen rendering. This code makes the problem more apparent:

Code:

import processing.opengl.*;
import codeanticode.glgraphics.*;

GLGraphicsOffScreen offscreen;

void setup()
{
size(640, 480, GLConstants.GLGRAPHICS);

offscreen = new GLGraphicsOffScreen(this, 320, 240);
}

void draw()
{
offscreen.beginDraw();
offscreen.background(0);
offscreen.fill(200, 10, 10);
offscreen.rect(mouseX/2.0,mouseY/2.0,50,50);
offscreen.endDraw();

image(offscreen.getTexture(), 0, 0, width, height);
}


I thought this was working fine... well, I'll see what's going on. Thanks for posting.
Re: Errors trying to use the glgraphics examples
Reply #9 - Dec 8th, 2008, 8:08pm
 
The problem is fixed now on version 0.8.9.2 of the library. Download from here:

https://sourceforge.net/project/showfiles.php?group_id=225391&package_id=272650&
release_id=645828
Re: Errors trying to use the glgraphics examples
Reply #10 - Dec 17th, 2008, 9:17pm
 
Hi, a posted a new release of GLGraphics today. The most important change is that it is compiled with Java 1.5 now, so this should solve the compatibility issues some people were experiencing. More info and download links here:

http://codeanticode.wordpress.com/2008/12/17/0894-release-of-glgraphics-and-roadmap/
Page Index Toggle Pages: 1