Results 1 to 5 of 5

Thread: Fast accumulation?

  1. #1
    Senior Member Regular Contributor
    Join Date
    Apr 2007
    Location
    Fairfax, VA
    Posts
    252

    Fast accumulation?

    I'm rendering a large number of GL_POINTS with various 1-channel colors. I'd like to end up with pixel (i,j) containing the sum of the colors of all the GL_POINTS which had position (i,j).

    glBlendFunc(GL_ONE,GL_ONE) is far too slow for my purposes, and glAccum is rather inefficient for my needs.

    Is there a hardware-accelerated way to do this? It seems like there must be......

    My vertex program moves points around within rows, but not between rows. There may be a way to exploit this.

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

    Re: Fast accumulation?

    glBlendFunnc(GL_ONE, GL_ONE) is the proper way for this.
    Are you rendering to floating-point texture?
    If yes, then make sure your hardware supports blending to such texture.
    GeForce 6 / Radeon X1k will support FLOAT16 texture blending.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Apr 2007
    Location
    Fairfax, VA
    Posts
    252

    Re: Fast accumulation?

    Hmm, GL_RGBA16F_ARB does indeed seem to be fast enough. I was hoping to use GL_FLOAT_R16_NV since I only need one channel, but apparently hardware blending isn't supported for that.

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

    Re: Fast accumulation?

    AFAIK you can render only to RGB/RGBA textures on GeForce 6/7.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Apr 2007
    Location
    Fairfax, VA
    Posts
    252

    Re: Fast accumulation?

    Well, you can definitely render to GL_FLOAT_R16_NV; it's called out as one of the only color-renderable 1-channel formats. It just doesn't support hardware blending.

Similar Threads

  1. snow accumulation
    By overseb in forum OpenGL: GLSL
    Replies: 4
    Last Post: 06-24-2009, 06:20 AM
  2. hw accumulation buffer?
    By Ozzy in forum OpenGL: Advanced Coding
    Replies: 13
    Last Post: 03-17-2003, 10:02 AM
  3. Using Accumulation Buffer
    By jason_shaffer in forum OpenGL: macOS
    Replies: 8
    Last Post: 10-18-2001, 05:43 AM
  4. Accumulation buffer?
    By kaspy in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-24-2001, 12:17 AM
  5. Accumulation Buffer
    By ssaunders in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-06-2001, 08:32 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