Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9221715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:38:11+00:00 2026-06-18T03:38:11+00:00

I’m trying to do gaussian blur with OpenGL ES on my Android device. I

  • 0

I’m trying to do gaussian blur with OpenGL ES on my Android device. I use the method which is mentioned in

http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/

There is two framebuffers(A and B) in my app. Blur one dimensional by drawing A to B, and blur the other by drawing B to A. It’s all right when only one image being blurred, it may catch up 50fps. But if the is more image being blurred, even very small, the FPS drops to 4~5. It’s terrible to use this approach.

My questions are:

  1. Is the performance issue caused by switching the two FBOs multiple times in one frame?

  2. Is there any better way to do ping-pong rendering on Android devices.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:38:12+00:00Added an answer on June 18, 2026 at 3:38 am

    You should use just one buffer and blur them in both directions at once.

    Here is a standard OpenGL shader that I use and found it very simple.

        uniform sampler2D texture_map;
        uniform float blur;
    
        uniform float blur_Size;
    
        float blurSize = 1.0/blur_Size; // I've chosen this size because this will result in that every step will be one pixel wide if the texture is of size 512x512
    
        void main() {
    
        if (blur!=0.0){
    
               vec4 sum = vec4(0.0);
    
               // blur in y (vertical)
               // take nine samples, with the distance blurSize between them
               sum += texture2D(texture_map, vec2(texcoord.x - 4.0*blurSize, texcoord.y)) * 0.05;
               sum += texture2D(texture_map, vec2(texcoord.x - 3.0*blurSize, texcoord.y)) * 0.09;
               sum += texture2D(texture_map, vec2(texcoord.x - 2.0*blurSize, texcoord.y)) * 0.12;
               sum += texture2D(texture_map, vec2(texcoord.x - blurSize, texcoord.y)) * 0.15;
               sum += texture2D(texture_map, vec2(texcoord.x, texcoord.y)) * 0.16;
               sum += texture2D(texture_map, vec2(texcoord.x + blurSize, texcoord.y)) * 0.15;
               sum += texture2D(texture_map, vec2(texcoord.x + 2.0*blurSize, texcoord.y)) * 0.12;
               sum += texture2D(texture_map, vec2(texcoord.x + 3.0*blurSize, texcoord.y)) * 0.09;
               sum += texture2D(texture_map, vec2(texcoord.x + 4.0*blurSize, texcoord.y)) * 0.05;
    
               sum += texture2D(texture_map, vec2(texcoord.x, texcoord.y - 4.0*blurSize)) * 0.05;
               sum += texture2D(texture_map, vec2(texcoord.x, texcoord.y - 3.0*blurSize)) * 0.09;
               sum += texture2D(texture_map, vec2(texcoord.x, texcoord.y - 2.0*blurSize)) * 0.12;
               sum += texture2D(texture_map, vec2(texcoord.x, texcoord.y - blurSize)) * 0.15;
               sum += texture2D(texture_map, vec2(texcoord.x, texcoord.y)) * 0.16;
               sum += texture2D(texture_map, vec2(texcoord.x, texcoord.y + blurSize)) * 0.15;
               sum += texture2D(texture_map, vec2(texcoord.x, texcoord.y + 2.0*blurSize)) * 0.12;
               sum += texture2D(texture_map, vec2(texcoord.x, texcoord.y + 3.0*blurSize)) * 0.09;
               sum += texture2D(texture_map, vec2(texcoord.x, texcoord.y + 4.0*blurSize)) * 0.05;
    
               gl_FragColor = sum/2.0;
            }
    

    Feed The uniform blur_Size the width or height ( which ever is bigger). If thats too much blur or to little just adjust the number you feed in. But width and height are a good place to start. The bigger the number the more blur. Also try averaging the two. If the image is really rectangular your blur may be way too large.

    60 on a 60×60 image is a 1:1 blur but if your image is say 512×512 a blur of 60 is going to be hardly noticeable. The blur is a ratio of blur amount to image size.

    Its a hack and slash method buts its quick and simple with no algorithms.

    best of luck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to select an H1 element which is the second-child in its group
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
link Im having trouble converting the html entites into html characters, (&# 8217;) i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.