Fixed GLSL 100 shaders

texture() doesn't exist in glsl 100, it must use texture2D().
This commit is contained in:
victorfisac 2016-06-10 00:59:48 +02:00
parent 7b07b68bfd
commit 77f599885d
4 changed files with 4 additions and 4 deletions

View file

@ -26,7 +26,7 @@ void main()
} }
// Texel color fetching from texture sampler // Texel color fetching from texture sampler
vec4 texelColor = texture(texture0, fragTexCoord); vec4 texelColor = texture2D(texture0, fragTexCoord);
// Calculate final fragment color // Calculate final fragment color
if (texelColor.r < 0.3) tc = sum*sum*0.012 + texelColor; if (texelColor.r < 0.3) tc = sum*sum*0.012 + texelColor;

View file

@ -15,7 +15,7 @@ uniform vec4 fragTintColor;
void main() void main()
{ {
// Texel color fetching from texture sampler // Texel color fetching from texture sampler
vec4 texelColor = texture(texture0, fragTexCoord)*fragTintColor*fragColor; vec4 texelColor = texture2D(texture0, fragTexCoord)*fragTintColor*fragColor;
// Convert texel color to grayscale using NTSC conversion weights // Convert texel color to grayscale using NTSC conversion weights
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114)); float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));

View file

@ -26,7 +26,7 @@ void main()
} }
// Texel color fetching from texture sampler // Texel color fetching from texture sampler
vec4 texelColor = texture(texture0, fragTexCoord); vec4 texelColor = texture2D(texture0, fragTexCoord);
// Calculate final fragment color // Calculate final fragment color
if (texelColor.r < 0.3) tc = sum*sum*0.012 + texelColor; if (texelColor.r < 0.3) tc = sum*sum*0.012 + texelColor;

View file

@ -15,7 +15,7 @@ uniform vec4 colDiffuse;
void main() void main()
{ {
// Texel color fetching from texture sampler // Texel color fetching from texture sampler
vec4 texelColor = texture(texture0, fragTexCoord)*colDiffuse*fragColor; vec4 texelColor = texture2D(texture0, fragTexCoord)*colDiffuse*fragColor;
// Convert texel color to grayscale using NTSC conversion weights // Convert texel color to grayscale using NTSC conversion weights
float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114)); float gray = dot(texelColor.rgb, vec3(0.299, 0.587, 0.114));