Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Drawing to off-screen areas.

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2003
    Location
    Perth, WA, Australia
    Posts
    18

    Drawing to off-screen areas.

    Basically, I'm using Win2k and Opengl1.4 (latest nvidia drivers), and we do a rendering technique where I render stuff into the back buffer, then read it into a texture and use that to render the 'real' scene before swapping. Now, when windowed, with a window partially off the screen, opengl is 'optimizing' away the off-screen rendering, meaning I read back garbage into part of the texture. Is there any way to force it to actually render into this area?

    (Yes, I have an alternate rendering path using pbuffers, but half the cards around don't seem to support them so...)

  2. #2
    Member Regular Contributor
    Join Date
    Jul 2002
    Location
    Austria
    Posts
    280

    Re: Drawing to off-screen areas.

    To my knowledge there's no way to do it. It even explicitly states in the OpenGL spec that only the visible portions of a window are valid. I'm guessing you will probably have the same problem, when your window is partially overlapped by another window (depends on the driver though).
    XEngine - The Platform- and API-Independent 3D Engine
    with Programmable Pipeline Support: [URL=http://xengine.sourceforge.net
    My]http://xengine.sourceforge.net

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: Drawing to off-screen areas.

    Originally posted by wintal:
    (Yes, I have an alternate rendering path using pbuffers, but half the cards around don't seem to support them so...)
    Really? All ATIs since the Rage128 and all NVIDIAs since the TNT have pbuffers. Even the Intel integrated chipsets support them. I wouldn't use lack of hardware support as an excuse not to use pbuffers.

    -- Tom

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Posts
    748

    Re: Drawing to off-screen areas.

    I wouldn't use lack of hardware support as an excuse not to use pbuffers.
    Yeah, their speed on Nvidia-based cards is more the concern

    Y.

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2003
    Location
    Perth, WA, Australia
    Posts
    18

    Re: Drawing to off-screen areas.

    Originally posted by Asgard:
    To my knowledge there's no way to do it. It even explicitly states in the OpenGL spec that only the visible portions of a window are valid. I'm guessing you will probably have the same problem, when your window is partially overlapped by another window (depends on the driver though).
    I suspected as much, but thought I'd ask anyway. THanks for confirming my suspicion.

  6. #6
    Junior Member Newbie
    Join Date
    Feb 2003
    Location
    Perth, WA, Australia
    Posts
    18

    Re: Drawing to off-screen areas.

    Originally posted by Tom Nuydens:
    Really? All ATIs since the Rage128 and all NVIDIAs since the TNT have pbuffers. Even the Intel integrated chipsets support them. I wouldn't use lack of hardware support as an excuse not to use pbuffers.

    -- Tom
    Hmm.. interesting. Specifically, I'm running into issues on a laptop chipset - geforce4 440go. I create a very large pbuffer, perhaps the limits are smaller on these cards?

    Is there anywhere I can get a definitive list of capability differences for different chipsets?

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: Drawing to off-screen areas.

    Originally posted by wintal:
    Hmm.. interesting. Specifically, I'm running into issues on a laptop chipset - geforce4 440go. I create a very large pbuffer, perhaps the limits are smaller on these cards?
    How large is "very large"?

    -- Tom

  8. #8
    Junior Member Newbie
    Join Date
    Feb 2003
    Location
    Perth, WA, Australia
    Posts
    18

    Re: Drawing to off-screen areas.

    Very large is 2048x2048. Stupid card limitations won't seem to let me go any higher (Ideally, I want to be able to go up to about 4096x4096)

    I've actually worked out the problem now. It appears that while I can create a pbuffer with 32bit depth buffer, it won't let me actually glClear on it. If I create it with 16bit depth buffer, it works fine on the 'mx' style cards. (On a geforce 4 Ti, it works fine with 32bit z-buffer).

  9. #9
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: Drawing to off-screen areas.

    >>Is there anywhere I can get a definitive list of capability differences for different chipsets?<<

    Not really, that's why you can query capabilites. From http://oss.sgi.com/projects/ogl-samp...gl_pbuffer.txt :

    To query the maximum width, height, or number of pixels in any
    given pbuffer for a specific pixel format, use
    wglGetPixelFormatAttribivEXT or wglGetPixelFormatAttribfvEXT with
    <attribute> set to one of WGL_MAX_PBUFFER_WIDTH_ARB,
    WGL_MAX_PBUFFER_HEIGHT_ARB, or WGL_MAX_PBUFFER_PIXELS_ARB.

  10. #10
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: Drawing to off-screen areas.

    Originally posted by wintal:
    Very large is 2048x2048. Stupid card limitations won't seem to let me go any higher (Ideally, I want to be able to go up to about 4096x4096)
    Don't forget that the thing needs to fit in video memory. 2048x2048 with 32-bit color and 16-bit depth = 24 MB!

    -- Tom

Posting Permissions

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