Add lightviz to spheremap

This commit is contained in:
vlj 2014-05-20 02:31:19 +02:00
parent 3f1c85a897
commit c88d66a862

View File

@ -308,6 +308,16 @@ void drawSphereMap(const GLMesh &mesh, const core::matrix4 &ModelMatrix, const c
size_t count = mesh.IndexCount;
compressTexture(mesh.textures[0], true);
if (irr_driver->getLightViz())
{
GLint swizzleMask[] = { GL_ONE, GL_ONE, GL_ONE, GL_ALPHA };
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
}
else
{
GLint swizzleMask[] = { GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA };
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
}
setTexture(MeshShader::SphereMapShader::TU_tex, getTextureGLuint(mesh.textures[0]), GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
MeshShader::SphereMapShader::setUniforms(ModelMatrix, InverseModelMatrix);