I am attempting to implement a pop-up view on top of the current webGL view.
My strategy is as follows: Whenever I need to display a popup, I create a scissorRect and begin rendering the popup scene onto it. I was hoping that the content of the previous screen would remain intact. My understanding is that setScissor should prevent the clearing of content outside the popup. However, with the code below, the content outside the popup turns black. Please note that glclear is automatically called when renderer.render() is invoked.
if (this.options.showPopUP) {
this.renderer.setScissorTest(true);
this.renderer.setViewport(popupViewPort.x, popupViewPort.y, popupViewPort.z, popupViewPort.w);
this.renderer.setScissor(popupViewPort.x, popupViewPort.y, popupViewPort.z, popupViewPort.w);
this.renderer.render(this.popUpScene, camera.camera);
}
if (!this.options.showPopUP) {
var size = this.renderer.getSize();
this.renderer.setScissorTest(false);
this.renderer.setViewport(0, 0, size.width, size.height);
this.renderer.setScissor(0, 0, size.width, size.height);
this.renderer.render(this.scene, camera.camera);
}
Any suggestions?