Explicitly define fragment exported values.

This commit is contained in:
Vincent Lejeune 2014-01-19 19:31:00 +01:00
parent bf52c2abf8
commit 859be83074
58 changed files with 172 additions and 85 deletions

View File

@ -3,6 +3,7 @@ uniform sampler2D tex;
uniform float low; uniform float low;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -12,5 +13,5 @@ void main()
col *= smoothstep(low, 0.9, luma); col *= smoothstep(low, 0.9, luma);
gl_FragColor = vec4(col, 1.0); FragColor = vec4(col, 1.0);
} }

View File

@ -2,6 +2,7 @@
uniform sampler2D tex; uniform sampler2D tex;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -9,5 +10,5 @@ void main()
col.xyz *= 10.0 * col.a; col.xyz *= 10.0 * col.a;
gl_FragColor = vec4(col.xyz, 1.); FragColor = vec4(col.xyz, 1.);
} }

View File

@ -2,11 +2,13 @@
uniform float power; uniform float power;
uniform sampler2D tex; uniform sampler2D tex;
out vec4 FragColor;
void main() void main()
{ {
vec4 col = texture(tex, gl_TexCoord[0].xy); vec4 col = texture(tex, gl_TexCoord[0].xy);
if (col.a < 0.5) if (col.a < 0.5)
discard; discard;
gl_FragColor = vec4(col.xyz, power); FragColor = vec4(col.xyz, power);
} }

View File

@ -18,9 +18,10 @@
uniform sampler2D tex; uniform sampler2D tex;
uniform float transparency; uniform float transparency;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
gl_FragColor = texture(tex, uv); FragColor = texture(tex, uv);
gl_FragColor.a *= transparency; FragColor.a *= transparency;
} }

View File

@ -4,6 +4,8 @@ uniform sampler2D caustictex;
uniform vec2 dir; uniform vec2 dir;
uniform vec2 dir2; uniform vec2 dir2;
out vec4 FragColor;
void main() void main()
{ {
vec2 tc = gl_TexCoord[0].xy; vec2 tc = gl_TexCoord[0].xy;
@ -14,5 +16,5 @@ void main()
col += caustic * caustic2 * 10.0; col += caustic * caustic2 * 10.0;
gl_FragColor = vec4(col, 1.0); FragColor = vec4(col, 1.0);
} }

View File

@ -5,6 +5,8 @@ uniform vec2 pixel;
uniform vec2 multi; uniform vec2 multi;
uniform int size; uniform int size;
out vec4 FragColor;
void main() void main()
{ {
float res = 0.0; float res = 0.0;
@ -22,5 +24,5 @@ void main()
float old = texture(oldtex, gl_TexCoord[0].xy).x; float old = texture(oldtex, gl_TexCoord[0].xy).x;
gl_FragColor = vec4(mix(old, res, 0.7)); FragColor = vec4(mix(old, res, 0.7));
} }

View File

@ -4,6 +4,7 @@ uniform vec3 inlevel;
uniform vec2 outlevel; uniform vec2 outlevel;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -25,5 +26,5 @@ void main()
col.rgb = (pow(((col.rgb * 255.0) - inBlack) / (inWhite - inBlack), col.rgb = (pow(((col.rgb * 255.0) - inBlack) / (inWhite - inBlack),
vec3(1.0 / inGamma)) * (outWhite - outBlack) + outBlack) / 255.0; vec3(1.0 / inGamma)) * (outWhite - outBlack) + outBlack) / 255.0;
gl_FragColor = vec4(col.rgb, 1.0); FragColor = vec4(col.rgb, 1.0);
} }

View File

@ -1,7 +1,9 @@
#version 130 #version 130
uniform ivec4 color; uniform ivec4 color;
out vec4 FragColor;
void main() void main()
{ {
gl_FragColor = vec4(color) / 255.; FragColor = vec4(color) / 255.;
} }

View File

@ -1,7 +1,9 @@
#version 130 #version 130
uniform vec3 col; uniform vec3 col;
out vec4 FragColor;
void main() void main()
{ {
gl_FragColor = vec4(col, 1.0); FragColor = vec4(col, 1.0);
} }

View File

@ -2,11 +2,13 @@
uniform vec3 col; uniform vec3 col;
uniform sampler2D tex; uniform sampler2D tex;
out vec4 FragColor;
void main() void main()
{ {
float alpha = texture(tex, gl_TexCoord[0].xy).a; float alpha = texture(tex, gl_TexCoord[0].xy).a;
if (alpha < 0.5) if (alpha < 0.5)
discard; discard;
gl_FragColor = vec4(col, 1.0); FragColor = vec4(col, 1.0);
} }

