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/Ketsji | |
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/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index e76e28bcb7b..f8826245aab 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -966,6 +966,9 @@ void KX_KetsjiEngine::RenderFrame(KX_Scene* scene, KX_Camera* cam) scene->CalculateVisibleMeshes(m_rasterizer,cam); scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools); + + m_rendertools->MotionBlur(m_rasterizer); + } @@ -1463,3 +1466,4 @@ void KX_KetsjiEngine::GetOverrideFrameColor(float& r, float& g, float& b) const b = m_overrideFrameColorB; } + diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 7a937d5e349..1a3a0490d21 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -618,7 +618,31 @@ static PyObject* gPyMakeScreenshot(PyObject*, Py_Return; } +static PyObject* gPyEnableMotionBlur(PyObject*, + PyObject* args, + PyObject*) +{ + float motionblurvalue; + if (PyArg_ParseTuple(args,"f",&motionblurvalue)) + { + if(gp_Rasterizer) + { + gp_Rasterizer->EnableMotionBlur(motionblurvalue); + } + } + Py_Return; +} +static PyObject* gPyDisableMotionBlur(PyObject*, + PyObject* args, + PyObject*) +{ + if(gp_Rasterizer) + { + gp_Rasterizer->DisableMotionBlur(); + } + Py_Return; +} STR_String gPyGetWindowHeight__doc__="getWindowHeight doc"; STR_String gPyGetWindowWidth__doc__="getWindowWidth doc"; @@ -645,6 +669,9 @@ static struct PyMethodDef rasterizer_methods[] = { {"setMistColor",(PyCFunction)gPySetMistColor,METH_VARARGS,"set Mist Color (rgb)"}, {"setMistStart",(PyCFunction)gPySetMistStart,METH_VARARGS,"set Mist Start(rgb)"}, {"setMistEnd",(PyCFunction)gPySetMistEnd,METH_VARARGS,"set Mist End(rgb)"}, + {"enableMotionBlur",(PyCFunction)gPyEnableMotionBlur,METH_VARARGS,"enable motion blur"}, + {"disableMotionBlur",(PyCFunction)gPyDisableMotionBlur,METH_VARARGS,"disable motion blur"}, + {"setEyeSeparation", (PyCFunction) gPySetEyeSeparation, METH_VARARGS, "set the eye separation for stereo mode"}, {"getEyeSeparation", (PyCFunction) gPyGetEyeSeparation, METH_VARARGS, "get the eye separation for stereo mode"}, |