本文整理汇总了C++中CLight::GetPower方法的典型用法代码示例。如果您正苦于以下问题:C++ CLight::GetPower方法的具体用法?C++ CLight::GetPower怎么用?C++ CLight::GetPower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLight
的用法示例。
在下文中一共展示了CLight::GetPower方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void CShader_Deferred::Update()
{
CLight* light = GetGame()->GetRenderSystem()->GetCurLight();
// Pass light data to shader
GLuint lightTypeID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "lightType");
if (lightTypeID != -1)
glUniform1i(lightTypeID, light->GetType());
GLuint lightDiffuseID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "lightDiffuse");
if (lightDiffuseID != -1)
glUniform3f(lightDiffuseID, light->GetDiffuse().x, light->GetDiffuse().y, light->GetDiffuse().z);
GLuint lightAmbientID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "lightAmbient");
if (lightAmbientID != -1)
glUniform3f(lightAmbientID, light->GetAmbient().x, light->GetAmbient().y, light->GetAmbient().z);
GLuint lightSpecularID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "lightSpecular");
if (lightSpecularID != -1)
glUniform3f(lightSpecularID, light->GetSpecular().x, light->GetSpecular().y, light->GetSpecular().z);
GLuint lightPowerID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "lightPower");
if (lightPowerID != -1)
glUniform1f(lightPowerID, light->GetPower());
GLuint lightPosID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "lightPos");
if (lightPosID != -1)
glUniform3f(lightPosID, light->GetViewSpacePos().x, light->GetViewSpacePos().y, light->GetViewSpacePos().z);
GLuint lightAngleID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "lightAngle");
if (lightAngleID != -1)
glUniform3f(lightAngleID, light->GetViewSpaceAngles().x, light->GetViewSpaceAngles().y, light->GetViewSpaceAngles().z);
// Point light data
GLuint cAttID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "constAtt");
if (cAttID != -1)
glUniform1f(cAttID, light->GetConstantAtt());
GLuint lAttID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "linAtt");
if (lAttID != -1)
glUniform1f(lAttID, light->GetLinearAtt());
GLuint qAttID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "quadAtt");
if (qAttID != -1)
glUniform1f(qAttID, light->GetQuadraticAtt());
GLuint spotCutoffID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "spotCosCutoff");
if (qAttID != -1)
glUniform1f(spotCutoffID, light->GetSpotCutoff());
GLuint spotExpID = glGetUniformLocation(GetGame()->GetRenderSystem()->GetCurShader()->GetID(), "spotExp");
if (qAttID != -1)
glUniform1f(spotExpID, light->GetSpotExponent());
}