Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Display algorithm in Fragment Shader

  1. #1
    Newbie Newbie
    Join Date
    Apr 2014

    Display algorithm in Fragment Shader

    I am new in OpenGL, recently, I am using OpenGL ES to process real time video frame(frame size if about 800 * 600, target GPU is PowerVR SGX543/266 MHz). In this project, we anlyse data of pixel cluster and display the pixel with an algorithm (for example, make a Gaussian Blur algorithm). In my design, the algorithm is implemented in the Fragment Shader(Time Complexity is O(n*n)), it works, but the frame rate is too low, The normal frame rate is about 60 fpt, when enable the algorithm, frame rate become to 2 fpt.
    My question is: "algorithm implemented in the Fragment Shader", is this pattern correct? It seems absolute to fall down the frame rate.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Yes, you should use fragment shader, especially because your target GPU doesn't support compute shaders (which could be an alternative).

    Your problem is that you use n*n fetches in your fragment shader. But this is not the most efficient way.

    You should use a 2-pass separable Gaussian filter then you can reduce the number of fetches to 2*n. Also there are other techniques to reduce the fetch count.

    For more information check this article.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog:

  3. #3
    Newbie Newbie
    Join Date
    Apr 2014
    aqueous, thanks your reply, it's very helpful for me.

Posting Permissions

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