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 499065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:56:51+00:00 2026-05-13T05:56:51+00:00

I am using the following code to create a dynamic reflection of an image:

  • 0

I am using the following code to create a dynamic reflection of an image:

{
input image4 src;
output pixel4 dst;

parameter float imageheight
<
    minValue: 0.0;
    maxValue : 1000.0;
    defaultValue :300.0;

>;

parameter float fadeheight
<
    minValue : 0.0;
    maxValue: 1000.0;
    defaultValue: 50.0;
>;

parameter float fadealpha
<
    minValue : 0.0;
    maxValue : 1.0;
    defaultValue : 0.5;
>;

void
evaluatePixel()
{
    float2 coord = outCoord();

    if ( coord[ 1 ] < imageheight ) {
        dst = sampleNearest(src, coord );
    } else {

        float alpha = 1.0 - ( coord[ 1 ] - imageheight ) / fadeheight;

        coord[ 1 ] = imageheight - ( coord[ 1 ] - imageheight );

        dst = sampleNearest( src, coord );            
        alpha *= fadealpha;
        dst.a *= alpha;
        dst.r *= alpha;
        dst.g *= alpha;
        dst.b *= alpha;

        float2 pos = outCoord();
        pixel4 color = sampleNearest(src,pos);

        color+=0.75*sampleNearest(src, pos+float2(0.5*2, 0))+0.25*sampleNearest(src, pos+float2(2, 0));
        color+=0.75*sampleNearest(src, pos-float2(0.5*2, 0))+0.25*sampleNearest(src, pos-float2(2, 0)); 
        color+=0.75*sampleNearest(src, pos+float2(0, 0.5*2))+0.25*sampleNearest(src, pos+float2(0, 2));
        color+=0.75*sampleNearest(src, pos-float2(0, 0.5*2))+0.25*sampleNearest(src, pos-float2(0, 2));

        dst = color/5.0;
    }       
}

}

It’s working nicely, but I’d really like to blur the output of the reflection slightly to give it a glossy look. I’ve had a google, but all the results seem incredibly complicated. Is creating a blur effect (similar to the Flash inbuilt filter) very difficult to do in Pixel Bender?

In this instance, I am not able to apply the Flash filter, so it has to be done in Pixel Bender.

  • 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-13T05:56:51+00:00Added an answer on May 13, 2026 at 5:56 am

    It’s quite simple actually, all you need to do is take a create a new image of the same size, and then make each pixel of it an average of the pixels at that position and surrounding in the image you want to blur. The output is more blurry the more pixels you take. For example you could blur each pixel with the pixels above, below, left and right. Or you could use the pixel and all 8 others touching… If you want you can also give the previous pixel value more weight than the surrounding ones, for a different effect. Best way is to just try stuff out until you get the desired effect.

    By the way that first kind of blur is referred to as “Average”. The latter way can be done by using a Gaussian distribution to weight the pixels if you’re using many of them – a Gaussian blur.

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

Sidebar

Related Questions

I am running following code to create bmp image from pdf using Ghost4j i
I am trying to create some dynamic sql using the following code block firstSqlStatement
I am using following code to create new wifi access point and to connect
I'using the following code to create thumbnails using ffmpeg but it was working fine
I'm using the following code to create an audit trail in an MVC3 app.
I've been using the following code to create various struct, but only give people
I am using the following line of code to create a dictionary which stores
I'm using the following lines of code in my .htaccess file to create redirects.
Okay, so I've got the following code shown below to create a dialog using
Suppose I have the following: using(var ctx = DataContextFactory.Create(0)) { ... Some code ...

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.