There are two possible ways around that. One is to have one stencil buffer per nesting level; the other is to ignore the stencil drawing function and activate/deactivate the stencil manually instead. In the end, I went for the first option; each nesting level has a stencil buffer + canvas. This als...

(Sorry for the very, very late response, pgimeno, I thought I'd get an email when somebody responds to the thread...) Basically, when I render a scene view (either the main camera's view, or the view through a particular portal), I first render the scene normally, where the portal's surface is just ...

Hello everyone, I recently started working on a 3d game prototype featuring portals, which would ideally work like in the game of the same name. I eventually managed to get the rendering of portals to work more or less properly (even recursive portals), but I have the following two issues: I initial...