Fix ribbon not using ambient.
This commit is contained in:
parent
61d6caa521
commit
59ad95b93f
@ -1201,6 +1201,7 @@ namespace MeshShader
|
||||
GLuint SphereMapShader::attrib_normal;
|
||||
GLuint SphereMapShader::uniform_MM;
|
||||
GLuint SphereMapShader::uniform_IMM;
|
||||
GLuint SphereMapShader::uniform_ambient;
|
||||
GLuint SphereMapShader::TU_tex;
|
||||
|
||||
void SphereMapShader::init()
|
||||
@ -1214,6 +1215,7 @@ namespace MeshShader
|
||||
attrib_normal = glGetAttribLocation(Program, "Normal");
|
||||
uniform_MM = glGetUniformLocation(Program, "ModelMatrix");
|
||||
uniform_IMM = glGetUniformLocation(Program, "InverseModelMatrix");
|
||||
uniform_ambient = glGetUniformLocation(Program, "ambient");
|
||||
GLuint uniform_tex = glGetUniformLocation(Program, "tex");
|
||||
GLuint uniform_Albedo = glGetUniformLocation(Program, "Albedo");
|
||||
GLuint uniform_DiffuseMap = glGetUniformLocation(Program, "DiffuseMap");
|
||||
@ -1234,12 +1236,13 @@ namespace MeshShader
|
||||
glUseProgram(0);
|
||||
}
|
||||
|
||||
void SphereMapShader::setUniforms(const core::matrix4 &ModelMatrix, const core::matrix4 &InverseModelMatrix)
|
||||
void SphereMapShader::setUniforms(const core::matrix4 &ModelMatrix, const core::matrix4 &InverseModelMatrix, const SColorf &ambient)
|
||||
{
|
||||
if (UserConfigParams::m_ubo_disabled)
|
||||
bypassUBO(Program);
|
||||
glUniformMatrix4fv(uniform_MM, 1, GL_FALSE, ModelMatrix.pointer());
|
||||
glUniformMatrix4fv(uniform_IMM, 1, GL_FALSE, InverseModelMatrix.pointer());
|
||||
glUniform3f(uniform_ambient, ambient.r, ambient.g, ambient.b);
|
||||
}
|
||||
|
||||
GLuint SplattingShader::Program;
|
||||
|
@ -250,11 +250,11 @@ class SphereMapShader
|
||||
public:
|
||||
static GLuint Program;
|
||||
static GLuint attrib_position, attrib_normal;
|
||||
static GLuint uniform_MM, uniform_IMM;
|
||||
static GLuint uniform_MM, uniform_IMM, uniform_ambient;
|
||||
static GLuint TU_tex;
|
||||
|
||||
static void init();
|
||||
static void setUniforms(const core::matrix4 &ModelMatrix, const core::matrix4 &InverseModelMatrix);
|
||||
static void setUniforms(const core::matrix4 &ModelMatrix, const core::matrix4 &InverseModelMatrix, const video::SColorf &ambient);
|
||||
};
|
||||
|
||||
class SplattingShader
|
||||
|
@ -249,7 +249,7 @@ void drawSphereMap(const GLMesh &mesh, const core::matrix4 &ModelMatrix, const c
|
||||
}
|
||||
setTexture(MeshShader::SphereMapShader::TU_tex, getTextureGLuint(mesh.textures[0]), GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, true);
|
||||
|
||||
MeshShader::SphereMapShader::setUniforms(ModelMatrix, InverseModelMatrix);
|
||||
MeshShader::SphereMapShader::setUniforms(ModelMatrix, InverseModelMatrix, irr_driver->getSceneManager()->getAmbientLight());
|
||||
assert(mesh.vao_second_pass);
|
||||
glBindVertexArray(mesh.vao_second_pass);
|
||||
glDrawElements(ptype, count, itype, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user