1
0
forked from mirrors/0ad

Removes code duplications for binding shadows to shaders.

This was SVN commit r24710.
This commit is contained in:
vladislavbelov
2021-01-19 19:19:04 +00:00
parent 4a2cc3273e
commit 5cbf8f04ec
4 changed files with 15 additions and 73 deletions
+2 -8
View File
@@ -76,14 +76,8 @@ void ShaderRenderModifier::BeginPass(const CShaderProgramPtr& shader)
shader->Uniform(str_transform, g_Renderer.GetViewCamera().GetViewProjection());
shader->Uniform(str_cameraPos, g_Renderer.GetViewCamera().GetOrientation().GetTranslation());
if (GetShadowMap() && shader->GetTextureBinding(str_shadowTex).Active())
{
shader->BindTexture(str_shadowTex, GetShadowMap()->GetTexture());
shader->Uniform(str_shadowTransform, GetShadowMap()->GetTextureMatrix());
int width = GetShadowMap()->GetWidth();
int height = GetShadowMap()->GetHeight();
shader->Uniform(str_shadowScale, width, height, 1.0f / width, 1.0f / height);
}
if (GetShadowMap())
GetShadowMap()->BindTo(shader);
if (GetLightEnv())
{