diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2010-03-03 09:38:47 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2010-03-03 09:38:47 +0300 |
commit | 0cad3ae24cc9628be09da4d1b4fe475a0c1733f7 (patch) | |
tree | 4078f623e0d7e5edbf23814d638982e3c706ba47 /source/gameengine/GameLogic | |
parent | c26486f207eab2a82d02932d8ff2b7c19a307b95 (diff) |
BGE 2D Filters: filters run per scene now (fix for [#18152]) - it (slightly) breaks backward compatibility !!!
Originally we had 2DFilters (m_filtermanager) stored in RenderTools. That way filters were stored globally and were being called once per each scene. This was producing two big problems: (1) performance and (2) flexibility of use.
(1) Performance - To run the filters 2X == 2X slower
(2) flexibility of use - Very often we want the filter in the scene but not in the UI for example.
For those reasons I believe that 2DFilters with multiple scenes was very useless or unpredictable. I hope they work fine now.
To make it work as before (2.4) you can simply recreate the 2dfilter actuators across the scenes.
* * * * *
Imagine that we have:
(a) Main Scene
(b) Overlay Scene
in Main Scene the Z Buffer and RGB will be from the main scene.
in Overlay Scene the Z Buffer will be from the Overlay Scene and the RBG buffer is from both [(a + 2D Filter) + b].
So in pseudo code if we have a,b,c,d,e scenes we have: (2DFilterE(2DFilterD(2DFilterC(2DFilterB(2DFilterA(a) + b) + c) + d) + e)
Diffstat (limited to 'source/gameengine/GameLogic')
-rw-r--r-- | source/gameengine/GameLogic/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/gameengine/GameLogic/Makefile | 1 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_2DFilterActuator.cpp | 6 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SCA_2DFilterActuator.h | 6 | ||||
-rw-r--r-- | source/gameengine/GameLogic/SConscript | 1 |
5 files changed, 9 insertions, 6 deletions
diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt index 3ffba14ec95..958e697aa39 100644 --- a/source/gameengine/GameLogic/CMakeLists.txt +++ b/source/gameengine/GameLogic/CMakeLists.txt @@ -32,6 +32,7 @@ SET(INC ../../../intern/string ../../../source/gameengine/Expressions ../../../source/gameengine/SceneGraph + ../../../source/gameengine/Ketsji ../../../intern/moto/include ../../../source/gameengine/Rasterizer ) diff --git a/source/gameengine/GameLogic/Makefile b/source/gameengine/GameLogic/Makefile index a1794a60452..0d4d50b32a0 100644 --- a/source/gameengine/GameLogic/Makefile +++ b/source/gameengine/GameLogic/Makefile @@ -41,6 +41,7 @@ CCFLAGS += $(LEVEL_1_CPP_WARNINGS) CPPFLAGS += -I../Expressions CPPFLAGS += -I../SceneGraph CPPFLAGS += -I../Rasterizer +CPPFLAGS += -I../Ketsji CPPFLAGS += -I$(NAN_STRING)/include CPPFLAGS += -I$(NAN_MOTO)/include CPPFLAGS += -I../../blender/makesdna diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp index 5cda00d901f..43cf36b7db8 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.cpp @@ -42,14 +42,14 @@ SCA_2DFilterActuator::SCA_2DFilterActuator( float float_arg, int int_arg, RAS_IRasterizer* rasterizer, - RAS_IRenderTools* rendertools) + KX_Scene* scene) : SCA_IActuator(gameobj, KX_ACT_2DFILTER), m_type(type), m_disableMotionBlur(flag), m_float_arg(float_arg), m_int_arg(int_arg), m_rasterizer(rasterizer), - m_rendertools(rendertools) + m_scene(scene) { m_gameObj = NULL; if(gameobj){ @@ -87,7 +87,7 @@ bool SCA_2DFilterActuator::Update() } else if(m_type < RAS_2DFilterManager::RAS_2DFILTER_NUMBER_OF_FILTERS) { - m_rendertools->Update2DFilter(m_propNames, m_gameObj, m_type, m_int_arg, m_shaderText); + m_scene->Update2DFilter(m_propNames, m_gameObj, m_type, m_int_arg, m_shaderText); } // once the filter is in place, no need to update it again => disable the actuator return false; diff --git a/source/gameengine/GameLogic/SCA_2DFilterActuator.h b/source/gameengine/GameLogic/SCA_2DFilterActuator.h index d47cfb203f8..beb4cb88608 100644 --- a/source/gameengine/GameLogic/SCA_2DFilterActuator.h +++ b/source/gameengine/GameLogic/SCA_2DFilterActuator.h @@ -29,8 +29,8 @@ #define __SCA_2DFILETRACTUATOR_H__ #include "RAS_IRasterizer.h" -#include "RAS_IRenderTools.h" #include "SCA_IActuator.h" +#include "KX_Scene.h" class SCA_2DFilterActuator : public SCA_IActuator { @@ -45,7 +45,7 @@ private: int m_int_arg; STR_String m_shaderText; RAS_IRasterizer* m_rasterizer; - RAS_IRenderTools* m_rendertools; + KX_Scene* m_scene; public: @@ -56,7 +56,7 @@ public: float float_arg, int int_arg, RAS_IRasterizer* rasterizer, - RAS_IRenderTools* rendertools); + KX_Scene* scene); void SetShaderText(const char *text); virtual ~SCA_2DFilterActuator(); diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript index 3840754ed06..57325d99d04 100644 --- a/source/gameengine/GameLogic/SConscript +++ b/source/gameengine/GameLogic/SConscript @@ -6,6 +6,7 @@ sources = env.Glob('*.cpp') + env.Glob('Joystick/*.cpp') incs = '. #/source/kernel/gen_system #/intern/string' incs += ' #/source/gameengine/Expressions #/intern/moto/include' incs += ' #/source/gameengine/Rasterizer #/source/gameengine/SceneGraph' +incs += ' #/source/gameengine/Ketsji' defs = [] |