Shaders output to bottom left corner rather than full window in 3.0b2 #3572

Closed
gsuberland opened this Issue Aug 11, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@gsuberland

When applying shaders, I'm getting the post-processed output shown in the bottom left quarter of the window, and the original shown behind in the full window.

Here's my code:

PShader testShader;

void setup()
{
  size(1280, 1024, P3D); 
  background(0);
  fill(255);
  stroke(0);
  testShader = loadShader("simple.glsl");
}

void draw()
{
  background(0);
  float frameTime = float(millis());

  pushMatrix();
  translate((width / 2) + (sin(frameTime / 1000.0) * 512), height / 2);
  rotateX(0.2);
  rotateY(0.4);
  box(200);
  popMatrix();

  filter(testShader);
}

Here's simple.glsl:

#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif

#define PROCESSING_TEXTURE_SHADER

uniform sampler2D texture;

varying vec4 vertColor;
varying vec4 vertTexCoord;

void main() {
    gl_FragColor = texture2D(texture, vertTexCoord.st);
}

Hardware is as follows:

  • GTX 980 Ti G1 Gaming 6144MB
  • Intel i7-4790K
  • Asus Maximus VII Hero
  • 32GB RAM
  • 4K + 1920x1200 monitors, Processing settings using 4K (primary) as default.

OS is Windows 10, but I've confirmed this on 8.1 on the same hardware too. The exact same code works perfectly in Processing 2.2.1.

Screenshots:

processing3_bug

processing3_bug2

@codeanticode codeanticode added the opengl label Aug 11, 2015

@codeanticode codeanticode self-assigned this Aug 11, 2015

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Aug 11, 2015

Member

changing this line to

modelview.translate(0, -height); 

fixes the problem, but not sure why @JakubValtar could you take a look?

Member

codeanticode commented Aug 11, 2015

changing this line to

modelview.translate(0, -height); 

fixes the problem, but not sure why @JakubValtar could you take a look?

@codeanticode

This comment has been minimized.

Show comment
Hide comment
@codeanticode

codeanticode Aug 11, 2015

Member

found the actual reason, fixed with 715a4e8

Member

codeanticode commented Aug 11, 2015

found the actual reason, fixed with 715a4e8

@gsuberland

This comment has been minimized.

Show comment
Hide comment
@gsuberland

gsuberland Aug 11, 2015

Thanks for the prompt fix! :)

Thanks for the prompt fix! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment