Results 1 to 3 of 3

Thread: Image Processing (GPGPU)

  1. #1
    Junior Member
    Join Date
    Mar 2011
    Posts
    5

    Image Processing (GPGPU)

    I am trying to do some image processing on the GPU, e.g. median, blur, brightness, etc. The general idea is to do something like this framework from GPU Gems 1.

    I am able to write the GLSL fragment shader for processing the pixels as I've been trying out different things in an effect designer app.

    I am not sure however how I should do the other part of the task. That is, I'd like to be working on the image in image coords and then outputting the result to a texture. I am aware of the gl_FragCoords variable.

    As far as I understand it it goes like that: I need to set up a view (an orthographic one maybe?) and a quad in such a way so that the pixel shader would be applied once to each pixel in the image and so that it would be rendering to a texture or something. But how can I achieve that considering there's depth that may make things somewhat awkward to me...

    I'd be very grateful if anyone could help me with this rather simple task as I am really frustrated with myself.

    UPDATE: It seems I'll have to use an FBO, getting one like this: glBindFramebuffer(...)

  2. #2
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: Image Processing (GPGPU)

    It seems like you've maybe figured out the FBO thing already.

    One thing - you don't need to worry about whether it's an orthographic or perspective "view". You're writing your own vertex shader - so rip out all of the matrix stuff and have it simply copy the input vertex directly to the output position without change - no matrices are involved and you can draw your quad directly in screen coordinates (-1..1 range). You can turn off depth testing and mask off the depth buffer so you're not writing to it - this makes things faster too.

  3. #3
    Junior Member
    Join Date
    Mar 2011
    Posts
    5

    Re: Image Processing (GPGPU)

    Quote Originally Posted by SteveBaker
    It seems like you've maybe figured out the FBO thing already.

    One thing - you don't need to worry about whether it's an orthographic or perspective "view". You're writing your own vertex shader - so rip out all of the matrix stuff and have it simply copy the input vertex directly to the output position without change - no matrices are involved and you can draw your quad directly in screen coordinates (-1..1 range). You can turn off depth testing and mask off the depth buffer so you're not writing to it - this makes things faster too.
    Thanks Steve, very helpful info!

Similar Threads

  1. can we use OpenVG do image processing?
    By love-asic in forum OpenVG and VGU
    Replies: 2
    Last Post: 08-24-2011, 03:24 PM
  2. Looking for Simple Image Processing
    By wahabkotwal in forum OpenCL
    Replies: 2
    Last Post: 10-17-2010, 05:33 PM

Posting Permissions

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