Factorize SSAO in its own code.

This commit is contained in:
vlj 2014-05-09 14:44:53 +02:00
parent d78482ac67
commit 3e6ab6d7b6
2 changed files with 20 additions and 13 deletions

View File

@ -269,6 +269,7 @@ private:
void computeCameraMatrix(scene::ICameraSceneNode * const camnode);
void renderShadows();
void renderGlow(std::vector<GlowData>& glows);
void renderSSAO();
void renderLights(float dt);
void renderDisplacement();
void doScreenShot();

View File

@ -231,6 +231,12 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, std::vector
renderLights(dt);
PROFILER_POP_CPU_MARKER();
// Handle SSAO
PROFILER_PUSH_CPU_MARKER("- SSAO", 0xFF, 0xFF, 0x00);
if (UserConfigParams::m_ssao)
renderSSAO();
PROFILER_POP_CPU_MARKER();
PROFILER_PUSH_CPU_MARKER("- Solid Pass 2", 0x00, 0x00, 0xFF);
if (!UserConfigParams::m_dynamic_lights)
{
@ -830,8 +836,9 @@ void IrrDriver::renderLights(float dt)
m_post_processing->renderDiffuseEnvMap(blueSHCoeff, greenSHCoeff, redSHCoeff);
}
gl_driver->extGlDrawBuffers(1, bufs);
// Handle SSAO
if (UserConfigParams::m_ssao)
}
void IrrDriver::renderSSAO()
{
glBindFramebuffer(GL_FRAMEBUFFER, m_rtts->getFBO(FBO_SSAO));
glClearColor(1., 1., 1., 1.);
@ -843,7 +850,6 @@ void IrrDriver::renderLights(float dt)
irr_driver->getFBO(FBO_HALF1), irr_driver->getRenderTargetTexture(RTT_HALF1), UserConfigParams::m_width / 2, UserConfigParams::m_height / 2);
glViewport(0, 0, UserConfigParams::m_width, UserConfigParams::m_height);
}
}
static void getXYZ(GLenum face, float i, float j, float &x, float &y, float &z)
{