Is this a shader problem or a processing problem

edited October 2015 in GLSL / Shaders

If I close the following sketch using the close mark:

Screen Shot 2015-10-08 at 5.06.07 PM

Then it doesn't go so well...

Screen Shot 2015-10-08 at 5.07.05 PM

#

A fatal error has been detected by the Java Runtime Environment:

#

SIGSEGV (0xb) at pc=0x00007fff941ef4bd, pid=1563, tid=66307

#

JRE version: Java(TM) SE Runtime Environment (8.0_51-b16) (build 1.8.0_51-b16)

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode bsd-amd64 compressed oops)

Problematic frame:

C [libGL.dylib+0x14bd] glDeleteTextures+0x12

#

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

#

An error report file with more information is saved as:

/Users/doekewartena/hs_err_pid1563.log

#

If you would like to submit a bug report, please visit:

http://bugreport.java.com/bugreport/crash.jsp

The crash happened outside the Java Virtual Machine in native code.

See problematic frame for where to report the bug.

# Could not run the sketch (Target VM failed to initialize). Make sure that you haven't set the maximum available memory too high. For more information, read revisions.txt and Help → Troubleshooting.

PShader psBlendLightest;

PGraphics pg;
PGraphics textureB;


void settings() {
  size(512, 512, P2D);
}

void setup() {

  pg = createGraphics(512, 512, P2D);  
  pg.beginDraw();
  pg.background(0);
  pg.fill(255);
  pg.quad(25, 25, 400, 40, 450, 500, 40, 300);
  pg.endDraw();

  textureB = createGraphics(512, 512, P2D); 
  textureB.beginDraw();
  textureB.background(0);
  textureB.fill(255);
  textureB.ellipse(256, 256, 400, 400);
  textureB.endDraw();

  psBlendLightest = new PShader(this, "blend_lightest.vert", "blend_lightest.frag");

}

void draw() {
  image(pg, 0, 0);  
  psBlendLightest.set("texMapB", textureB);
  filter(psBlendLightest);
}

shader vert

#version 410

uniform mat4 transform;

in vec4 vertex;
in vec4 color;
in vec4 texCoord;

out vec4 vertColor; 
out vec4 vertTexCoord;

void main() {
    gl_Position = transform * vertex;
    vertColor = color;
    vertTexCoord = texCoord;
}

shader frag

#version 410

uniform sampler2D texture;
uniform sampler2D texMapB;

in vec4 vertTexCoord;

out vec4 fragColor; 

void main() {
    fragColor = max(texture(texture, vertTexCoord.xy).rgba, texture(texMapB, vertTexCoord.xy).rgba);
}

Mac OS X.

Is this something wrong on my side or is this a processing bug?

Answers

  • Are you using Processing 3?

  • yes! On Mac OS X

  • edited October 2015

    A segfault (SIGSEGV) in glDeleteTextures (outside the Java Virtual Machine in native code)? Sounds like either multiple threads are trying to access one OpenGL instance at the same time (which could point to a Processing bug) or your graphics card driver is flawed.

    A possible scenario would be that you are compiling your sketch and closing it via ESC or the sketch window's X button, but it's thread and therefore an OpenGL instance keeps running in the background. That happens to me quite often. Upon closing the Processing window the still running background thread is now forcefully closed from the Editor's thread and crashes.

  • I will press more command + q then :)

Sign In or Register to comment.