Problem with the file
in
Contributed Library Questions
•
6 months ago
- import processing.opengl.*;
- import codeanticode.glgraphics.*;
- import codeanticode.gsvideo.*;
- GSCapture cam;
- GLTexture bottomLayer, topLayer, resultLayer;
- GLTextureFilter blendFilter;
- ScalarParam opacity;
- class ScalarParam {
- float value;
- float minValue;
- float maxValue;
- float step;
- ScalarParam(float v,float mn, float mx, float s) {
- value = v;
- minValue = mn;
- maxValue = mx;
- step = s;
- }
- void Increment() {
- value += step;
- if (value > maxValue) value=maxValue;
- }
- void Decrement() {
- value -= step;
- if (value < minValue) value=minValue;
- }
- }
- void setup()
- {
- size(640, 480, GLConstants.GLGRAPHICS);
- cam = new GSCapture(this, 640, 480);
- blendFilter = new GLTextureFilter(this, "BlendDifference.xml");
- opacity = new ScalarParam(1.0,0.0,1.0,0.01);
- bottomLayer = new GLTexture(this, "background.jpg");
- topLayer = new GLTexture(this);
- cam.setPixelDest(topLayer);
- cam.start();
- resultLayer = new GLTexture(this, topLayer.width,topLayer.height);
- }
- void draw()
- {
- blendFilter.setParameterValue("Opacity", opacity.value);
- blendFilter.apply(new GLTexture[] {bottomLayer, topLayer}, resultLayer);
- resultLayer.render(0, 0);
- //image(resultLayer, 0, 0);
- }
- void keyPressed()
- {
- if (key == CODED) {
- if (keyCode == UP) opacity.Increment();
- else if (keyCode == DOWN) opacity.Decrement();
- }
- }
- void captureEvent(GSCapture cam) {
- cam.read();
- }
I need your help.
NullPointerException
GLGraphics version: 1.0.0
GSVideo version: 1.0.0
The file "BlendDifference.glsl" is missing or inaccessible, make sure the URL is valid or that the file has been added to your sketch and is readable.
Exception in thread "Animation Thread" java.lang.NullPointerException
at processing.core.PApplet.join(Unknown Source)
at codeanticode.glgraphics.GLSLShader.loadFragmentShader(Unknown Source)
at codeanticode.glgraphics.GLTextureFilter.initShader(Unknown Source)
at codeanticode.glgraphics.GLTextureFilter.initFilter(Unknown Source)
at codeanticode.glgraphics.GLTextureFilter.<init>(Unknown Source)
at sketch_mar17a.setup(sketch_mar17a.java:57)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
1