forked from bartvdbraak/blender
BGE: adding a fix so 2D filters work properly with side-by-side stereoscopic rendering.
This commit is contained in:
parent
efc4b08094
commit
5ba2f4367d
@ -429,6 +429,11 @@ void RAS_2DFilterManager::RenderFilters(RAS_ICanvas* canvas)
|
|||||||
glActiveTextureARB(GL_TEXTURE0);
|
glActiveTextureARB(GL_TEXTURE0);
|
||||||
canvas->SetViewPort(0, 0, rect_width-1, rect_height-1);
|
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);
|
glDisable(GL_DEPTH_TEST);
|
||||||
// in case the previous material was wire
|
// in case the previous material was wire
|
||||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||||
|
Loading…
Reference in New Issue
Block a user