View File

@ -3,9 +3,10 @@ uniform sampler2D tex;
in vec2 uv; in vec2 uv;
in vec4 col; in vec4 col;
out vec4 FragColor;
void main() void main()
{ {
vec4 res = texture(tex, uv); vec4 res = texture(tex, uv);
gl_FragColor = vec4(res.xyz * col.xyz, res.a); FragColor = vec4(res.xyz * col.xyz, res.a);
} }

View File

@ -8,6 +8,8 @@ in vec2 uv;
in vec2 edger_uv; in vec2 edger_uv;
in float camdist; in float camdist;
out vec4 FragColor;
void main() void main()
{ {
vec2 tc = uv; vec2 tc = uv;
@ -39,5 +41,5 @@ void main()
col.b = step(offset.y, 0.0) * -offset.y; col.b = step(offset.y, 0.0) * -offset.y;
col.a = step(0.0, offset.y) * offset.y; col.a = step(0.0, offset.y) * offset.y;
gl_FragColor = col; FragColor = col;
} }

View File

@ -11,6 +11,7 @@ uniform vec3 campos;
uniform mat4 ipvmat; uniform mat4 ipvmat;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -29,5 +30,5 @@ void main()
fog = min(fog, fogmax); fog = min(fog, fogmax);
gl_FragColor = vec4(col, fog); FragColor = vec4(col, fog);
} }

View File

@ -5,6 +5,7 @@ uniform vec2 pixel;
// Gaussian separated blur with radius 3. // Gaussian separated blur with radius 3.
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -18,5 +19,5 @@ void main()
sum += texture(tex, vec2(X + 1.3333 * pixel.x, Y)) * 0.328125; sum += texture(tex, vec2(X + 1.3333 * pixel.x, Y)) * 0.328125;
sum += texture(tex, vec2(X + 3.0 * pixel.x, Y)) * 0.03125; sum += texture(tex, vec2(X + 3.0 * pixel.x, Y)) * 0.03125;
gl_FragColor = sum; FragColor = sum;
} }

View File

@ -5,6 +5,7 @@ uniform vec2 pixel;
// Gaussian separated blur with radius 3. // Gaussian separated blur with radius 3.
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -18,5 +19,5 @@ void main()
sum += texture(tex, vec2(X, Y + 1.3333 * pixel.y)) * 0.328125; sum += texture(tex, vec2(X, Y + 1.3333 * pixel.y)) * 0.328125;
sum += texture(tex, vec2(X, Y + 3.0 * pixel.y)) * 0.03125; sum += texture(tex, vec2(X, Y + 3.0 * pixel.y)) * 0.03125;
gl_FragColor = sum; FragColor = sum;
} }

View File

@ -5,6 +5,7 @@ uniform vec2 pixel;
// Gaussian separated blur with radius 6. // Gaussian separated blur with radius 6.
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -20,5 +21,5 @@ void main()
sum += texture(tex, vec2(X + 3.26667 * pixel.x, Y)) * 0.083313; sum += texture(tex, vec2(X + 3.26667 * pixel.x, Y)) * 0.083313;
sum += texture(tex, vec2(X + 5.13333 * pixel.x, Y)) * 0.00640869; sum += texture(tex, vec2(X + 5.13333 * pixel.x, Y)) * 0.00640869;
gl_FragColor = sum; FragColor = sum;
} }

View File

@ -5,6 +5,7 @@ uniform vec2 pixel;
// Gaussian separated blur with radius 6. // Gaussian separated blur with radius 6.
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -20,5 +21,5 @@ void main()
sum += texture(tex, vec2(X, Y + 3.26667 * pixel.y)) * 0.083313; sum += texture(tex, vec2(X, Y + 3.26667 * pixel.y)) * 0.083313;
sum += texture(tex, vec2(X, Y + 5.13333 * pixel.y)) * 0.00640869; sum += texture(tex, vec2(X, Y + 5.13333 * pixel.y)) * 0.00640869;
gl_FragColor = sum; FragColor = sum;
} }

View File

@ -2,6 +2,7 @@
uniform sampler2D tex; uniform sampler2D tex;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -15,5 +16,5 @@ void main()
col *= vec4(vec3(4.0), 1.5); col *= vec4(vec3(4.0), 1.5);
col.a *= 0.6; col.a *= 0.6;
gl_FragColor = col; FragColor = col;
} }

View File

