glViewport Local to FBO?
If you change the glViewport in a FBO, is it then a local change for that FBO? Or is it a global change, also affecting the default screen?
The viewport is global state.
Also, since OpenGL 4.1 / GL_ARB_viewport_array, you can have an array of viewports/scissor rectangles/depth ranges used at the same time (still global). The viewport that is used is controlled by specifying gl_ViewportIndex in the geometry shader (min value of GL_MAX_VIEWPORTS >= 16). A common use case for this would be to render multiple views of your scene from different angles (eg. front, left, top & perspective or left and right eyes with a slight offset) in a single pass.
Tags for this Thread