diff --git a/core/src/processing/opengl/PShader.java b/core/src/processing/opengl/PShader.java index 0f2c92490..a6e37b84e 100644 --- a/core/src/processing/opengl/PShader.java +++ b/core/src/processing/opengl/PShader.java @@ -117,7 +117,7 @@ public class PShader implements PConstants { protected int modelviewMatLoc; protected int projectionMatLoc; protected int ppixelsLoc; - protected int bufferUnit; + protected int ppixelsUnit; protected int viewportLoc; // Uniforms only for lines and points @@ -1210,12 +1210,12 @@ public class PShader implements PConstants { } if (-1 < ppixelsLoc) { - bufferUnit = getLastTexUnit() + 1; - setUniformValue(ppixelsLoc, bufferUnit); - pgl.activeTexture(PGL.TEXTURE0 + bufferUnit); + ppixelsUnit = getLastTexUnit() + 1; + setUniformValue(ppixelsLoc, ppixelsUnit); + pgl.activeTexture(PGL.TEXTURE0 + ppixelsUnit); currentPG.bindFrontTexture(); } else { - bufferUnit = -1; + ppixelsUnit = -1; } } @@ -1306,7 +1306,7 @@ public class PShader implements PConstants { if (-1 < ppixelsLoc) { pgl.requestFBOLayer(); - pgl.activeTexture(PGL.TEXTURE0 + bufferUnit); + pgl.activeTexture(PGL.TEXTURE0 + ppixelsUnit); currentPG.unbindFrontTexture(); pgl.activeTexture(PGL.TEXTURE0); } @@ -1341,7 +1341,7 @@ public class PShader implements PConstants { setUniformValue(texOffsetLoc, 1.0f / tex.width, 1.0f / tex.height); if (-1 < textureLoc) { - texUnit = -1 < bufferUnit ? bufferUnit + 1 : getLastTexUnit() + 1; + texUnit = -1 < ppixelsUnit ? ppixelsUnit + 1 : getLastTexUnit() + 1; setUniformValue(textureLoc, texUnit); pgl.activeTexture(PGL.TEXTURE0 + texUnit); tex.bind();