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:
-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);