Largely minizime the impacts of anti-aliasing being broken by post processing

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10006 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-10-17 22:18:27 +00:00
parent 55cb9941b5
commit c8e5c1304e
2 changed files with 21 additions and 1 deletions

View File

@ -91,6 +91,15 @@ void PostProcessing::beginCapture()
race_manager->getNumPlayers() > 1)
return;
// don't capture the input when we have no post-processing to add
// it will be faster and this ay we won't lose anti-aliasing
if (m_boost_amount <= 0.0f)
{
m_used_pp_this_frame = false;
return;
}
m_used_pp_this_frame = true;
irr_driver->getVideoDriver()->setRenderTarget(m_render_target, true, true);
}
@ -101,7 +110,10 @@ void PostProcessing::endCapture()
race_manager->getNumPlayers() > 1)
return;
irr_driver->getVideoDriver()->setRenderTarget(0, true, true, 0);
if (m_used_pp_this_frame)
{
irr_driver->getVideoDriver()->setRenderTarget(video::ERT_FRAME_BUFFER, true, true, 0);
}
}
void PostProcessing::update(float dt)
@ -120,6 +132,11 @@ void PostProcessing::render()
race_manager->getNumPlayers() > 1)
return;
if (!m_used_pp_this_frame)
{
return;
}
// Draw the fullscreen quad while applying the corresponding post-processing shaders
video::IVideoDriver* video_driver = irr_driver->getVideoDriver();
video::S3DVertex vertices[6];

View File

@ -36,6 +36,9 @@ private:
/** Boost amount, used to tune the motion blur. Must be in the range 0.0 to 1.0 */
float m_boost_amount;
bool m_used_pp_this_frame;
public:
PostProcessing();
virtual ~PostProcessing();