Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2013-07-16 02:44:48 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-07-16 02:44:48 +0400
commit5ba2f4367d6cebc415c4e20572a8cea4e52fb0c3 (patch)
treeacdd0504be9f073381daf3290d002c476400be2a /source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
parentefc4b08094e520afd6598a13c8b586df4abcc45a (diff)
BGE: adding a fix so 2D filters work properly with side-by-side stereoscopic rendering.
Diffstat (limited to 'source/gameengine/Rasterizer/RAS_2DFilterManager.cpp')
-rw-r--r--source/gameengine/Rasterizer/RAS_2DFilterManager.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
index 79ce8538210..bfe29a48c69 100644
--- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
@@ -429,6 +429,11 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas)
glActiveTextureARB(GL_TEXTURE0);
canvas->SetViewPort(0, 0, rect_width-1, rect_height-1);
+ // We do this to make side-by-side stereo rendering work correctly with 2D filters. It would probably be nicer to just set the viewport,
+ // but it can be easier for writing shaders to have the coordinates for the whole screen instead of just part of the screen.
+ RAS_Rect scissor_rect = canvas->GetDisplayArea();
+ glScissor(scissor_rect.GetLeft()+viewport[0], scissor_rect.GetBottom()+viewport[1], scissor_rect.GetWidth()+1, scissor_rect.GetHeight()+1);
+
glDisable(GL_DEPTH_TEST);
// in case the previous material was wire
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);