Add compatibility keyword on and remove some unused shaders

This commit is contained in:
Vincent Lejeune 2014-02-17 15:34:57 +01:00
parent 1f7028f997
commit e5a174d85b
6 changed files with 8 additions and 59 deletions

View File

@ -1,32 +0,0 @@
#version 330
uniform sampler2D tex;
uniform sampler2D lighttex;
uniform int hastex;
uniform int haslightmap;
noperspective in vec3 nor;
in vec4 color;
in vec2 uv0;
in vec2 uv1;
out vec4 Albedo;
out vec4 NormalDepth;
out vec4 Specular;
void main() {
vec4 light = vec4(1.0);
vec4 col;
if (haslightmap != 0) {
light = texture(lighttex, uv1);
}
if (hastex != 0)
col = texture(tex, uv0) * light;
else
col = color;
Albedo = vec4(col.xyz, 1.);
NormalDepth = vec4(0.5 * normalize(nor) + 0.5, gl_FragCoord.z);
Specular = vec4(1. - col.a);
}

View File

@ -1,19 +0,0 @@
#version 330
uniform mat4 ModelViewProjectionMatrix;
uniform mat4 TransposeInverseModelView;
uniform mat4 TextureMatrix0;
uniform mat4 TextureMatrix1;
noperspective out vec3 nor;
out vec4 color;
out vec2 uv0;
out vec2 uv1;
void main() {
nor = (TransposeInverseModelView * vec4(gl_Normal, 1.)).xyz;
uv0 = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st;
uv1 = (gl_TextureMatrix[1] * gl_MultiTexCoord1).st;
gl_Position = ModelViewProjectionMatrix * gl_Vertex;
color = gl_Color;
}

View File

@ -1,4 +1,4 @@
#version 330
#version 330 compatibility
uniform sampler2D tex;
uniform sampler2D normals_and_depth;
uniform mat4 invproj;

View File

@ -1,4 +1,4 @@
#version 330
#version 330 compatibility
uniform float screenw;
void main()

View File

@ -1,4 +1,4 @@
#version 330
#version 330 compatibility
uniform float time;
uniform vec3 campos;
uniform mat4 viewm;

View File

@ -119,7 +119,7 @@ void Shaders::loadShaders()
m_shaders[ES_WATER_SURFACE] = glsl(dir + "water.vert", dir + "pass.frag",
m_callbacks[ES_WATER]);
m_shaders[ES_SPHERE_MAP] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass_spheremap.frag");
m_shaders[ES_SPHERE_MAP] = glsl_noinput(std::string(""), dir + "objectpass_spheremap.frag");
m_shaders[ES_GRASS] = glslmat(std::string(""), dir + "pass.frag",
m_callbacks[ES_GRASS], EMT_TRANSPARENT_ALPHA_CHANNEL);
@ -146,10 +146,10 @@ void Shaders::loadShaders()
m_shaders[ES_COLORIZE] = glslmat(std::string(""), dir + "colorize.frag",
m_callbacks[ES_COLORIZE], EMT_SOLID);
m_shaders[ES_OBJECTPASS] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass.frag");
m_shaders[ES_OBJECT_UNLIT] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass.frag");
m_shaders[ES_OBJECTPASS_REF] = glsl_noinput(dir + "objectpass.vert", dir + "objectpass_ref.frag");
m_shaders[ES_OBJECTPASS_RIMLIT] = glsl_noinput(dir + "objectpass_rimlit.vert", dir + "objectpass_rimlit.frag");
m_shaders[ES_OBJECTPASS] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
m_shaders[ES_OBJECT_UNLIT] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
m_shaders[ES_OBJECTPASS_REF] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
m_shaders[ES_OBJECTPASS_RIMLIT] = glsl_noinput(dir + "pass.vert", dir + "pass.frag");
m_shaders[ES_SUNLIGHT] = glsl_noinput(std::string(""), dir + "sunlight.frag");