Remove Untextured material.

This commit is contained in:
vlj 2014-06-28 23:01:28 +02:00
parent 80cab0ed28
commit d5c91dcfe4
8 changed files with 8 additions and 30 deletions

View File

@ -1,18 +1,14 @@
uniform sampler2D Albedo; uniform sampler2D Albedo;
#if __VERSION__ >= 130
in vec2 uv; in vec2 uv;
in vec4 color;
out vec4 FragColor; out vec4 FragColor;
#else
varying vec2 uv;
#define FragColor gl_FragColor
#endif
vec3 getLightFactor(float specMapValue); vec3 getLightFactor(float specMapValue);
void main(void) void main(void)
{ {
vec4 color = texture(Albedo, uv); vec4 col = texture(Albedo, uv) * color;
vec3 LightFactor = getLightFactor(1.); vec3 LightFactor = getLightFactor(1.);
FragColor = vec4(color.xyz * LightFactor, 1.); FragColor = vec4(col.xyz * LightFactor, 1.);
} }

View File

@ -2,11 +2,12 @@ uniform sampler2D tex;
in vec2 uv; in vec2 uv;
in vec3 nor; in vec3 nor;
in vec4 color;
layout (location = 0) out vec3 RSMColor; layout (location = 0) out vec3 RSMColor;
layout (location = 1) out vec3 RSMNormals; layout (location = 1) out vec3 RSMNormals;
void main() void main()
{ {
RSMColor = texture(tex, uv).xyz; RSMColor = texture(tex, uv).xyz * color.rgb;
RSMNormals = .5 * normalize(nor) + .5; RSMNormals = .5 * normalize(nor) + .5;
} }

View File

@ -11,10 +11,12 @@ uniform mat4 TextureMatrix =
layout(location = 0) in vec3 Position; layout(location = 0) in vec3 Position;
layout(location = 1) in vec3 Normal; layout(location = 1) in vec3 Normal;
layout(location = 2) in vec4 Color;
layout(location = 3) in vec2 Texcoord; layout(location = 3) in vec2 Texcoord;
out vec3 nor; out vec3 nor;
out vec2 uv; out vec2 uv;
out vec4 color;
void main(void) void main(void)
@ -24,4 +26,5 @@ void main(void)
gl_Position = ModelViewProjectionMatrix * vec4(Position, 1.); gl_Position = ModelViewProjectionMatrix * vec4(Position, 1.);
nor = (vec4(Normal, 0.)).xyz; nor = (vec4(Normal, 0.)).xyz;
uv = (TextureMatrix * vec4(Texcoord, 1., 1.)).xy; uv = (TextureMatrix * vec4(Texcoord, 1., 1.)).xy;
color = Color.zyxw;
} }

View File

@ -587,7 +587,6 @@ void IrrDriver::renderSolidSecondPass()
GroupedSM<SM_SPLATTING>::reset(); GroupedSM<SM_SPLATTING>::reset();
GroupedSM<SM_UNLIT>::reset(); GroupedSM<SM_UNLIT>::reset();
GroupedSM<SM_DETAILS>::reset(); GroupedSM<SM_DETAILS>::reset();
GroupedSM<SM_UNTEXTURED>::reset();
setTexture(0, m_rtts->getRenderTarget(RTT_TMP1), GL_NEAREST, GL_NEAREST); setTexture(0, m_rtts->getRenderTarget(RTT_TMP1), GL_NEAREST, GL_NEAREST);
setTexture(1, m_rtts->getRenderTarget(RTT_TMP2), GL_NEAREST, GL_NEAREST); setTexture(1, m_rtts->getRenderTarget(RTT_TMP2), GL_NEAREST, GL_NEAREST);
setTexture(2, m_rtts->getRenderTarget(RTT_HALF1_R), GL_LINEAR, GL_LINEAR); setTexture(2, m_rtts->getRenderTarget(RTT_HALF1_R), GL_LINEAR, GL_LINEAR);
@ -625,10 +624,6 @@ void IrrDriver::renderSolidSecondPass()
glUseProgram(MeshShader::DetailledObjectPass2Shader::Program); glUseProgram(MeshShader::DetailledObjectPass2Shader::Program);
for (unsigned i = 0; i < GroupedSM<SM_DETAILS>::MeshSet.size(); i++) for (unsigned i = 0; i < GroupedSM<SM_DETAILS>::MeshSet.size(); i++)
drawDetailledObjectPass2(*GroupedSM<SM_DETAILS>::MeshSet[i], GroupedSM<SM_DETAILS>::MVPSet[i]); drawDetailledObjectPass2(*GroupedSM<SM_DETAILS>::MeshSet[i], GroupedSM<SM_DETAILS>::MVPSet[i]);
glUseProgram(MeshShader::UntexturedObjectShader::Program);
for (unsigned i = 0; i < GroupedSM<SM_UNTEXTURED>::MeshSet.size(); i++)
drawUntexturedObject(*GroupedSM<SM_UNTEXTURED>::MeshSet[i], GroupedSM<SM_UNTEXTURED>::MVPSet[i]);
} }
} }

View File

@ -199,13 +199,6 @@ void STKAnimatedMesh::render()
GroupedSM<SM_DETAILS>::TIMVSet.push_back(invmodel); GroupedSM<SM_DETAILS>::TIMVSet.push_back(invmodel);
} }
for_in(mesh, ShadedMesh[SM_UNTEXTURED])
{
GroupedSM<SM_UNTEXTURED>::MeshSet.push_back(mesh);
GroupedSM<SM_UNTEXTURED>::MVPSet.push_back(AbsoluteTransformation);
GroupedSM<SM_UNTEXTURED>::TIMVSet.push_back(invmodel);
}
return; return;
} }

View File

@ -37,8 +37,6 @@ ShadedMaterial MaterialTypeToShadedMaterial(video::E_MATERIAL_TYPE type, video::
return SM_UNLIT; return SM_UNLIT;
else if (textures[1] && type != irr_driver->getShader(ES_NORMAL_MAP)) else if (textures[1] && type != irr_driver->getShader(ES_NORMAL_MAP))
return SM_DETAILS; return SM_DETAILS;
else if (!textures[0])
return SM_UNTEXTURED;
else else
return SM_DEFAULT; return SM_DEFAULT;
} }

View File

@ -29,7 +29,6 @@ enum ShadedMaterial
SM_GRASS, SM_GRASS,
SM_UNLIT, SM_UNLIT,
SM_DETAILS, SM_DETAILS,
SM_UNTEXTURED,
SM_COUNT SM_COUNT
}; };

View File

@ -365,13 +365,6 @@ void STKMeshSceneNode::render()
GroupedSM<SM_DETAILS>::TIMVSet.push_back(invmodel); GroupedSM<SM_DETAILS>::TIMVSet.push_back(invmodel);
} }
for_in(mesh, ShadedMesh[SM_UNTEXTURED])
{
GroupedSM<SM_UNTEXTURED>::MeshSet.push_back(mesh);
GroupedSM<SM_UNTEXTURED>::MVPSet.push_back(AbsoluteTransformation);
GroupedSM<SM_UNTEXTURED>::TIMVSet.push_back(invmodel);
}
if (!ShadedMesh[SM_GRASS].empty()) if (!ShadedMesh[SM_GRASS].empty())
glUseProgram(MeshShader::GrassPass2Shader::Program); glUseProgram(MeshShader::GrassPass2Shader::Program);
for_in(mesh, ShadedMesh[SM_GRASS]) for_in(mesh, ShadedMesh[SM_GRASS])