@ -1,6 +1,7 @@
#version 130 #version 130
uniform sampler2D tex; uniform sampler2D tex;
uniform vec3 col; uniform vec3 col;
out vec4 FragColor;
void main() void main()
{ {
@ -13,5 +14,5 @@ void main()
res = res * vec4(mul); res = res * vec4(mul);
gl_FragColor = res; FragColor = res;
} }

View File

@ -6,6 +6,8 @@ uniform vec2 sunpos;
const float decaystep = 0.88; const float decaystep = 0.88;
out vec4 FragColor;
void main() void main()
{ {
vec2 texc = gl_TexCoord[0].xy; vec2 texc = gl_TexCoord[0].xy;
@ -26,5 +28,5 @@ void main()
decay *= decaystep; decay *= decaystep;
} }
gl_FragColor = vec4(col, 1.0) * 0.8; FragColor = vec4(col, 1.0) * 0.8;
} }

View File

@ -5,10 +5,13 @@ uniform sampler2D tex;
noperspective in vec3 nor; noperspective in vec3 nor;
in vec2 uv; in vec2 uv;
out vec4 Albedo;
out vec4 NormalDepth;
out vec4 Specular;
void main() void main()
{ {
gl_FragData[0] = texture(tex, uv); Albedo = texture(tex, uv);
gl_FragData[1] = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z); NormalDepth = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z);
gl_FragData[2] = vec4(0.); Specular = vec4(0.);
} }

View File

@ -26,6 +26,7 @@ uniform float transparency;
in vec2 uv; in vec2 uv;
noperspective in vec3 eyeVec; noperspective in vec3 eyeVec;
noperspective in vec3 normal; noperspective in vec3 normal;
out vec4 FragColor;
void main() void main()
{ {
@ -34,5 +35,5 @@ void main()
inter = 1.0 - inter; inter = 1.0 - inter;
float alpha = inter + 1.0;// * m; float alpha = inter + 1.0;// * m;
gl_FragColor = vec4(0.8, 0.16, 0.48, alpha); FragColor = vec4(0.8, 0.16, 0.48, alpha);
} }

View File

@ -28,6 +28,7 @@ uniform float transparency;
in vec2 uv; in vec2 uv;
noperspective in vec3 eyeVec; noperspective in vec3 eyeVec;
noperspective in vec3 normal; noperspective in vec3 normal;
out vec4 FragColor;
void main() void main()
{ {
@ -35,5 +36,5 @@ void main()
float m = texture(tex, vec2(0.5, uv.y)).r; float m = texture(tex, vec2(0.5, uv.y)).r;
float alpha = inter * inter * inter * inter * m; float alpha = inter * inter * inter * inter * m;
gl_FragColor = vec4(1.0, 1.0, 0.8, alpha); FragColor = vec4(1.0, 1.0, 0.8, alpha);
} }

View File

@ -6,6 +6,7 @@ uniform sampler2D specular_map;
uniform vec3 ambient; uniform vec3 ambient;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -16,5 +17,5 @@ void main()
float specmap = texture(specular_map, texc).x; float specmap = texture(specular_map, texc).x;
float ao = texture(ambient_occlusion, texc).x; float ao = texture(ambient_occlusion, texc).x;
gl_FragColor = vec4(diffuse + spec * specmap + ao * ambient, 1.0); FragColor = vec4(diffuse + spec * specmap + ao * ambient, 1.0);
} }

View File

