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

Thread: adding rows together

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2008
    Location
    South Africa
    Posts
    15

    adding rows together

    Hi

    I am using GLSL code to add the rows of a texture together.
    So i take an nxn sized texture and make it a 1xn texture.

    what is the easiest way to do this?

    at the moment im using a for loop to do it. but for larger sized textures this is going to be slow.

    Thanks

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2008
    Location
    South Africa
    Posts
    15

    Re: adding rows together

    I came right,

    Thank you

  3. #3
    Member Regular Contributor
    Join Date
    May 2001
    Posts
    349

    Re: adding rows together

    If you want to reduce a large texture to 1xN or Nx1 you should always use a two-pass approach because GPUs typically process 2x2 fragment blocks. With a 1-wide render target you lose half the performance, so you want to perform the bulk of the work in a pass that uses a slightly larger render target. Also make use of texture filtering to reduce the number of texture fetches.

Posting Permissions

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