OpenGL: convert old texture2D calls in built-in shaders

This commit is contained in:
2017-05-19 11:02:32 -04:00
parent fa47437426
commit 648f2a61ad
9 changed files with 10 additions and 19 deletions

View File

@@ -1,12 +1,11 @@
in vec2 texCoord_interp;
out vec4 fragColor;
#define texture2D texture
uniform vec4 color;
uniform sampler2D image;
void main()
{
fragColor = texture2D(image, texCoord_interp).r * color;
fragColor = texture(image, texCoord_interp).r * color;
}

View File

@@ -1,12 +1,11 @@
in vec2 texCoord_interp;
out vec4 fragColor;
#define texture2D texture
uniform vec4 color;
uniform sampler2D image;
void main()
{
fragColor = texture2D(image, texCoord_interp) * color;
fragColor = texture(image, texCoord_interp) * color;
}

View File

@@ -1,7 +1,6 @@
in vec2 texCoord_interp;
out vec4 fragColor;
#define texture2D texture
uniform float znear;
uniform float zfar;
@@ -9,7 +8,7 @@ uniform sampler2D image;
void main()
{
float depth = texture2D(image, texCoord_interp).r;
float depth = texture(image, texCoord_interp).r;
/* normalize */
fragColor.rgb = vec3((2.0f * znear) / (zfar + znear - (depth * (zfar - znear))));

View File

@@ -6,7 +6,6 @@
:n vec2 texCoord_interp;
out vec4 fragColor;
#define texture2DRect texture
uniform int interlace_id;
uniform sampler2DRect image_a;
@@ -28,8 +27,8 @@ bool interlace()
void main()
{
if (interlace()) {
fragColor = texture2DRect(image_a, texCoord_interp);
fragColor = texture(image_a, texCoord_interp);
} else {
fragColor = texture2DRect(image_b, texCoord_interp);
fragColor = texture(image_b, texCoord_interp);
}
}

View File

@@ -1,13 +1,12 @@
in vec2 texCoord_interp;
out vec4 fragColor;
#define texture2D texture
uniform sampler2D image;
uniform vec4 color;
void main()
{
fragColor.a = texture2D(image, texCoord_interp).a * color.a;
fragColor.a = texture(image, texCoord_interp).a * color.a;
fragColor.rgb = color.rgb;
}

View File

@@ -1,13 +1,12 @@
in vec2 texCoord_interp;
out vec4 fragColor;
#define texture2D texture
uniform float alpha;
uniform sampler2D image;
void main()
{
fragColor = texture2D(image, texCoord_interp);
fragColor = texture(image, texCoord_interp);
fragColor.a *= alpha;
}

View File

@@ -1,13 +1,12 @@
in vec2 texCoord_interp;
out vec4 fragColor;
#define texture2DRect texture
uniform float alpha;
uniform sampler2DRect image;
void main()
{
fragColor = texture2DRect(image, texCoord_interp);
fragColor = texture(image, texCoord_interp);
fragColor.a *= alpha;
}

View File

@@ -1,7 +1,6 @@
in vec2 texCoord_interp;
out vec4 fragColor;
#define texture2D texture
uniform sampler2D image;
uniform vec4 color;
@@ -9,7 +8,7 @@ uniform vec4 shuffle;
void main()
{
vec4 sample = texture2D(image, texCoord_interp);
vec4 sample = texture(image, texCoord_interp);
fragColor = vec4(sample.r * shuffle.r +
sample.g * shuffle.g +
sample.b * shuffle.b +

View File

@@ -2,7 +2,6 @@
flat in vec4 color_flat;
noperspective in vec2 texCoord_interp;
out vec4 fragColor;
#define texture2D texture
uniform sampler2D glyph;
@@ -12,5 +11,5 @@ void main()
fragColor.rgb = color_flat.rgb;
// modulate input alpha & texture alpha
fragColor.a = color_flat.a * texture2D(glyph, texCoord_interp).r;
fragColor.a = color_flat.a * texture(glyph, texCoord_interp).r;
}