Resize to match texture fbo

This commit is contained in:
Richard Davey 2020-11-19 23:04:10 +00:00
parent c33a5598ab
commit 87b96f60e8

View file

@ -259,16 +259,7 @@ var RenderTarget = new Class({
var textureWidth = this.width;
var textureHeight = this.height;
var rendererWidth = renderer.width;
var rendererHeight = renderer.height;
var width = Math.max(textureWidth, rendererWidth);
var height = Math.max(textureHeight, rendererHeight);
var x = 0;
var y = (textureHeight < rendererHeight) ? textureHeight - rendererHeight : Math.abs(rendererHeight - textureHeight);
renderer.gl.viewport(x, y, width, height);
renderer.gl.viewport(0, 0, textureWidth, textureHeight);
renderer.gl.disable(renderer.gl.SCISSOR_TEST);
},