@ -3,6 +3,7 @@
uniform sampler2D tex; uniform sampler2D tex;
uniform vec2 texsize; uniform vec2 texsize;
uniform int notex; uniform int notex;
out vec4 FragColor;
float miplevel(in vec2 texture_coordinate) float miplevel(in vec2 texture_coordinate)
{ {
@ -19,7 +20,7 @@ float miplevel(in vec2 texture_coordinate)
void main() { void main() {
if (notex != 0) { if (notex != 0) {
gl_FragColor = gl_Color; FragColor = gl_Color;
return; return;
} }
@ -48,5 +49,5 @@ void main() {
vec3 col = mix(tcol.xyz, mixcol.xyz, mixcol.a); vec3 col = mix(tcol.xyz, mixcol.xyz, mixcol.a);
gl_FragColor = vec4(col, tcol.a); FragColor = vec4(col, tcol.a);
} }

View File

@ -9,6 +9,8 @@ uniform sampler2D areaMap;
uniform vec2 PIXEL_SIZE; uniform vec2 PIXEL_SIZE;
out vec4 FragColor;
/** /**
* This one just returns the first level of a mip map chain, which allow us to * This one just returns the first level of a mip map chain, which allow us to
* avoid the nasty ddx/ddy warnings, even improving the performance a little * avoid the nasty ddx/ddy warnings, even improving the performance a little
@ -109,5 +111,5 @@ void main() {
areas.ba = Area(abs(d), e1, e2); areas.ba = Area(abs(d), e1, e2);
} }
gl_FragColor = areas; FragColor = areas;
} }

View File

@ -5,6 +5,8 @@ in vec2 uv;
uniform sampler2D colorMapG; uniform sampler2D colorMapG;
const float threshold = 0.1; const float threshold = 0.1;
out vec4 FragColor;
void main() { void main() {
vec3 weights = vec3(0.2126,0.7152, 0.0722); // ITU-R BT. 709 vec3 weights = vec3(0.2126,0.7152, 0.0722); // ITU-R BT. 709
@ -23,5 +25,5 @@ void main() {
if (dot(edges, vec4(1.0)) == 0.0) if (dot(edges, vec4(1.0)) == 0.0)
discard; discard;
gl_FragColor = edges; FragColor = edges;
} }

View File

@ -1,6 +1,7 @@
#version 130 #version 130
in vec4 offset[2]; in vec4 offset[2];
in vec2 uv; in vec2 uv;
out vec4 FragColor;
uniform sampler2D blendMap; uniform sampler2D blendMap;
uniform sampler2D colorMap; uniform sampler2D colorMap;
@ -36,5 +37,5 @@ void main() {
color = mix(C, Cright, a.a) * w.a + color; color = mix(C, Cright, a.a) * w.a + color;
// Normalize the resulting color and we are finished! // Normalize the resulting color and we are finished!
gl_FragColor = color / sum; FragColor = color / sum;
} }

View File

@ -41,6 +41,8 @@ uniform float mask_radius;
// Maximum height of texture used // Maximum height of texture used
uniform float max_tex_height; uniform float max_tex_height;
out vec4 FragColor;
// Number of samples used for blurring // Number of samples used for blurring
#define NB_SAMPLES 8 #define NB_SAMPLES 8
@ -78,8 +80,8 @@ void main()
blur_texcoords += inc_vec; blur_texcoords += inc_vec;
} }
color /= vec3(NB_SAMPLES); color /= vec3(NB_SAMPLES);
gl_FragColor = vec4(color, 1.0); FragColor = vec4(color, 1.0);
// Keep this commented line for debugging: // Keep this commented line for debugging:
//gl_FragColor = vec4(blur_factor, blur_factor, blur_factor, 0.0); //FragColor = vec4(blur_factor, blur_factor, blur_factor, 0.0);
} }

View File

@ -2,10 +2,12 @@
uniform sampler2D tex1; uniform sampler2D tex1;
uniform sampler2D tex2; uniform sampler2D tex2;
out vec4 FragColor;
void main() void main()
{ {
vec4 col1 = texture(tex1, gl_TexCoord[0].xy); vec4 col1 = texture(tex1, gl_TexCoord[0].xy);
vec4 col2 = vec4(vec3(texture(tex2, gl_TexCoord[0].xy).x), 1.0); vec4 col2 = vec4(vec3(texture(tex2, gl_TexCoord[0].xy).x), 1.0);
gl_FragColor = col1 * col2; FragColor = col1 * col2;
} }

View File

@ -4,6 +4,7 @@ uniform sampler2D normalMap;
noperspective in vec3 tangent; noperspective in vec3 tangent;
noperspective in vec3 bitangent; noperspective in vec3 bitangent;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -17,5 +18,5 @@ void main()
vec3 FragmentNormal = TS_normal.x * Frag_tangent + TS_normal.y * Frag_bitangent - TS_normal.z * Frag_normal; vec3 FragmentNormal = TS_normal.x * Frag_tangent + TS_normal.y * Frag_bitangent - TS_normal.z * Frag_normal;
FragmentNormal = normalize(FragmentNormal); FragmentNormal = normalize(FragmentNormal);
gl_FragColor = vec4(0.5 * FragmentNormal + 0.5, gl_FragCoord.z); FragColor = vec4(0.5 * FragmentNormal + 0.5, gl_FragCoord.z);
} }

View File

@ -1,7 +1,8 @@
#version 130 #version 130
noperspective in vec3 nor; noperspective in vec3 nor;
out vec4 FragColor;
void main(void) void main(void)
{ {
gl_FragColor = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z); FragColor = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z);
} }

View File

@ -6,6 +6,7 @@ uniform sampler2D SSAO;
uniform vec2 screen; uniform vec2 screen;
uniform vec3 ambient; uniform vec3 ambient;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main(void) void main(void)
{ {
@ -15,5 +16,5 @@ void main(void)
vec3 SpecularComponent = texture(SpecularMap, tc).xyz; vec3 SpecularComponent = texture(SpecularMap, tc).xyz;
float ao = texture(SSAO, tc).x; float ao = texture(SSAO, tc).x;
vec3 LightFactor = ao * ambient + DiffuseComponent + SpecularComponent * (1. - color.a); vec3 LightFactor = ao * ambient + DiffuseComponent + SpecularComponent * (1. - color.a);
gl_FragColor = vec4(color.xyz * LightFactor, 1.); FragColor = vec4(color.xyz * LightFactor, 1.);
} }

View File

@ -8,6 +8,9 @@ noperspective in vec3 nor;
in vec4 color; in vec4 color;
in vec2 uv0; in vec2 uv0;
in vec2 uv1; in vec2 uv1;
out vec4 Albedo;
out vec4 NormalDepth;
out vec4 Specular;
void main() { void main() {
vec4 light = vec4(1.0); vec4 light = vec4(1.0);
@ -22,8 +25,8 @@ void main() {
else else
col = color; col = color;
gl_FragData[0] = vec4(col.xyz, 1.); Albedo = vec4(col.xyz, 1.);
gl_FragData[1] = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z); NormalDepth = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z);
gl_FragData[2] = vec4(1. - col.a); Specular = vec4(1. - col.a);
} }

View File

@ -6,6 +6,9 @@ uniform float objectid;
noperspective in vec3 nor; noperspective in vec3 nor;
in vec2 uv0; in vec2 uv0;
in vec2 uv1; in vec2 uv1;
out vec4 Albedo;
out vec4 NormalDepth;
out vec4 Specular;
void main() { void main() {
@ -15,12 +18,12 @@ void main() {
if (col.a < 0.5) if (col.a < 0.5)
discard; discard;
gl_FragData[0] = vec4(col.xyz, 1.); Albedo = vec4(col.xyz, 1.);
//} else { //} else {
// gl_FragData[0] = gl_Color; // Albedo = gl_Color;
//} //}
gl_FragData[1] = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z); NormalDepth = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z);
gl_FragData[2] = vec4(1. - col.a); Specular = vec4(1. - col.a);
} }

View File

@ -6,6 +6,9 @@ uniform float objectid;
noperspective in vec3 nor; noperspective in vec3 nor;
noperspective in vec3 eyenor; noperspective in vec3 eyenor;
noperspective in vec3 viewpos; noperspective in vec3 viewpos;
out vec4 Albedo;
out vec4 NormalDepth;
out vec4 Specular;
void main() { void main() {
float rim = 1.0 - dot(eyenor, viewpos); float rim = 1.0 - dot(eyenor, viewpos);
@ -25,8 +28,8 @@ void main() {
color = gl_Color + vec4(vec3(rim), 0.0); color = gl_Color + vec4(vec3(rim), 0.0);
} }
gl_FragData[0] = vec4(color.xyz, 1.); Albedo = vec4(color.xyz, 1.);
gl_FragData[1] = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z); NormalDepth = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z);
gl_FragData[2] = vec4(1. - color.a); Specular = vec4(1. - color.a);
} }

View File

@ -2,6 +2,7 @@
uniform sampler2D tex; uniform sampler2D tex;
noperspective in vec3 nor; noperspective in vec3 nor;
out vec4 FragColor;
void main() { void main() {
// Calculate the spherical UV // Calculate the spherical UV
@ -17,5 +18,5 @@ void main() {
vec4 detail0 = texture(tex, 0.5 * vec2(sin_theta_x, sin_theta_y) + 0.5); vec4 detail0 = texture(tex, 0.5 * vec2(sin_theta_x, sin_theta_y) + 0.5);
gl_FragColor = vec4(detail0.xyz, 1.); FragColor = vec4(detail0.xyz, 1.);
} }

View File

@ -3,11 +3,12 @@ uniform sampler2D tex;
noperspective in vec3 nor; noperspective in vec3 nor;
in vec2 uv; in vec2 uv;
out vec4 NormalDepth;
void main() { void main() {
vec4 col = texture(tex, uv); vec4 col = texture(tex, uv);
if (col.a < 0.5) if (col.a < 0.5)
discard; discard;
gl_FragColor = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z); NormalDepth = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z);
} }

View File

@ -6,6 +6,7 @@ uniform sampler2D SSAO;
uniform vec2 screen; uniform vec2 screen;
uniform vec3 ambient; uniform vec3 ambient;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main(void) void main(void)
{ {
@ -16,5 +17,5 @@ void main(void)
vec3 SpecularComponent = texture(SpecularMap, tc).xyz; vec3 SpecularComponent = texture(SpecularMap, tc).xyz;
float ao = texture(SSAO, tc).x; float ao = texture(SSAO, tc).x;
vec3 LightFactor = ao * ambient + DiffuseComponent + SpecularComponent; vec3 LightFactor = ao * ambient + DiffuseComponent + SpecularComponent;
gl_FragColor = vec4(color.xyz * LightFactor, 1.); FragColor = vec4(color.xyz * LightFactor, 1.);
} }

View File

@ -1,7 +1,9 @@
#version 130 #version 130
uniform sampler2D tex; uniform sampler2D tex;
out vec4 FragColor;
void main() void main()
{ {
gl_FragColor = texture(tex, gl_TexCoord[0].xy); FragColor = texture(tex, gl_TexCoord[0].xy);
} }

View File

@ -2,6 +2,7 @@
uniform sampler2D tex; uniform sampler2D tex;
uniform vec2 pixel; uniform vec2 pixel;
out vec4 FragColor;
// Separated penumbra, horizontal // Separated penumbra, horizontal
void main() void main()
@ -49,5 +50,5 @@ void main()
width += tmp.y; width += tmp.y;
float hasz = step(0.7, zsum); float hasz = step(0.7, zsum);
gl_FragColor = vec4(sum, (width / zsum) * hasz, hasz, 1.0); FragColor = vec4(sum, (width / zsum) * hasz, hasz, 1.0);
} }

View File

@ -2,6 +2,8 @@
uniform sampler2D tex; uniform sampler2D tex;
uniform vec2 pixel; uniform vec2 pixel;
out vec4 FragColor;
// Separated penumbra, vertical // Separated penumbra, vertical
void main() void main()
@ -49,5 +51,5 @@ void main()
width += tmp.y; width += tmp.y;
float hasz = step(0.7, zsum); float hasz = step(0.7, zsum);
gl_FragColor = vec4(sum, (width / zsum) * hasz, hasz, 1.0); FragColor = vec4(sum, (width / zsum) * hasz, hasz, 1.0);
} }

View File

@ -9,6 +9,8 @@ uniform mat4 invproj;
uniform mat4 viewm; uniform mat4 viewm;
in vec2 uv; in vec2 uv;
out vec4 Diffuse;
out vec4 Specular;
void main() { void main() {
vec2 texc = uv; vec2 texc = uv;
@ -44,6 +46,6 @@ void main() {
specular += Specular * light_col * spec_att; specular += Specular * light_col * spec_att;
} }
gl_FragData[0] = vec4(diffuse, 1.); Diffuse = vec4(diffuse, 1.);
gl_FragData[1] = vec4(specular , 1.); Specular = vec4(specular , 1.);
} }

View File

@ -5,6 +5,7 @@ uniform sampler2D dtex;
uniform int viz; uniform int viz;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -21,9 +22,9 @@ void main()
if (viz < 1) if (viz < 1)
{ {
gl_FragColor = newcol; FragColor = newcol;
} else } else
{ {
gl_FragColor = shiftval * vec4(50.0); FragColor = shiftval * vec4(50.0);
} }
} }

View File

@ -4,6 +4,8 @@ uniform sampler2D normals_and_depth;
uniform mat4 invproj; uniform mat4 invproj;
uniform vec2 screen; uniform vec2 screen;
out vec4 FragColor;
void main() void main()
{ {
vec2 xy = gl_FragCoord.xy / screen; vec2 xy = gl_FragCoord.xy / screen;
@ -15,6 +17,6 @@ void main()
EnvPos /= EnvPos.w; EnvPos /= EnvPos.w;
float len = dot(vec3(1.0), abs(texture(normals_and_depth, xy).xyz)); float len = dot(vec3(1.0), abs(texture(normals_and_depth, xy).xyz));
float alpha = (len < 0.2) ? 1. : clamp((EnvPos.z - FragmentPos.z) * 0.3, 0., 1.); float alpha = (len < 0.2) ? 1. : clamp((EnvPos.z - FragmentPos.z) * 0.3, 0., 1.);
gl_FragColor = texture(tex, gl_PointCoord.xy); FragColor = texture(tex, gl_PointCoord.xy);
gl_FragColor.a *= alpha; FragColor.a *= alpha;
} }

View File

@ -2,6 +2,7 @@
uniform sampler2D halft; // half is a reserved word uniform sampler2D halft; // half is a reserved word
uniform sampler2D quarter; uniform sampler2D quarter;
uniform sampler2D eighth; uniform sampler2D eighth;
out vec4 FragColor;
void main() void main()
{ {
@ -41,5 +42,5 @@ void main()
outval = 1.0 - mix(val[down].x, val[up].x, interp); outval = 1.0 - mix(val[down].x, val[up].x, interp);
} }
gl_FragColor = vec4(vec3(outval), 1.0); FragColor = vec4(vec3(outval), 1.0);
} }

View File

@ -6,6 +6,7 @@ uniform int low;
in vec3 wpos; in vec3 wpos;
in vec2 texc; in vec2 texc;
out vec4 FragColor;
float luminanceImp() float luminanceImp()
{ {
@ -66,6 +67,6 @@ void main()
importance = ceil(importance) * low; importance = ceil(importance) * low;
importance /= steps; importance /= steps;
gl_FragColor = vec4(importance); FragColor = vec4(importance);
gl_FragDepth = 1.0 - importance; gl_FragDepth = 1.0 - importance;
} }

View File

@ -6,6 +6,7 @@ uniform int wireframe;
uniform float objectid; uniform float objectid;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
vec4 encdepth(float v) { vec4 encdepth(float v) {
vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * v; vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * v;
@ -25,13 +26,13 @@ void main() {
if (viz < 1) if (viz < 1)
{ {
gl_FragColor = vec4(encdepth(gl_FragCoord.z).xyz, objectid); FragColor = vec4(encdepth(gl_FragCoord.z).xyz, objectid);
} }
else { else {
if (wireframe > 0) if (wireframe > 0)
gl_FragColor = vec4(1.0); FragColor = vec4(1.0);
else else
gl_FragColor = texture(tex, uv); FragColor = texture(tex, uv);
} }
} }

View File

@ -3,6 +3,8 @@ uniform sampler2D tex;
uniform int size; uniform int size;
uniform vec2 pixel; uniform vec2 pixel;
out vec4 FragColor;
vec4 encdepth(float v) { vec4 encdepth(float v) {
vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * v; vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * v;
enc = fract(enc); enc = fract(enc);
@ -51,5 +53,5 @@ void main()
res = res * 0.5 + 0.5; res = res * 0.5 + 0.5;
res = clamp(res, 0.01, 0.99); res = clamp(res, 0.01, 0.99);
gl_FragColor = encdepth(res); FragColor = encdepth(res);
} }

View File

@ -3,6 +3,8 @@ uniform sampler2D tex;
uniform int size; uniform int size;
uniform vec2 pixel; uniform vec2 pixel;
out vec4 FragColor;
vec4 encdepth(float v) { vec4 encdepth(float v) {
vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * v; vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * v;
enc = fract(enc); enc = fract(enc);
@ -51,5 +53,5 @@ void main()
res = res * 0.5 + 0.5; res = res * 0.5 + 0.5;
res = clamp(res, 0.01, 0.99); res = clamp(res, 0.01, 0.99);
gl_FragColor = encdepth(res); FragColor = encdepth(res);
} }

View File

@ -25,6 +25,7 @@ in vec2 uv;
in vec2 uv_cl; in vec2 uv_cl;
in vec3 vertex; in vec3 vertex;
in vec2 uv_fast; in vec2 uv_fast;
out vec4 FragColor;
void main() void main()
{ {
@ -62,8 +63,8 @@ void main()
col = cld_mask + col*(1. - cld_mask); col = cld_mask + col*(1. - cld_mask);
col = cld_fast + col*(1. - cld_fast); col = cld_fast + col*(1. - cld_fast);
gl_FragColor = vec4( vec3(col * paint * paint2), 1.0); FragColor = vec4( vec3(col * paint * paint2), 1.0);
//gl_FragColor = vec4(vec3(ou), 1.0); //FragColor = vec4(vec3(ou), 1.0);
} }

View File

@ -12,6 +12,7 @@ uniform vec3 ambient;
in vec2 uv; in vec2 uv;
in vec2 uv_bis; in vec2 uv_bis;
out vec4 FragColor;
void main() { void main() {
// Splatting part // Splatting part
@ -33,7 +34,5 @@ void main() {
float ao = texture(SSAO, tc).x; float ao = texture(SSAO, tc).x;
vec3 LightFactor = ao * ambient + DiffuseComponent + SpecularComponent; vec3 LightFactor = ao * ambient + DiffuseComponent + SpecularComponent;
gl_FragColor = vec4(splatted.xyz * LightFactor, 1.); FragColor = vec4(splatted.xyz * LightFactor, 1.);
// gl_FragData[2] = vec4(1. - splatted.a);
} }

View File

@ -6,6 +6,7 @@ uniform mat4 projm;
uniform vec4 samplePoints[16]; uniform vec4 samplePoints[16];
in vec2 uv; in vec2 uv;
out vec4 FragColor;
const float strengh = 4.; const float strengh = 4.;
const float radius = .4f; const float radius = .4f;
@ -62,5 +63,5 @@ void main(void)
// output the result // output the result
float ao = 1.0 - bl * invSamples; float ao = 1.0 - bl * invSamples;
gl_FragColor = vec4(ao); FragColor = vec4(ao);
} }

View File

@ -9,6 +9,10 @@ uniform mat4 invproj;
uniform int hasclouds; uniform int hasclouds;
uniform vec2 wind; uniform vec2 wind;
out vec4 Diff;
out vec4 Spec;
out vec4 SpecularMap;
void main() { void main() {
vec2 texc = gl_FragCoord.xy / screen; vec2 texc = gl_FragCoord.xy / screen;
@ -20,8 +24,8 @@ void main() {
if (z < 0.03) if (z < 0.03)
{ {
// Skyboxes are fully lit // Skyboxes are fully lit
gl_FragData[0] = vec4(1.0); Diff = vec4(1.0);
gl_FragData[1] = vec4(1.0); Spec = vec4(1.0);
return; return;
} }
@ -47,7 +51,7 @@ void main() {
outcol *= cloud; outcol *= cloud;
} }
gl_FragData[0] = vec4(NdotL * col, 1.); Diff = vec4(NdotL * col, 1.);
gl_FragData[1] = vec4(Specular * col, 1.); Spec = vec4(Specular * col, 1.);
gl_FragData[2] = vec4(1.0); SpecularMap = vec4(1.0);
} }

View File

@ -15,6 +15,9 @@ uniform int hasclouds;
uniform vec2 wind; uniform vec2 wind;
uniform float shadowoffset; uniform float shadowoffset;
out vec4 FragColor;
out vec4 OtherOutput;
float decdepth(vec4 rgba) { float decdepth(vec4 rgba) {
return dot(rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0)); return dot(rgba, vec4(1.0, 1.0/255.0, 1.0/65025.0, 1.0/16581375.0));
} }
@ -28,8 +31,8 @@ void main() {
if (z < 0.03) if (z < 0.03)
{ {
// Skyboxes are fully lit // Skyboxes are fully lit
gl_FragData[0] = vec4(1.0); FragColor = vec4(1.0);
gl_FragData[1] = vec4(0.0); OtherOutput = vec4(0.0);
return; return;
} }
@ -115,6 +118,6 @@ void main() {
/* outcol.r = (shadowcoord.z - shadowmapz) * 50.0; /* outcol.r = (shadowcoord.z - shadowmapz) * 50.0;
outcol.g = moved;*/ outcol.g = moved;*/
gl_FragData[0] = vec4(outcol, 0.05); FragColor = vec4(outcol, 0.05);
gl_FragData[1] = vec4(shadowed, penumbra, shadowed, shadowed); OtherOutput = vec4(shadowed, penumbra, shadowed, shadowed);
} }

View File

@ -2,8 +2,9 @@
uniform sampler2D tex; uniform sampler2D tex;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
gl_FragColor = texture(tex, uv); FragColor = texture(tex, uv);
} }

View File

@ -12,6 +12,7 @@ noperspective in vec3 lightVec;
noperspective in vec3 halfVec; noperspective in vec3 halfVec;
noperspective in vec3 eyeVec; noperspective in vec3 eyeVec;
in vec2 uv; in vec2 uv;
out vec4 FragColor;
void main() void main()
{ {
@ -53,5 +54,5 @@ void main()
float summed = dot(vec3(1.0), col) / 3.0; float summed = dot(vec3(1.0), col) / 3.0;
float alpha = 0.9 + 0.1 * smoothstep(0.0, 1.0, summed); float alpha = 0.9 + 0.1 * smoothstep(0.0, 1.0, summed);
gl_FragColor = vec4(col, alpha); FragColor = vec4(col, alpha);
} }

View File

@ -1,5 +1,6 @@
#version 130 #version 130
out vec4 FragColor;
void main() void main()
{ {
gl_FragColor = vec4(1.0); FragColor = vec4(1.0);
} }