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

Thread: faster

  1. #1
    Senior Member Regular Contributor
    Join Date
    May 2004
    Location
    Renkum
    Posts
    193

    faster

    Hello,
    What is faster, copying the data from the framebuffer to the accumulation buffer, and then back to the framebuffer, or to use glReadPixels, and then use glCopyPixels to copy them back to the framebuffer?
    Thanx in advance,
    Hylke

  2. #2
    Guest

    Re: faster

    "give a man a fish and you feed him for a day, teach him how to fish and you feed him for a lifetime"

    Implement both and see which one is faster.


    Cheers,
    Peter

  3. #3
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,107

    Re: faster

    Nothing beats rendering to texture, so I suggest you to consider using Framebufer Object extension or simply glCopyTexSubImage function (FBO's will be faster).

  4. #4
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    FRANCE
    Posts
    14

    Re: faster

    i was told that on NVIDIA gpus, rendering to the framebuffer then copying into a texture was (curiously) the fastest way of achieving render to texture

    the man who told me that based his statements on directx experiments but according to him, it should also be the case with opengl.

    so, can someone please enlight me on this ??? on nvidia hardware, will FBO be faster than glCopyTexSubImage ??? does it also apply to ati ?

    many thx,
    g.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Naarn, Austria
    Posts
    1,102

    Re: faster

    In my first experimental FBO application, I also observed that CopyTexSubImage was faster than rendering to an FBO. This was with the first FBO capable driver (on Linux, GFFX).

    But with a later app, I could not reproduce the effect. I guess it heavily depends on how you use the FBO, how much you render to it and how often you switch FBO. My test application had only 4 spheres with cubemapping in the whole scene, but it did 24 passes to FBO and one onscreen pass per frame, so it was a bit of an extreme test case.

    I guess the best way to find out is to implement both and try it out in your scene, I'm pretty sure depending on a lot of different factors both could potentially be faster.

  6. #6
    Senior Member Regular Contributor
    Join Date
    May 2004
    Location
    Renkum
    Posts
    193

    Re: faster

    Ok, thanks for the replies
    But how do I render those pixels back to the framebuffer? Just using glDrawPixels?
    Hylke

  7. #7
    Senior Member Regular Contributor
    Join Date
    Feb 2003
    Location
    Waltham, MA
    Posts
    125

    Re: faster

    I've found that copying to a texture is still faster than rendering directly to a texture. From what I can tell, early Z (aka hierarchical Z... apparently they're the same thing) is not enabled for render to texture (rendering to a texture rectangle doesn't seem to have this limitation). My guess as to why is that the video card stores texture data swizzled (swizzled array, not a color swizzle) into a more cache friendly manner so a linear memory fetch can load a 2D region of a texture; that said, there is probably dedicated hardware to render to this swizzled format which has to disable the hierarchical Z stage. Note that this performance information was gathered from NVidia cards and may not pertain to ATI cards, or ATI may have different limitations entirely.

    Kevin

  8. #8
    Senior Member Regular Contributor
    Join Date
    Apr 2000
    Location
    Redlands, CA, USA
    Posts
    233

    Re: faster

    Another point to consider:
    Antialiasing may not be available for rendering to the texture.

  9. #9
    Member Newbie
    Join Date
    Sep 2004
    Posts
    39

    Re: faster

    Also, how do you render to the framebuffer aswell as a texture efficiently when not using copytex* (say you want to output to the framebuffer as per usual, but you also want to render to a texture)?

  10. #10
    Member Newbie
    Join Date
    Sep 2004
    Posts
    39

    Re: faster

    I should probably get up to speed with FBOs (I've only skimmed over the spec) before asking such a question.

Page 1 of 2 12 LastLast

Similar Threads

  1. Which one is faster?
    By aronsatie in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 09-03-2010, 06:21 AM
  2. faster?
    By ARES in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-17-2002, 09:34 AM
  3. What are faster?
    By Sergei in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-12-2001, 02:47 AM
  4. >>>NEED MORE HELP>>>FASTER>>>
    By perpendicular in forum OpenGL: User Software
    Replies: 0
    Last Post: 11-28-2000, 03:18 PM
  5. Which is faster?
    By in forum OpenGL: User Software
    Replies: 6
    Last Post: 03-07-2000, 12:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean