Graphics/Light: Make shadow map format/size parametrable

Former-commit-id: 8151d71d58ab760584c0ace1e0686c44bab9d3b2
This commit is contained in:
Lynix
2015-06-30 20:48:46 +02:00
parent 2c4a35b2d1
commit 529673ebc1
3 changed files with 50 additions and 2 deletions

View File

@@ -17,6 +17,8 @@
NzLight::NzLight(nzLightType type) :
m_type(type),
m_shadowMapFormat(nzPixelFormat_Depth16),
m_shadowMapSize(512, 512),
m_shadowCastingEnabled(false),
m_shadowMapUpdated(false)
{
@@ -186,7 +188,7 @@ void NzLight::UpdateShadowMap() const
if (!m_shadowMap)
m_shadowMap = NzTexture::New();
m_shadowMap->Create(nzImageType_2D, nzPixelFormat_Depth16, 256, 256);
m_shadowMap->Create((m_type == nzLightType_Point) ? nzImageType_Cubemap : nzImageType_2D, m_shadowMapFormat, m_shadowMapSize.x, m_shadowMapSize.y);
}
else
m_shadowMap.Reset();