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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:18:13+00:00 2026-06-06T19:18:13+00:00

In WPF OuterGlowBitmapEffect is no longer supported nor rendered by Net4.0. DropShadow has a

  • 0

In WPF OuterGlowBitmapEffect is no longer supported nor rendered by Net4.0. DropShadow has a little in common and not acceptable in my case. My initial goal is to make a white blurry background for black ClearType text upon AeroGlass window to make it more readable on a dark scenes. I started to play with fx and HLSL. It is quite interesting and powerful but I still can not get closer to OuterGlowBitmapEffect.

My current dummy version that reflects the idea:

sampler2D  Sampler : register(S0);
#define PI 3.14f
float4 main(float2 uv : TEXCOORD) : COLOR
{
    float4 px = tex2D(Sampler, uv);

    /*
    if (px.a > 0.9)
    {
        return px;
    }
    */

    const float d = 3;

    int cnt = 0;
    float a = 0;
    for (float x = -0.1*d; x < 0.1*d; x += 0.05*d)
    {
        a += tex2D(Sampler, uv + float2(x, 0)).a;
        a += tex2D(Sampler, uv + float2(0, x)).a;
        a += tex2D(Sampler, uv + x).a;
        cnt += 3;
    }
    a /= cnt;

    float4 s = a;

    float4 r = float4(px.rgb*px.a + s.rgb*(1-px.a), max(px.a, a));

    return r;
}

BTW: can I get a HLSL source for DropShadowEffect to use it as a reference? Can someone point me to an OuterGlowEffect algorithm in any language?

NOTE: Windows 7 Aero Glass title bar have such effect to make title more readable! That exactly what I’d like to have for my text on other parts of window (DwmExtendFrameIntoClientArea applied) Aero Glass Window Title

  • 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-06T19:18:14+00:00Added an answer on June 6, 2026 at 7:18 pm

    The general idea is to render the white text first, then blur it. And finally to use the blurred white text as the background image for the black text.

    Your shader is a correct blur, but it’s somewhat inefficient (redundant samples for x=0, for example). You can create a good large blur with two passes: one horizontal and one vertical blur. HLSL code:

    float4 PS_BlurHorizontal( float2 Tex : TEXCOORD0 ) : COLOR0
    {
        float Color = 0.0f;
    
        Color += tex2D(sampler, float2(Tex.x - 3.0*blurSizeX, Tex.y)) * 0.09f;
        Color += tex2D(sampler, float2(Tex.x - 2.0*blurSizeX, Tex.y)) * 0.11f;
        Color += tex2D(sampler, float2(Tex.x - blurSizeX, Tex.y)) * 0.18f;
        Color += tex2D(sampler, Tex) * 0.24f;
        Color += tex2D(sampler, float2(Tex.x + blurSizeX, Tex.y)) * 0.18f;
        Color += tex2D(sampler, float2(Tex.x + 2.0*blurSizeX, Tex.y)) * 0.11f;
        Color += tex2D(sampler, float2(Tex.x + 3.0*blurSizeX, Tex.y)) * 0.09f;
    
        return Color;
    }
    
    float4 PS_BlurVertical( float2 Tex : TEXCOORD0 ) : COLOR0
    {
        float Color = 0.0f;
    
        Color += tex2D(sampler, float2(Tex.x, Tex.y - 3.0*blurSizeY)) * 0.09f;
        Color += tex2D(sampler, float2(Tex.x, Tex.y - 2.0*blurSizeY)) * 0.11f;
        Color += tex2D(sampler, float2(Tex.x, Tex.y - blurSizeY)) * 0.18f;
        Color += tex2D(sampler, Tex) * 0.24f;
        Color += tex2D(sampler, float2(Tex.x, Tex.y + blurSizeY)) * 0.18f;
        Color += tex2D(sampler, float2(Tex.x, Tex.y + 2.0*blurSizeY)) * 0.11f;
        Color += tex2D(sampler, float2(Tex.x, Tex.y + 3.0*blurSizeY)) * 0.09f;
    
        return Color;
    }
    // weights: 0.09 + 0.11 + 0.18 + 0.24 + 0.18 + 0.11 + 0.9 = 1
    // By default, weigths are symmetrical and sum up to 1,
    // but they don't necessarily have to.
    // You can change the weights to create more fancy results.
    

    These two 7-sample passes simulate a 7×7 gaussian blur (14 samples instead of 49). You can use more samples to improve the result (make blur wider) or just adjust the weights to create more soft look.

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

Sidebar

Related Questions

WPF's ItemsControl will display a focus rectangle when it thinks it has focus and
My WPF application has a feature whereby it renders a large number of images
A WPF program I'm writing in C# has the following interface on the back-end:
Somehow WPF Canvas has a lot of items which are NULL . Is there
WPF has the Typography.Variants attached property that lets you do superscript and subscript. However,
WPF control-derived class has a composition of non-WPF control-derived class . The latter class,
My WPF application has a number of buttons on its main window. I'm working
WPF uses XAML. Gtk has GladeXML, and associated tooling. Does something similar exist for
WPF 3.5 has PresentationTraceSources for diagnostics and WPFPerf for performance and data binding diagnostics.
WPF Toolkit, How to apply date format in C# for datepicker control?

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.