Improved shadow mapping performance using the shadow LOD and tweaked

polygon offsets to fight shadow acne
This commit is contained in:
Robert Beckebans 2014-05-11 22:30:01 +02:00
parent 5153422d0d
commit 0eaaea4b96
10 changed files with 92 additions and 43 deletions

View file

@ -77,9 +77,14 @@ void Framebuffer::Init()
int width, height;
width = height = r_shadowMapImageSize.GetInteger();
globalFramebuffers.shadowFBO = new Framebuffer( "_shadowMap" , width, height );
globalFramebuffers.shadowFBO->Bind();
glDrawBuffers( 0, NULL );
for( int i = 0; i < MAX_SHADOWMAP_RESOLUTIONS; i++ )
{
width = height = shadowMapResolutions[i];
globalFramebuffers.shadowFBO[i] = new Framebuffer( "_shadowMap" , width, height );
globalFramebuffers.shadowFBO[i]->Bind();
glDrawBuffers( 0, NULL );
}
// globalFramebuffers.shadowFBO->AddColorBuffer( GL_RGBA8, 0 );
// globalFramebuffers.shadowFBO->AddDepthBuffer( GL_DEPTH_COMPONENT24 );
// globalFramebuffers.shadowFBO->Check();