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 6 of 6

Thread: render to texture

Hybrid View

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2001
    Posts
    181

    render to texture

    just curious, how do you render to a texture? any web pages or similar apprechiated

    btw, is it fast enough to allow for several such (say 256x256) textures to be rendered (assuming the geometry is not massive)

  2. #2
    Junior Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Lubbock, TX, USA
    Posts
    224

    Re: render to texture

    Look into glCopyTexImage2D() or glCopyTexSubImage2d(). Both copy from the frame buffer to a texture object, this is the only 'clean' solution in OpenGL to render to a texture. In current hardware implementations both are pretty fast.
    Also, if that is possible (depends on what you want to do with the rendered textures), try to turn the detail level as low as possible when rendering the textures, turn texture mapping off, etc. I'm working on a 3D engine that implements reflection mapping this way and generally I'd say it's pretty fast.

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2001
    Posts
    181

    Re: render to texture

    lemme just check to see if i got this

    change to texture's "camera" (thus updating matrix and glViewport), render, do a glCopyTexImage2D into a texture, repeat as neccessary

    change to main "camera", render, swap buffers

    or?

  4. #4
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Posts
    148

    Re: render to texture

    Check out the pbuffer extension, though the only cards that I think support it is nvidias.

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

    Re: render to texture

    You might wanna have a look at some code I did. A dynamic cube mapping example, which renders into the backbuffer, and updates the textures each frame.

    It's on www.nutty.org in the extension section.

    Nutty

  6. #6
    Intern Newbie
    Join Date
    Feb 2001
    Location
    Marlboro, MA, USA
    Posts
    40

    Re: render to texture

    Originally posted by AndersO:
    Check out the pbuffer extension, though the only cards that I think support it is nvidias.
    The ATI Radeon and Rage 128 supports the pbuffer extension as well.

Posting Permissions

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