diff --git a/data/shaders/objectpass.frag b/data/shaders/objectpass.frag deleted file mode 100644 index 436679563..000000000 --- a/data/shaders/objectpass.frag +++ /dev/null @@ -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); -} - diff --git a/data/shaders/objectpass.vert b/data/shaders/objectpass.vert deleted file mode 100644 index 877192df0..000000000 --- a/data/shaders/objectpass.vert +++ /dev/null @@ -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; -} diff --git a/data/shaders/rain.frag b/data/shaders/rain.frag index 4fb5ad597..66af66dd3 100644 --- a/data/shaders/rain.frag +++ b/data/shaders/rain.frag @@ -1,4 +1,4 @@ -#version 330 +#version 330 compatibility uniform sampler2D tex; uniform sampler2D normals_and_depth; uniform mat4 invproj; diff --git a/data/shaders/rain.vert b/data/shaders/rain.vert index 7ac11bc00..e20bf80f3 100644 --- a/data/shaders/rain.vert +++ b/data/shaders/rain.vert @@ -1,4 +1,4 @@ -#version 330 +#version 330 compatibility uniform float screenw; void main() diff --git a/data/shaders/rainsim.vert b/data/shaders/rainsim.vert index 0a57b8671..dca63e1bf 100644 --- a/data/shaders/rainsim.vert +++ b/data/shaders/rainsim.vert @@ -1,4 +1,4 @@ -#version 330 +#version 330 compatibility uniform float time; uniform vec3 campos; uniform mat4 viewm; diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index f9fe82420..7e3c041a8 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -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");