graphics - How and when does viewport change happen in OpenGL? (glViewport) -


i have question computer graphics pipeline.

in opengl, use glviewport function in reshape callback. heard glviewport related viewport transformation.

in our vertex shader, calculate our vertices , make these vertices defined in clipping coordinate(normalized clipping cube).

when viewport transformation work?

i guess if vertex shader output vertices information rasterizer, pipeline translate these vertices information.

x(v) = (x + 1)/2 * width + left y(v) = (y + 1)/2 * height + bottom. (viewport transformation)

consequently, thought glviewport set how work viewport transformation after finishing vertex shader work.

is right?

in opengl, use glviewport function in reshape callback

no, "we" don't. glviewport belongs display function.

consequently, thought glviewport set how work viewport transformation after finishing vertex shader work.

yes, that's how works. viewport variable, not different uniform, contains parameters vertex transformation step. since last steps of transformation, homogenous divide , clipping hardwired , viewport transform happens after that, has set individually.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -