diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-04-09 16:54:13 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2014-04-10 15:49:49 +0400 |
commit | f93bc7693a530632455d3ec7acc4bce54a1f85bc (patch) | |
tree | d0e067438cbc547875b3cb77e53904c5ea2a537d /source/gameengine/Rasterizer | |
parent | 19e627cab34a04a3d01b2e3a868b7bf91d56e8f9 (diff) |
Backport revisions for the 2.70a releasev2.70a
d2660a0, 6e99fb0, 58c22d8, 83f2012 + ff21f6a, a7ed1db. cc6b106
7997e38, 9d4b54b, efb48fc, 3fc293c, 29f359c, 77c1d17, 92a539e,
c626462, f48828b, 6452d9f, 765d077, 74518b2, af16d46, 8da4936,
6babbf5, f0106d2, f88776b, ee72cba, 467596d, e21a7b3, eed3974,
71a2ff1, ccf9afd, 44d6c68, 30fdfc3, b69809c, b0a8e4c, bd57ec6,
3b0832d, 2a25676, 3977b76, fb25a86, 9bbb30b, 51abc2b, 0ebade5,
2c0e32f, 3deaf7d, ea01b24, c61eb64, f3db038, a6fb670, eedde31,
b66a954, 7ff123c, f5b79df, 7148c97, 54a8753, fcaa018, 4c73001,
7a21330, 07578be, e9a64e2, fd3de8b, ae792e9, b7712a7 + 3600622,
d9557d0, 6d973b8, 688257d, 4acb57a, 95ac6bc,
Also backported openmp changes to sculpt making it so number
of real CPU cores is used as a number of threads here.
Diffstat (limited to 'source/gameengine/Rasterizer')
-rw-r--r-- | source/gameengine/Rasterizer/RAS_2DFilterManager.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp index e85b57f1769..abbe65738d4 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.cpp @@ -395,10 +395,8 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) return; const int *viewport = canvas->GetViewPort(); - RAS_Rect rect = canvas->GetWindowArea(); - int rect_width = rect.GetWidth()+1, rect_height = rect.GetHeight()+1; - if (texturewidth != rect_width || textureheight != rect_height) + if (texturewidth != viewport[2] || textureheight != viewport[3]) { UpdateOffsetMatrix(canvas); UpdateCanvasTextureCoord(viewport); @@ -414,22 +412,22 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) if (need_depth) { glActiveTextureARB(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, texname[1]); - glCopyTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT, rect.GetLeft(), rect.GetBottom(), rect_width, rect_height, 0); + glCopyTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT, viewport[0], viewport[1], viewport[2], viewport[3], 0); } if (need_luminance) { glActiveTextureARB(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, texname[2]); - glCopyTexImage2D(GL_TEXTURE_2D,0,GL_LUMINANCE16, rect.GetLeft(), rect.GetBottom(), rect_width, rect_height, 0); + glCopyTexImage2D(GL_TEXTURE_2D,0,GL_LUMINANCE16, viewport[0], viewport[1], viewport[2], viewport[3], 0); } // reverting to texunit 0, without this we get bug [#28462] 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, @@ -459,7 +457,7 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) glActiveTextureARB(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texname[0]); - glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, rect.GetLeft(), rect.GetBottom(), rect_width, rect_height, 0); // Don't use texturewidth and textureheight in case we don't have NPOT support + glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, viewport[0], viewport[1], viewport[2], viewport[3], 0); // Don't use texturewidth and textureheight in case we don't have NPOT support glClear(GL_COLOR_BUFFER_BIT); glBegin(GL_QUADS); @@ -473,8 +471,6 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas) } glEnable(GL_DEPTH_TEST); - //We can't pass the results of canvas->GetViewPort() directly because canvas->SetViewPort() does some extra math [#34517] - canvas->SetViewPort(0, 0, viewport[2]-1, viewport[3]-1); EndShaderProgram(); glPopMatrix(); glMatrixMode(GL_MODELVIEW); |