Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: glViewport Local to FBO?

  1. #1
    Junior Member Regular Contributor Kopelrativ's Avatar
    Join Date
    Apr 2011

    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?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    The viewport is global state.

  3. #3
    Member Regular Contributor
    Join Date
    Aug 2008
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts