Disambiguate texture name from texture() function in basic fragment shader

This commit is contained in:
Aaron Culliney 2015-11-14 08:09:10 -08:00
parent 0aacdfa9e5
commit 33160be9ac
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ varying vec2 varTexcoord;
// global alpha value
uniform float aValue;
uniform sampler2D texture;
uniform sampler2D aTexture;
#if __VERSION__ >= 140
#define OUTPUT_TEXTURE(TEX) vec4 tex = texture(TEX, varTexcoord.st, 0.0); fragColor = vec4(tex.r, tex.g, tex.b, tex.a*aValue)
@ -31,5 +31,5 @@ uniform sampler2D texture;
void main(void)
{
OUTPUT_TEXTURE(texture);
OUTPUT_TEXTURE(aTexture);
}

View File

@ -428,7 +428,7 @@ static GLuint _build_program(demoSource *vertexSource, demoSource *fragmentSourc
// Setup common program input points //
///////////////////////////////////////
texSamplerLoc = glGetUniformLocation(prgName, "texture");
texSamplerLoc = glGetUniformLocation(prgName, "aTexture");
if (texSamplerLoc < 0) {
LOG("OOPS, no framebufferTexture shader : %d", texSamplerLoc);
} else {