411 REFERENCE · Wikibooks
OpenGL Programming/Mini-Portal Optimization
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Optimization - the scissors
We saw that the scissors were not suited for clipping portals, because scissors can only clip a rectangle. However, scissor clipping is much faster than stencil buffer clipping (it's just a coordinates comparison, rather than a complete screen buffer access).
We can use the scissors to optimize the performances, by doing a first rough clipping, before using the stencil buffer.
This will also allow us to detect when a sub-portal is completely hidden and break from the recursive loop.