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: render to texture

  1. #1
    Intern Contributor
    Join Date
    Apr 2000
    Location
    Austria
    Posts
    61

    render to texture

    yes, i know how to do it, but is it reliable? will some cards go crazy when doing glCopyxxx and so on? the reason i want to use it is drawing all my stuff in software 2d into a buffer (now doing it with GDI or DirectDraw)..

    thanks for any replies (if any :-) ),
    sebastian

  2. #2
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: render to texture

    Is there a reason to think any card would go crazy? Some may go slow though I suspect, not sure if glCopyTexImage stuff is accelerated on Radeon cards yet ... (personally I don't care though since the WGL_ARB_render_texture way of doing things are usually much better)

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Aug 2000
    Location
    Portsmouth, Hampshire, England
    Posts
    1,063

    Re: render to texture

    Doesn't the Render texture entension use Pbuffers, which requires a context switch? They are more flexable, in that you dont have to trash your backbuffer, but if that isn't important, I'm sure glCopyTexSubImage will be faster, on nvidia hardware at least.

    This is theory, so feel free to tell me I'm wrong.

    Also, glCopyTexSubImage is part of core GL 1.1 (think) whereas the render_texture is an extension not supported by alot of cards.

    Nutty

  4. #4
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: render to texture

    I have found that context switches aren't at all particularily expensive, not in any way that it hinders my performance significantly, I'm easily able to reach several houndred fps while rendering to a texture each frame (and thus switching contexts back and forth each frame). I would certainly think it's way cheaper than doing a copy as with glCopyTexImage, even on nVidia cards.
    While it's true that glCopyTexImage is a core OpenGL feature I'm not sure that it's accelerated by every cards out there, a good solution could be to use the extension if available and use glCopyTexImage as a fallback if it's not supported.

    Btw, I downloaded a little render to texture demo today using glCopyTexImage and it ran at 200 fps, so I would think that it's accelerated on Radeon these days. I remember last time I tried glCopyTexImage I got 13fps , but that was quite long ago.

  5. #5
    Member Regular Contributor
    Join Date
    May 2000
    Posts
    454

    Re: render to texture

    The thing about render to texture is that I dont think that textures are usually stored in quite the same format as the back buffer. When you do a render-to-back-buffer-and-copy, the conversion between formats only has to take place once. When you do a render-to-texture directly, this conversion has to be done once for each pixel drawn every time that pixel is drawn. The last time I spoke with any of the nvidia OpenGL guys on this issue was over a year ago, so maybe they found a way to address this since then, but at the time they told me that even if they added support for render-to-texture, drawing and copying would still be faster. Of course, if you are tring to create a 2048x2048 texture, render to texture is probably your only choice.
    Ron Frazier

Posting Permissions

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