本文整理汇总了C++中CShaderProgramPtr::GetTextureBinding方法的典型用法代码示例。如果您正苦于以下问题:C++ CShaderProgramPtr::GetTextureBinding方法的具体用法?C++ CShaderProgramPtr::GetTextureBinding怎么用?C++ CShaderProgramPtr::GetTextureBinding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CShaderProgramPtr
的用法示例。
在下文中一共展示了CShaderProgramPtr::GetTextureBinding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BeginPass
void ShaderRenderModifier::BeginPass(const CShaderProgramPtr& shader)
{
shader->Uniform("transform", g_Renderer.GetViewCamera().GetViewProjection());
shader->Uniform("cameraPos", g_Renderer.GetViewCamera().GetOrientation().GetTranslation());
if (GetShadowMap() && shader->GetTextureBinding("shadowTex").Active())
{
shader->BindTexture("shadowTex", GetShadowMap()->GetTexture());
shader->Uniform("shadowTransform", GetShadowMap()->GetTextureMatrix());
int width = GetShadowMap()->GetWidth();
int height = GetShadowMap()->GetHeight();
shader->Uniform("shadowScale", width, height, 1.0f / width, 1.0f / height);
}
if (GetLightEnv())
{
shader->Uniform("ambient", GetLightEnv()->m_UnitsAmbientColor);
shader->Uniform("sunDir", GetLightEnv()->GetSunDir());
shader->Uniform("sunColor", GetLightEnv()->m_SunColor);
shader->Uniform("fogColor", GetLightEnv()->m_FogColor);
shader->Uniform("fogParams", GetLightEnv()->m_FogFactor, GetLightEnv()->m_FogMax, 0.f, 0.f);
}
if (shader->GetTextureBinding("losTex").Active())
{
CLOSTexture& los = g_Renderer.GetScene().GetLOSTexture();
shader->BindTexture("losTex", los.GetTextureSmooth());
// Don't bother sending the whole matrix, we just need two floats (scale and translation)
shader->Uniform("losTransform", los.GetTextureMatrix()[0], los.GetTextureMatrix()[12], 0.f, 0.f);
}
m_BindingInstancingTransform = shader->GetUniformBinding("instancingTransform");
m_BindingShadingColor = shader->GetUniformBinding("shadingColor");
m_BindingPlayerColor = shader->GetUniformBinding("playerColor");
}