Added ambient lighting
This commit is contained in:
parent
482205b96e
commit
3f6e2c2b6b
3 changed files with 61 additions and 6 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <color.hpp>
|
||||
#include <texture.hpp>
|
||||
#include <transformable.hpp>
|
||||
#include <lighting/ambient.hpp>
|
||||
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
|
||||
|
@ -259,6 +260,21 @@ namespace oglu
|
|||
glUniformMatrix4fv(location, 1, transpose, glm::value_ptr(v0.GetMatrix()));
|
||||
}
|
||||
|
||||
void AbstractShader::SetUniform(const GLchar* colorName, const GLchar* intensityName, const AmbientLight& v0)
|
||||
{
|
||||
SetUniform(
|
||||
glGetUniformLocation(program, colorName),
|
||||
glGetUniformLocation(program, intensityName),
|
||||
v0
|
||||
);
|
||||
}
|
||||
|
||||
void AbstractShader::SetUniform(GLint colorLocation, GLint intensityLocation, const AmbientLight& v0)
|
||||
{
|
||||
SetUniform(colorLocation, v0.color, true);
|
||||
SetUniform(intensityLocation, v0.intensity);
|
||||
}
|
||||
|
||||
void AbstractShader::SetUniform1fv(const GLchar* name, GLsizei count, const GLfloat* value)
|
||||
{
|
||||
glUniform1fv(glGetUniformLocation(program, name), count, value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue