# multiple viewports

This topic is 4723 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I've seen 2 ways of accomplishing nonlinear projection (scissoring and rendering to textures) and was wondering if anyone who's worked on something similar would care to share some pros and cons of each, or if they know of any different (better) method. I'm mainly after ease of implementation, but performance is also a consideration. Thanks [Edited by - Silex on June 20, 2005 12:35:16 PM]

##### Share on other sites
I simply use glViewport, that works with no scissoring (as far as I know)... I suppose it's not applicable to your case, so what are these multiple viewports for?

##### Share on other sites
My understanding was that scissoring was needed when you have viewports of irregular dimensions, meaning they each have their own projection matrices. This is however potentially completely wrong.

##### Share on other sites
Quote:
 Original post by BladeWiseI simply use glViewport, that works with no scissoring (as far as I know)... I suppose it's not applicable to your case, so what are these multiple viewports for?

Caught my attention too, did a quick google search and it'd seem people might use scissor test in a loop:
for_each_viewport {    glViewport();    glScissor();    glClear();    draw()}

but if you simply move the clear() call outside it works pretty well with no scissor
glClear();for_each_viewport {    glViewport();    draw()}

... then again, the Red Book does mention using scissor test and viewport parameters together when doing nonlinear projection. Hard to tell. For what's worth, viewport() alone worked for me so far :s

: searching some more, it turns out the scissor definition is precisely to guard from effect of 'operations like glClear()' which would otherwise ignore the viewport dimensions.

##### Share on other sites
Thanks for the clarifications tolaris.

##### Share on other sites
For a more in-depth discussion of the clipping properties of the viewport check out Pitfall #10 here.

• 10
• 17
• 9
• 14
• 41