Enable ref + vertex color for unlit mat.

This commit is contained in:
Vincent Lejeune 2014-08-07 01:50:53 +02:00
parent 024f6f3fee
commit c0d57100a7
6 changed files with 10 additions and 14 deletions

View File

@ -1,17 +1,13 @@
uniform sampler2D tex;
#if __VERSION__ >= 130
in vec2 uv;
in vec4 color;
out vec4 FragColor;
#else
varying vec2 uv;
#define FragColor gl_FragColor
#endif
void main(void)
{
vec4 color = texture(tex, uv);
if (color.a < 0.5) discard;
FragColor = vec4(color.xyz, 1.);
vec4 col = texture(tex, uv);
col.xyz *= pow(color.xyz, vec3(2.2));
if (col.a * color.a < 0.5) discard;
FragColor = vec4(col.xyz, 1.);
}

View File

@ -212,9 +212,9 @@ void IrrDriver::renderSolidFirstPass()
std::vector<TexUnit> object_pass1_texunits = TexUnits(TexUnit(MeshShader::ObjectPass1Shader::getInstance()->TU_tex, true) );
renderMeshes1stPass<MeshShader::ObjectPass1Shader, video::EVT_STANDARD, 2, 1>(object_pass1_texunits, ListMatDefault::Arguments);
renderMeshes1stPass<MeshShader::ObjectPass1Shader, video::EVT_STANDARD, 2, 1>(object_pass1_texunits, ListMatSphereMap::Arguments);
renderMeshes1stPass<MeshShader::ObjectPass1Shader, video::EVT_STANDARD, 2, 1>(object_pass1_texunits, ListMatUnlit::Arguments);
renderMeshes1stPass<MeshShader::ObjectPass1Shader, video::EVT_2TCOORDS, 2, 1>(object_pass1_texunits, ListMatDetails::Arguments);
renderMeshes1stPass<MeshShader::ObjectPass1Shader, video::EVT_2TCOORDS, 2, 1>(object_pass1_texunits, ListMatSplatting::Arguments);
renderMeshes1stPass<MeshShader::ObjectRefPass1Shader, video::EVT_STANDARD, 3, 2, 1>(object_pass1_texunits, ListMatUnlit::Arguments);
renderMeshes1stPass<MeshShader::ObjectRefPass1Shader, video::EVT_STANDARD, 3, 2, 1>(TexUnits(TexUnit(MeshShader::ObjectRefPass1Shader::getInstance()->TU_tex, true)), ListMatAlphaRef::Arguments);
renderMeshes1stPass<MeshShader::GrassPass1Shader, video::EVT_STANDARD, 3, 2, 1>(TexUnits(TexUnit(MeshShader::GrassPass1Shader::getInstance()->TU_tex, true)), ListMatGrass::Arguments);
renderMeshes1stPass<MeshShader::NormalMapShader, video::EVT_TANGENTS, 2, 1>(TexUnits(

View File

@ -151,7 +151,7 @@ void STKAnimatedMesh::render()
pushVector(ListMatDetails::Arguments, mesh, AbsoluteTransformation, invmodel, mesh->TextureMatrix);
for_in(mesh, MeshSolidMaterial[MAT_UNLIT])
pushVector(ListMatUnlit::Arguments, mesh, AbsoluteTransformation, core::matrix4::EM4CONST_IDENTITY);
pushVector(ListMatUnlit::Arguments, mesh, AbsoluteTransformation, core::matrix4::EM4CONST_IDENTITY, mesh->TextureMatrix);
return;
}

View File

@ -298,7 +298,7 @@ std::vector<STK::Tuple<GLMesh *, core::matrix4, core::matrix4, core::matrix4> >
std::vector<STK::Tuple<GLMesh *, core::matrix4, core::matrix4, core::matrix4> > ListMatSphereMap::Arguments;
std::vector<STK::Tuple<GLMesh *, core::matrix4, core::matrix4, core::matrix4> > ListMatDetails::Arguments;
std::vector<STK::Tuple<GLMesh *, core::matrix4, core::matrix4, core::vector3df> > ListMatGrass::Arguments;
std::vector<STK::Tuple<GLMesh *, core::matrix4, core::matrix4> > ListMatUnlit::Arguments;
std::vector<STK::Tuple<GLMesh *, core::matrix4, core::matrix4, core::matrix4> > ListMatUnlit::Arguments;
std::vector<STK::Tuple<GLMesh *, core::matrix4, core::matrix4> > ListMatSplatting::Arguments;
std::vector<STK::Tuple<GLMesh *, core::matrix4, core::matrix4, core::matrix4> > ListMatNormalMap::Arguments;

View File

@ -98,7 +98,7 @@ public:
class ListMatUnlit
{
public:
static std::vector<STK::Tuple<GLMesh *, core::matrix4, core::matrix4> > Arguments;
static std::vector<STK::Tuple<GLMesh *, core::matrix4, core::matrix4, core::matrix4> > Arguments;
};
class ListMatDetails

View File

@ -265,7 +265,7 @@ void STKMeshSceneNode::render()
pushVector(ListMatGrass::Arguments, mesh, AbsoluteTransformation, invmodel, windDir);
for_in(mesh, MeshSolidMaterials[MAT_UNLIT])
pushVector(ListMatUnlit::Arguments, mesh, AbsoluteTransformation, core::matrix4::EM4CONST_IDENTITY);
pushVector(ListMatUnlit::Arguments, mesh, AbsoluteTransformation, core::matrix4::EM4CONST_IDENTITY, mesh->TextureMatrix);
for_in(mesh, MeshSolidMaterials[MAT_SPLATTING])
pushVector(ListMatSplatting::Arguments, mesh, AbsoluteTransformation, invmodel);