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: Rendering directly to texture memory

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2000
    Location
    Austin, TX
    Posts
    14

    Rendering directly to texture memory

    I understand that direct3d has the ability to render directly to texture memory, but OpenGL does not.

    The only way I have been able to accoplish this in OpenGL is to render to the frame buffer, then copy the image from the frame buffer into texture memory. Unfortunately the copy simply kills performance.

    Does anyone know if there is a better way to render into texture memory in OpenGL? Or if any vendors, such as nvidia, are planning on creating an extension to support this?

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

    Re: Rendering directly to texture memory

    I actually asked someone from nvidia about this. There is currently a proposal on the table for an openGL render-to-texture extension. However, the problem with such a thing is that (as I understood it) performance is actually worse when rendering directly to a texture. Because textures are swizzled in memory, it can be problematic to render to directly. Either the renderer has to be able to render in swizzled format or the texture has to be swizzled in place after the render-to-texture is complete.

    [This message has been edited by LordKronos (edited 11-10-2000).]
    Ron Frazier

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Sep 2000
    Location
    Santa Clara, CA
    Posts
    1,463

    Re: Rendering directly to texture memory

    We are working on _several_ solutions to this problem.

    Hopefully it won't be long until I can give details.

    - Matt

  4. #4
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    Manchester - UK
    Posts
    138

    Re: Rendering directly to texture memory

    Is pBuffer_EXT really that hard to implement in OpenGL? If DX drivers can do SetRenderTarget whats stopping a similar function in OpenGL?
    Paul Groves
    [b] pauls opengl page

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Sep 2000
    Location
    Santa Clara, CA
    Posts
    1,463

    Re: Rendering directly to texture memory

    Nothing's stopping it. As I said, we're working on it.

    - Matt

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

    Re: Rendering directly to texture memory

    I didn't find the performance hit associated with glCopyTexSubImage2D() all that big... I have an app that renders 256x256 textures at 50-60 fps on my TNT2. For 128x128, this goes up to almost 200 fps.

    You're not using glCopyTexImage2D() instead of glCopyTexSubImage2D(), are you? I think I've read somewhere that in some cases, not using TexSubImage() can cause the driver to reallocate memory for the texture every time you do it.

  7. #7
    Junior Member Regular Contributor
    Join Date
    May 2000
    Location
    Manchester - UK
    Posts
    138

    Re: Rendering directly to texture memory

    Nothing's stopping it. As I said, we're working on it.
    <Sound of Paul's hands rubbing together >
    Paul Groves
    [b] pauls opengl page

  8. #8
    Senior Member OpenGL Pro
    Join Date
    Sep 2000
    Location
    Santa Clara, CA
    Posts
    1,463

    Re: Rendering directly to texture memory

    Ah, but it's still too slow right now if you want to do high-res dynamic cubemaps and those kinds of effects. A single 512x512 copy takes you down below real-time framerates, too, by your numbers...

    - Matt

  9. #9
    Intern Contributor
    Join Date
    Feb 2000
    Location
    France
    Posts
    54

    Re: Rendering directly to texture memory

    What about the RENDER_TO_BITMAP option when creating a window ? I believe i saw something like that in the msdn for CreateWindow(). Maybe we can use that ?

  10. #10
    Junior Member Newbie
    Join Date
    Jun 2000
    Location
    Szczecin, Poland
    Posts
    19

    Re: Rendering directly to texture memory

    For MS Windows applications, a DIB section GDI object may be used as a placeholder for
    a textures' source image and later accesed by OpenGL API functions directly. This solution is very flexible, because you may do the OpenGL rendering and/or GDI rendering and/or directly manipulate the image bits and then subimage the texture.

Posting Permissions

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