diff options
author | Mal Duffin <malachyduffin@gmail.com> | 2007-09-29 22:51:01 +0400 |
---|---|---|
committer | Mal Duffin <malachyduffin@gmail.com> | 2007-09-29 22:51:01 +0400 |
commit | 51b56a4d3f17e8cea35ba02132af0c2b893e1ff2 (patch) | |
tree | 721c5d1d3e015cb4432e22d4bf23f75d93319ad9 /source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | |
parent | ae40a1d86e5917dbd23ac4bcdcbeca07a3505e0d (diff) |
GE Patch by Hamed Zaghaghi - Adding Motion Blur to the Game Engine.
I reviewed the code, suggested an update ( initialising accumulation buffer ), and tested the resulting update successfully.
It's great to see more GE developers!GE Patch by Hamed Zaghaghi to add motion blur to the GE ( using the accumulation buffer ).
I reviewed code and tested, gave some feedback ( initialising accumulation buffer ) which was implemented straight away, and re-reviewed.
It's great to have another GE coder on the team!
Diffstat (limited to 'source/gameengine/GamePlayer/common/GPC_RenderTools.cpp')
-rw-r--r-- | source/gameengine/GamePlayer/common/GPC_RenderTools.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp index 0f6bec30437..cc5c392d51a 100644 --- a/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp +++ b/source/gameengine/GamePlayer/common/GPC_RenderTools.cpp @@ -570,4 +570,27 @@ void GPC_RenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmatrix,in } } +void GPC_RenderTools::MotionBlur(RAS_IRasterizer* rasterizer) +{ + int state = rasterizer->GetMotionBlurState(); + float motionblurvalue; + if(state) + { + motionblurvalue = rasterizer->GetMotionBlurValue(); + if(state==1) + { + //bugfix:load color buffer into accum buffer for the first time(state=1) + glAccum(GL_LOAD, 1.0); + rasterizer->SetMotionBlurState(2); + } + else if(motionblurvalue>=0.0 && motionblurvalue<=1.0) + { + glAccum(GL_MULT, motionblurvalue); + glAccum(GL_ACCUM, 1-motionblurvalue); + glAccum(GL_RETURN, 1.0); + glFlush(); + } + } +} + unsigned int GPC_RenderTools::m_numgllights; |