- all shaders now compile in core profile.

This commit is contained in:
Christoph Oelckers 2014-07-15 01:05:53 +02:00
parent eedc5a69be
commit 6046b11b4f
5 changed files with 10 additions and 5 deletions

View file

@ -88,7 +88,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
// //
FString vp_comb = "#version 130\n"; FString vp_comb = "#version 130\n";
if (gl.glslversion >= 3.3f) vp_comb = "#version 330 compatibility\n"; // I can't shut up the deprecation warnings in GLSL 1.3 so if available use a version with compatibility profile. if (gl.glslversion >= 3.3f) vp_comb = "#version 330 core\n"; // I can't shut up the deprecation warnings in GLSL 1.3 so if available use a version with compatibility profile.
// todo when using shader storage buffers, add // todo when using shader storage buffers, add
// "#version 400 compatibility\n#extension GL_ARB_shader_storage_buffer_object : require\n" instead. // "#version 400 compatibility\n#extension GL_ARB_shader_storage_buffer_object : require\n" instead.

View file

@ -2,6 +2,7 @@ uniform sampler2D tex;
uniform sampler2D texture2; uniform sampler2D texture2;
in vec4 vTexCoord; in vec4 vTexCoord;
in vec4 vColor; in vec4 vColor;
out vec4 FragColor;
void main() void main()
{ {
@ -10,5 +11,5 @@ void main()
vec4 t1 = texture2D(texture2, vTexCoord.xy); vec4 t1 = texture2D(texture2, vTexCoord.xy);
vec4 t2 = texture2D(tex, vec2(vTexCoord.x, 1.0-vTexCoord.y)); vec4 t2 = texture2D(tex, vec2(vTexCoord.x, 1.0-vTexCoord.y));
gl_FragColor = frag * vec4(t1.r, t1.g, t1.b, t2.a); FragColor = frag * vec4(t1.r, t1.g, t1.b, t2.a);
} }

View file

@ -1,5 +1,6 @@
in vec4 pixelpos; in vec4 pixelpos;
in vec2 glowdist; in vec2 glowdist;
out vec4 FragColor;
//=========================================================================== //===========================================================================
// //
@ -30,6 +31,6 @@ void main()
fogdist = max(16.0, distance(pixelpos.xyz, uCameraPos.xyz)); fogdist = max(16.0, distance(pixelpos.xyz, uCameraPos.xyz));
} }
fogfactor = exp2 (uFogDensity * fogdist); fogfactor = exp2 (uFogDensity * fogdist);
gl_FragColor = vec4(uFogColor.rgb, 1.0 - fogfactor); FragColor = vec4(uFogColor.rgb, 1.0 - fogfactor);
} }

View file

@ -4,6 +4,8 @@ in vec2 glowdist;
in vec4 vTexCoord; in vec4 vTexCoord;
in vec4 vColor; in vec4 vColor;
out vec4 FragColor;
#ifdef SHADER_STORAGE_LIGHTS #ifdef SHADER_STORAGE_LIGHTS
layout(std430, binding = 3) buffer ParameterBuffer layout(std430, binding = 3) buffer ParameterBuffer
{ {
@ -326,6 +328,6 @@ void main()
break; break;
} }
} }
gl_FragColor = frag; FragColor = frag;
} }

View file

@ -1,7 +1,8 @@
in vec4 pixelpos; in vec4 pixelpos;
out vec4 FragColor;
void main() void main()
{ {
gl_FragColor = vec4(1.0); FragColor = vec4(1.0);
} }