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

  • SEARCH
  • Home
  • 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 6079655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:58:17+00:00 2026-05-23T10:58:17+00:00

I’m looking to do a selective blur or surface blur on the GPU. I’ve

  • 0

I’m looking to do a “selective blur” or “surface blur” on the GPU. I’ve read some research papers on the subject, and seen a good deal of C code, but ideally I’d like something in GLSL, HSL, or CG.

  • 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-05-23T10:58:18+00:00Added an answer on May 23, 2026 at 10:58 am

    Actually, a bilateral blur is not very different from a gaussian blur, you just have to multiply the value of the sample by the gaussian factor multiplied by the result of a “closeness’ function between the actual values of the centre pixel and the sampled pixel.

    So, in pseude GLSL

    vec3 centreColour = texture2D(image,texCoord);
    vec3 result = centreColour;
    float normalization = 1;
    for (int i = 0; i < NUM_SAMPLES; ++1)
    {
       vec3 sample = texture2D(image, texCoord + offsets[i]);
       float gaussianCoeff = computeGaussianCoeff(offsets[i]);
    
       //depends on your implementation, this is quick
       float closeness = 1.0f - distance(sample,centreColour) / length(vec3(1,1,1));
    
       float sampleWeight = closeness * gaussian;
    
       result += sample * sampleWeight;
       noralization += sampleWeight;
    }
    vec3 bilateral = result / normalization;
    

    You should probably have a better way to determine the closeness value, eg do it in a perceptively uniform space such as LUV.

    For optimization, you can apply all techniques that work for gaussian blur, apart from the ones that ignore the fact you have to know the pixel’s value. For example, with a pure gaussian you can choose your texcoords wisely and integrate 4 pixels in one fetch. That won’t work.

    The big things that do work:

    *Separate your filter. Instead of 5×5 samples (25), do 5 horizontally, save to an intermediate buffer, and do 5 vertically. It won’t look exactly the same, but it will still remove noise.

    *Perform your filter on a lower resolution, and composit it with the orignal to get some detail back.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I would like to count the length of a string with PHP. The string

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.