mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
minor correction in the name of the texture sampler
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1149,7 +1149,7 @@ public class PShader implements PConstants {
|
||||
|
||||
textureLoc = getUniformLoc("texture");
|
||||
if (textureLoc == -1) {
|
||||
textureLoc = getUniformLoc("texSampler");
|
||||
textureLoc = getUniformLoc("texMap");
|
||||
}
|
||||
|
||||
texMatrixLoc = getUniformLoc("texMatrix");
|
||||
|
||||
Reference in New Issue
Block a user