Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: FBO issue: glViewport set, only draws one part

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2011
    Posts
    19

    FBO issue: glViewport set, only draws one part

    Note: this message is cross-posted in OpenGL coding: Advanced. [B]Please help, it's a stumper

    I have only ever been able to get FBOs working when they are 512x512 or display WxH, mainly because other sized FBOs have unpredictable coordinate systems or unpredictably "clipped" results. Using just the two sizes I mentioned, everything has been working just fine until recently I hit another wall:

    I am using a variety of FBOs in an application, and I reach a point in the rendering pipeline where FBOs start breaking down, where four particular FBOs end up clipped showing only the lower right quarter (it's not exactly a quarter). Or, it will draw only the bottom half. While it tastes like undefined behavior, it has some predictability to which quadrant, for instance. It's all the same FBO, but there are four operations on this same fbo in succession, and they all seem meshed together, like someone shuffled parts of them.

    Attempted solutions:

    - I tried solving this with glFinish() added to the end of each of the four successive calls, but this made no difference.

    - Someone said "hey, your glViewport must be messed up" but that's not possible because the same code and FBOs are used elsewhere on the screen at the same time with no issue. I used glViewport(0,0,fbo->w,fbo->h), which are 512x512 or screen WxH.

    The same rendering code that is between the fbo bind/unbind is used elsewhere without issue.

    - Switching the FBOs between various "flavors" (depth, depth stencil, depth color, color) does not affect it.
    - Changing the uniqueness does not affect it (using a different FBO id that is used less frequently)...
    - Changing FBO size only changes how much is drawn correctly, and in the opposite way you would think (bigger=more clipped).
    - Turning off scissor test doesn't fix it.
    - Clearing the depth buffer doesn't matter.
    - Muffing with "near/far" values makes no difference.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,732

    Re: FBO issue: glViewport set, only draws one part

    You have a bug in your code. Whittle your code down to a Short, Self Contained, Correct (Compilable), Example. Otherwise there's not much that can be done.

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2011
    Posts
    19

    Re: FBO issue: glViewport set, only draws one part

    I'm sorry but no test case adequately reproduces the problem. Sometimes you cannot use that method, though it applies a majority of the time.

  4. #4
    Member Regular Contributor DmitryM's Avatar
    Join Date
    Mar 2009
    Location
    Toronto
    Posts
    436

    Re: FBO issue: glViewport set, only draws one part

    Quote Originally Posted by OpenGL Developer
    I have only ever been able to get FBOs working when they are 512x512 or display WxH, mainly because other sized FBOs have unpredictable coordinate systems or unpredictably "clipped" results.
    That's where you should start: find out why sizes other than 512x512 don't work for your FBOs. There is a mistake in your implementation behind it. Even if it doesn't sovle your current issue, it would make the investigation easier.

  5. #5
    Member Regular Contributor
    Join Date
    Dec 2007
    Posts
    250

    Re: FBO issue: glViewport set, only draws one part

    Intel graphics card ? If you use FBO's on them you'll find they are hopelessly broken.

Posting Permissions

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