Пример #1
0
void Shader::Update(const Transform& transform, const Camera& camera)
{
	glm::mat4 model = camera.GetViewProjection() * transform.GetModel();

	glUniformMatrix4fv(glGetUniformLocation(this->Program(), "Transform"), 1, GL_FALSE, glm::value_ptr(model));
	glUniformMatrix4fv(glGetUniformLocation(this->Program(), "Model"), 1, GL_FALSE, glm::value_ptr(transform.GetModel()));
}
Пример #2
0
void Shader::Update(const Transform& transform, const Camera& camera)
{
	//glm::mat4 MVP = transform.GetMVP(camera);
	glm::mat4 model = camera.GetViewProjection()*transform.GetModel();
	//glUniformMatrix4fv(m_uniforms[0], 1, GL_FALSE, &MVP[0][0]);
	glUniformMatrix4fv(m_uniforms[TRANSFORM_U], 1, GL_FALSE, &model[0][0]);
	//glUniform3f(m_uniforms[2], 0.0f, 0.0f, 1.0f);
}
Пример #3
0
void Shader::Update(const Transform& transform, const Camera& camera)
{
	glm::mat4 MVP = transform.GetMVP(camera);
	glm::mat4 Normal = transform.GetModel();

	glUniformMatrix4fv(m_uniforms[0], 1, GL_FALSE, &MVP[0][0]);
	glUniformMatrix4fv(m_uniforms[1], 1, GL_FALSE, &Normal[0][0]);
	glUniform3f(m_uniforms[2], 0.0f, 0.0f, 1.0f); //light Direction
}
Пример #4
0
void Shader::Update(const Transform& transform, const Camera& camera)
{
	glm::mat4 model = camera.GetViewProjection() * transform.GetModel();

	glUniformMatrix4fv(m_uniforms[TRANSFORM_U], 1, GL_FALSE, &model[0][0]);
}