< OpenGL Programming
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.
- Comment on this page
Browse & download complete code
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.