• Advertisement

Archived

This topic is now archived and is closed to further replies.

HLSL or CG Blur code? How?

This topic is 5269 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm trying to do a number of effects such as glow, bloom, Depth of Field etc. with HLSL. All these effects require a fast blur. I looked at a number of papers from ATI and nVidia however I still am confused about the concept and do not really understand what they mean about the sampling kernel, or more precisely I don't know how to (by what amount)offset the TEXCOORDS for the Pixel shader. I would GREATLY appreciate if anyone could show me a simple way to apply Blur (any type such as Box filter etc.) to a texture with either HLSL (preferred) or Cg. THANKS! [edited by - splitn on August 15, 2003 12:32:08 AM]

Share this post


Link to post
Share on other sites
Advertisement

Well the sample kernel is known by another name in the field of computer vision: "convolution kernel". Convolutions are essentially a way of combining a pixel and its surrounding pixels in a certain way. In the ATI samples, the blur kernel takes left, right, top and bottom pixels and combines them to alter the colour of the center pixel.

I guess your depth of field effect will require a Z read - to "scale" the blur effect according to the depth buffer value. The ATI sample provides a basic blur. I''ve never done this before, so apologies if I''m not helping any



Share this post


Link to post
Share on other sites

  • Advertisement