From e1f4b82d3c1d16490fc4fa4a4a48294ad4e79d99 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Sat, 26 Oct 2013 22:06:25 -0400 Subject: [PATCH] minor correction in the name of the texture sampler --- core/src/processing/opengl/PGL.java | 12 ++++++------ core/src/processing/opengl/PJOGL.java | 6 +++--- core/src/processing/opengl/PShader.java | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index b8b0d5bde..f1e43fcd1 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -201,19 +201,19 @@ public abstract class PGL { protected static String[] tex2DFragShaderSource = { SHADER_PREPROCESSOR_DIRECTIVE, - "uniform sampler2D texSampler;", + "uniform sampler2D texMap;", "varying vec2 vertTexCoord;", "void main() {", - " gl_FragColor = texture2D(texSampler, vertTexCoord.st);", + " gl_FragColor = texture2D(texMap, vertTexCoord.st);", "}" }; protected static String[] texRectFragShaderSource = { SHADER_PREPROCESSOR_DIRECTIVE, - "uniform sampler2DRect texSampler;", + "uniform sampler2DRect texMap;", "varying vec2 vertTexCoord;", "void main() {", - " gl_FragColor = texture2DRect(texSampler, vertTexCoord.st);", + " gl_FragColor = texture2DRect(texMap, vertTexCoord.st);", "}" }; @@ -907,7 +907,7 @@ public abstract class PGL { if (0 < tex2DShaderProgram) { tex2DVertLoc = getAttribLocation(tex2DShaderProgram, "position"); tex2DTCoordLoc = getAttribLocation(tex2DShaderProgram, "texCoord"); - tex2DSamplerLoc = getUniformLocation(tex2DShaderProgram, "texSampler"); + tex2DSamplerLoc = getUniformLocation(tex2DShaderProgram, "texMap"); } loadedTex2DShader = true; tex2DShaderContext = glContext; @@ -1033,7 +1033,7 @@ public abstract class PGL { if (0 < texRectShaderProgram) { texRectVertLoc = getAttribLocation(texRectShaderProgram, "position"); texRectTCoordLoc = getAttribLocation(texRectShaderProgram, "texCoord"); - texRectSamplerLoc = getUniformLocation(texRectShaderProgram, "texSampler"); + texRectSamplerLoc = getUniformLocation(texRectShaderProgram, "texMap"); } loadedTexRectShader = true; texRectShaderContext = glContext; diff --git a/core/src/processing/opengl/PJOGL.java b/core/src/processing/opengl/PJOGL.java index 3ee7b6e0d..597d63ae3 100644 --- a/core/src/processing/opengl/PJOGL.java +++ b/core/src/processing/opengl/PJOGL.java @@ -1117,9 +1117,9 @@ public class PJOGL extends PGL { line = line.replace("varying", "in"); line = line.replace("attribute", "in"); line = line.replace("gl_FragColor", "fragColor"); - line = line.replace("texture", "texSampler"); - line = line.replace("texSampler2D(", "texture("); - line = line.replace("texSampler2DRect(", "texture("); + line = line.replace("texture", "texMap"); + line = line.replace("texMap2D(", "texture("); + line = line.replace("texMap2DRect(", "texture("); fragSrc[i + 2] = line; } return fragSrc; diff --git a/core/src/processing/opengl/PShader.java b/core/src/processing/opengl/PShader.java index c7f996ff0..d7570c601 100644 --- a/core/src/processing/opengl/PShader.java +++ b/core/src/processing/opengl/PShader.java @@ -1149,7 +1149,7 @@ public class PShader implements PConstants { textureLoc = getUniformLoc("texture"); if (textureLoc == -1) { - textureLoc = getUniformLoc("texSampler"); + textureLoc = getUniformLoc("texMap"); } texMatrixLoc = getUniformLoc("texMatrix");