XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

Blur and Edge Detect Image using adjustable amounts in HLSL

Last post 3/29/2009 6:15 PM by Shawn Hargreaves. 3 replies.
  • 3/28/2009 10:07 PM

    Blur and Edge Detect Image using adjustable amounts in HLSL

    Hi HLSL gurus,
      I've been away from XNA for about 2 years and finally have some time to play with it some more.
    I am totally new to HLSL but am looking to implement some simple HLSL effects just to get a hang of how it all works.

    Does anyone have a simple example and possibly explanation of how to blur an image using HLSL?
    I know there is a Guassian blur sample, but there is not explanation to go with it, unfortunately.

    Also how could I add a glow around brighter areas of an image? Is that what is called a bloom effect or is that something else?

    I'm quite new to real-time image processing so any hints would be usefull.


    Thanks.

    There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.
    -= Paulo Coelho =-
  • 3/29/2009 5:39 PM In reply to

    Re: Blur and Edge Detect Image using adjustable amounts in HLSL

    After some refined searching I think the following links may prove usefull to others looking for this sort of thing, or at least send you on the right track...

    http://khason.net/blog/hlsl-pixel-shader-effects-tutorial/

    http://www.gamasutra.com/features/20010209/evans_01.htm

    http://www.hyper-metrix.com/processing-js/docs/index.php?page=Gaussian%20Blur

    http://http.developer.nvidia.com/GPUGems/gpugems_part01.html

    http://developer.nvidia.com/object/gpu-gems-3.html

    http://www.gamasutra.com/features/20040526/james_01.shtml

    http://www.ziggyware.com/readarticle.php?article_id=147

    I hope I can break through to the tunnel of enlightenment.
    There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.
    -= Paulo Coelho =-
  • 3/29/2009 6:00 PM In reply to

    Re: Blur and Edge Detect Image using adjustable amounts in HLSL

    And http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html got a good collection of shaders.

    Anyways, good luck, just ask if there is anything you want to know :)
    Petri Wilhelmsen
    Dark Codex Studios

    Blog | Twitter

    Microsoft XNA/DirectX MVP
  • 3/29/2009 6:15 PM In reply to

    Re: Blur and Edge Detect Image using adjustable amounts in HLSL

    Yes, that's called a bloom effect. Bloom works by identifying the bright parts of the image, blurring them, and then blending that blurred result back over the original image.

    Blur is normally done in two passes, for efficiency: first you blur along the horizontal axis, then blur the resulting image a second time along the vertical axis.

    The bloom sample (in the education section on this site) implements exactly that in an easily reusable format, and with lots of tweakable parameters. If you have specific questions about how this works, feel free to ask them here.

    Bloom is kind of an advanced effect, though. If you are new to HLSL, it might be better to start with the Sprite Effects sample, and the Shader Series of samples.
    XNA Framework Developer - blog - homepage
Page 1 of 1 (4 items) Previous Next