From 873f1e982b77f3dbc0600c5ca59460bd70185a3e Mon Sep 17 00:00:00 2001 From: Forrest Li Date: Mon, 22 Jan 2018 11:09:25 -0500 Subject: [PATCH] fix(Renderer): Update gl viewport on zbuffer pass --- Sources/Rendering/OpenGL/Renderer/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/Rendering/OpenGL/Renderer/index.js b/Sources/Rendering/OpenGL/Renderer/index.js index bb6fe523df9..00181400d48 100644 --- a/Sources/Rendering/OpenGL/Renderer/index.js +++ b/Sources/Rendering/OpenGL/Renderer/index.js @@ -65,6 +65,11 @@ function vtkOpenGLRenderer(publicAPI, model) { gl.depthMask(true); } + const ts = publicAPI.getTiledSizeAndOrigin(); + gl.enable(gl.SCISSOR_TEST); + gl.scissor(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize); + gl.viewport(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize); + gl.colorMask(true, true, true, true); gl.clear(clearMask); @@ -160,6 +165,7 @@ function vtkOpenGLRenderer(publicAPI, model) { const ts = publicAPI.getTiledSizeAndOrigin(); gl.enable(gl.SCISSOR_TEST); gl.scissor(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize); + gl.viewport(ts.lowerLeftU, ts.lowerLeftV, ts.usize, ts.vsize); gl.clear(clearMask);