示例#1
0
void ShaderNormalMapping::update()
{
	ShaderMinimal::update();

	CVK::Light *light = CVK::State::getInstance()->getLights()->at(0);
	glUniform4fv(m_lightposID, 1, glm::value_ptr( *light->getPosition()));
	glUniform3fv(m_lightcolID, 1, glm::value_ptr( *light->getColor()));

	glUniform3fv( m_lightambID, 1, glm::value_ptr( CVK::State::getInstance()->getLightAmbient()));
}
void CVK::ShaderPhong::update()
{
	CVK::ShaderMinimal::update();

	CVK::Light *light = CVK::State::getInstance()->getLights()->at(0);
	glUniform4fv( m_lightposID, 1, glm::value_ptr( *light->getPosition()));
	glUniform3fv( m_lightcolID, 1, glm::value_ptr( *light->getColor()));

	glUniform3fv( m_lightsdirID, 1, glm::value_ptr( *light->getSpotDirection()));
	glUniform1f( m_lightsexpID, light->getSpotExponent());
	glUniform1f( m_lightscutID, light->getSpotCutoff());

	glUniform3fv( m_lightambID, 1, glm::value_ptr( CVK::State::getInstance()->getLightAmbient()));

	glUniform3fv( m_fogcolID, 1, glm::value_ptr( CVK::State::getInstance()->getFogCol()));
	glUniform1i( m_fogmodeID, CVK::State::getInstance()->getFogMode());
	glUniform1f( m_fogstartID, CVK::State::getInstance()->getFogStart());
	glUniform1f( m_fogendID, CVK::State::getInstance()->getFogEnd());
	glUniform1f( m_fogdensID, CVK::State::getInstance()->getFogDens());
}