diff --git a/wadsrc/static/shaders/glsl/burn.fp b/wadsrc/static/shaders/glsl/burn.fp index 8ccb553f8..d14748212 100644 --- a/wadsrc/static/shaders/glsl/burn.fp +++ b/wadsrc/static/shaders/glsl/burn.fp @@ -1,12 +1,14 @@ uniform sampler2D tex; uniform sampler2D texture2; +in vec4 vTexCoord; +in vec4 vColor; void main() { - vec4 frag = gl_Color; + vec4 frag = vColor; - vec4 t1 = texture2D(texture2, gl_TexCoord[0].xy); - vec4 t2 = texture2D(tex, vec2(gl_TexCoord[0].x, 1.0-gl_TexCoord[0].y)); + vec4 t1 = texture2D(texture2, vTexCoord.xy); + vec4 t2 = texture2D(tex, vec2(vTexCoord.x, 1.0-vTexCoord.y)); gl_FragColor = frag * vec4(t1.r, t1.g, t1.b, t2.a); } diff --git a/wadsrc/static/shaders/glsl/func_brightmap.fp b/wadsrc/static/shaders/glsl/func_brightmap.fp index b8b2a9f20..bea336eb6 100644 --- a/wadsrc/static/shaders/glsl/func_brightmap.fp +++ b/wadsrc/static/shaders/glsl/func_brightmap.fp @@ -2,11 +2,11 @@ uniform sampler2D texture2; vec4 ProcessTexel() { - return getTexel(gl_TexCoord[0].st); + return getTexel(vTexCoord.st); } vec4 ProcessLight(vec4 color) { - vec4 brightpix = desaturate(texture2D(texture2, gl_TexCoord[0].st)); + vec4 brightpix = desaturate(texture2D(texture2, vTexCoord.st)); return vec4(min (color.rgb + brightpix.rgb, 1.0), color.a); } diff --git a/wadsrc/static/shaders/glsl/func_normal.fp b/wadsrc/static/shaders/glsl/func_normal.fp index d3b0d182c..184c14851 100644 --- a/wadsrc/static/shaders/glsl/func_normal.fp +++ b/wadsrc/static/shaders/glsl/func_normal.fp @@ -1,6 +1,6 @@ vec4 ProcessTexel() { - return getTexel(gl_TexCoord[0].st); + return getTexel(vTexCoord.st); } diff --git a/wadsrc/static/shaders/glsl/func_warp1.fp b/wadsrc/static/shaders/glsl/func_warp1.fp index 2dbf8a420..891eaa936 100644 --- a/wadsrc/static/shaders/glsl/func_warp1.fp +++ b/wadsrc/static/shaders/glsl/func_warp1.fp @@ -2,7 +2,7 @@ uniform float timer; vec4 ProcessTexel() { - vec2 texCoord = gl_TexCoord[0].st; + vec2 texCoord = vTexCoord.st; const float pi = 3.14159265358979323846; vec2 offset = vec2(0,0); diff --git a/wadsrc/static/shaders/glsl/func_warp2.fp b/wadsrc/static/shaders/glsl/func_warp2.fp index 78044f970..7cc5e7ebb 100644 --- a/wadsrc/static/shaders/glsl/func_warp2.fp +++ b/wadsrc/static/shaders/glsl/func_warp2.fp @@ -2,7 +2,7 @@ uniform float timer; vec4 ProcessTexel() { - vec2 texCoord = gl_TexCoord[0].st; + vec2 texCoord = vTexCoord.st; const float pi = 3.14159265358979323846; vec2 offset = vec2(0.0,0.0); diff --git a/wadsrc/static/shaders/glsl/func_wavex.fp b/wadsrc/static/shaders/glsl/func_wavex.fp index 5172239c7..e4230ae87 100644 --- a/wadsrc/static/shaders/glsl/func_wavex.fp +++ b/wadsrc/static/shaders/glsl/func_wavex.fp @@ -2,7 +2,7 @@ uniform float timer; vec4 ProcessTexel() { - vec2 texCoord = gl_TexCoord[0].st; + vec2 texCoord = vTexCoord.st; const float pi = 3.14159265358979323846; diff --git a/wadsrc/static/shaders/glsl/fuzz_jagged.fp b/wadsrc/static/shaders/glsl/fuzz_jagged.fp index 103f34689..c088c7b30 100644 --- a/wadsrc/static/shaders/glsl/fuzz_jagged.fp +++ b/wadsrc/static/shaders/glsl/fuzz_jagged.fp @@ -3,7 +3,7 @@ uniform float timer; vec4 ProcessTexel() { - vec2 texCoord = gl_TexCoord[0].st; + vec2 texCoord = vTexCoord.st; vec2 texSplat; const float pi = 3.14159265358979323846; diff --git a/wadsrc/static/shaders/glsl/fuzz_noise.fp b/wadsrc/static/shaders/glsl/fuzz_noise.fp index 02985a122..9f5da5f25 100644 --- a/wadsrc/static/shaders/glsl/fuzz_noise.fp +++ b/wadsrc/static/shaders/glsl/fuzz_noise.fp @@ -3,7 +3,7 @@ uniform float timer; vec4 ProcessTexel() { - vec2 texCoord = gl_TexCoord[0].st; + vec2 texCoord = vTexCoord.st; vec4 basicColor = getTexel(texCoord); texCoord.x = float( int(texCoord.x * 128.0) ) / 128.0; diff --git a/wadsrc/static/shaders/glsl/fuzz_smooth.fp b/wadsrc/static/shaders/glsl/fuzz_smooth.fp index 597debb53..4261d5415 100644 --- a/wadsrc/static/shaders/glsl/fuzz_smooth.fp +++ b/wadsrc/static/shaders/glsl/fuzz_smooth.fp @@ -3,7 +3,7 @@ uniform float timer; vec4 ProcessTexel() { - vec2 texCoord = gl_TexCoord[0].st; + vec2 texCoord = vTexCoord.st; vec4 basicColor = getTexel(texCoord); float texX = texCoord.x / 3.0 + 0.66; diff --git a/wadsrc/static/shaders/glsl/fuzz_smoothnoise.fp b/wadsrc/static/shaders/glsl/fuzz_smoothnoise.fp index 196cca33a..bfe04ec16 100644 --- a/wadsrc/static/shaders/glsl/fuzz_smoothnoise.fp +++ b/wadsrc/static/shaders/glsl/fuzz_smoothnoise.fp @@ -3,7 +3,7 @@ uniform float timer; vec4 ProcessTexel() { - vec2 texCoord = gl_TexCoord[0].st; + vec2 texCoord = vTexCoord.st; vec4 basicColor = getTexel(texCoord); float texX = sin(mod(texCoord.x * 100.0 + timer*5.0, 3.489)) + texCoord.x / 4.0; diff --git a/wadsrc/static/shaders/glsl/fuzz_smoothtranslucent.fp b/wadsrc/static/shaders/glsl/fuzz_smoothtranslucent.fp index bfd60de57..75bee0330 100644 --- a/wadsrc/static/shaders/glsl/fuzz_smoothtranslucent.fp +++ b/wadsrc/static/shaders/glsl/fuzz_smoothtranslucent.fp @@ -3,7 +3,7 @@ uniform float timer; vec4 ProcessTexel() { - vec2 texCoord = gl_TexCoord[0].st; + vec2 texCoord = vTexCoord.st; vec4 basicColor = getTexel(texCoord); float texX = sin(texCoord.x * 100.0 + timer*5.0); diff --git a/wadsrc/static/shaders/glsl/fuzz_standard.fp b/wadsrc/static/shaders/glsl/fuzz_standard.fp index a1bd0ebaf..fd87eaa46 100644 --- a/wadsrc/static/shaders/glsl/fuzz_standard.fp +++ b/wadsrc/static/shaders/glsl/fuzz_standard.fp @@ -3,7 +3,7 @@ uniform float timer; vec4 ProcessTexel() { - vec2 texCoord = gl_TexCoord[0].st; + vec2 texCoord = vTexCoord.st; vec4 basicColor = getTexel(texCoord); texCoord.x = float( int(texCoord.x * 128.0) ) / 128.0; diff --git a/wadsrc/static/shaders/glsl/fuzz_swirly.fp b/wadsrc/static/shaders/glsl/fuzz_swirly.fp index de91e47d6..86a66ac8e 100644 --- a/wadsrc/static/shaders/glsl/fuzz_swirly.fp +++ b/wadsrc/static/shaders/glsl/fuzz_swirly.fp @@ -3,7 +3,7 @@ uniform float timer; vec4 ProcessTexel() { - vec2 texCoord = gl_TexCoord[0].st; + vec2 texCoord = vTexCoord.st; vec4 basicColor = getTexel(texCoord); float texX = sin(texCoord.x * 100.0 + timer*5.0); diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp index 30a815b3c..6bb96aa9a 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -1,6 +1,8 @@ in vec4 pixelpos; in vec2 glowdist; +in vec4 vTexCoord; +in vec4 vColor; #ifdef SHADER_STORAGE_LIGHTS layout(std430, binding = 3) buffer ParameterBuffer @@ -120,7 +122,7 @@ float R_DoomLightingEquation(float light, float dist) vec4 getLightColor(float fogdist, float fogfactor) { - vec4 color = gl_Color; + vec4 color = vColor; if (uLightLevel >= 0.0) { @@ -193,7 +195,7 @@ vec4 getLightColor(float fogdist, float fogfactor) color.rgb = clamp(color.rgb + desaturate(dynlight).rgb, 0.0, 1.4); // prevent any unintentional messing around with the alpha. - return vec4(color.rgb, gl_Color.a); + return vec4(color.rgb, vColor.a); } //=========================================================================== @@ -291,14 +293,14 @@ void main() { float gray = (frag.r * 0.3 + frag.g * 0.56 + frag.b * 0.14); vec4 cm = uFixedColormapStart + gray * uFixedColormapRange; - frag = vec4(clamp(cm.rgb, 0.0, 1.0), frag.a*gl_Color.a); + frag = vec4(clamp(cm.rgb, 0.0, 1.0), frag.a*vColor.a); break; } case 2: { frag = frag * uFixedColormapStart; - frag.a *= gl_Color.a; + frag.a *= vColor.a; break; } @@ -320,7 +322,7 @@ void main() } fogfactor = exp2 (uFogDensity * fogdist); - frag = vec4(uFogColor.rgb, (1.0 - fogfactor) * frag.a * 0.75 * gl_Color.a); + frag = vec4(uFogColor.rgb, (1.0 - fogfactor) * frag.a * 0.75 * vColor.a); break; } } diff --git a/wadsrc/static/shaders/glsl/main.vp b/wadsrc/static/shaders/glsl/main.vp index 7a434ccbe..e1349857e 100644 --- a/wadsrc/static/shaders/glsl/main.vp +++ b/wadsrc/static/shaders/glsl/main.vp @@ -5,6 +5,9 @@ out vec4 pixelpos; out vec2 glowdist; #endif +out vec4 vTexCoord; +out vec4 vColor; + #ifdef UNIFORM_VB uniform float fakeVB[100]; #endif @@ -40,7 +43,7 @@ void main() vec4 eyeCoordPos = ViewMatrix * worldcoord; - gl_FrontColor = gl_Color; + vColor = gl_Color; #ifndef SIMPLE pixelpos.xyz = worldcoord.xyz; @@ -56,9 +59,9 @@ void main() vec3 r = reflect(u, n.xyz); float m = 2.0 * sqrt( r.x*r.x + r.y*r.y + (r.z+1.0)*(r.z+1.0) ); vec2 sst = vec2(r.x/m + 0.5, r.y/m + 0.5); - gl_TexCoord[0].xy = sst; + vTexCoord.xy = sst; #else - gl_TexCoord[0] = TextureMatrix * tc; + vTexCoord = TextureMatrix * tc; #endif gl_Position = ProjectionMatrix * eyeCoordPos;