GL Tools / Viewport patch

franz's picture

Hi, what's the use of the GL Viewport patch ? From what i understood, it should allow to render sub-regions of the GL viewport. That sounds pretty useful in a multi-screen setup. However, i never managed to render anything else that the lower left part of the full viewport. (because offset cannot be lower than 0 )

Could someone clarify this ?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cwright's picture
Re: GL Tools / Viewport patch

The viewport dimensions range from 0 to width(in pixels) on the x axis, and 0 to height(in pixels) on the y axis. Negative offsets would thus always be off screen. I suppose we could support that in a future build though (but negative width/height will generate gl errors, so that's not happening).

To render to the top right, set X Offset to width(in pixels)/2, Y Offset to height(in pixels)/2, Width to width(in pixels)/2, and Height to height(in pixels)/2, and you're in business.

There's a sample composition that demonstrates this: GLTools-viewport-4pane.qtz -- should be in the latest beta (and it was in a few prior releases, but only in the source packages).

franz's picture
Re: GL Tools / Viewport patch

great ! i'll double check this. (you're super-ultra-fast as usual !)

the idea beyond this: run the same comp on separate computers / graphic cards, each node using Viewport to render only a sub-region of the global viewport. Hence multiprojection .... Question : is rendering a sub-region theoretically faster than rendering the whole region ?

cwright's picture
Speed

franz wrote:
Question : is rendering a sub-region theoretically faster than rendering the whole region ?

That depends entirely on what's getting drawn -- if your polygons get bigger, and they have an expensive shader, you're doing that expensive shader on more pixels, which would be slower. But, you're also likely drawing fewer polys, so it might balance out.

Intrinsically, there's no benefit one way or the other.