What is the most efficient way to blur in a shader?

Posted by concernedcitizen on Game Development See other posts from Game Development or by concernedcitizen
Published on 2013-10-10T19:46:13Z Indexed on 2013/10/18 10:19 UTC
Read the original article Hit count: 479

Filed under:
|
|

I'm currently working on screen space reflections. I have perfectly reflective mirror-like surfaces working, and I now need to use a blur to make the reflection on surfaces with a low specular gloss value look more diffuse. I'm having difficulty deciding how to apply the blur, though.

My first idea was to just sample a lower mip level of the screen rendertarget. However, the rendertarget uses SurfaceFormat.HalfVector4 (for HDR effects), which means XNA won't allow linear filtering. Point filtering looks horrible and really doesn't give the visual cue that I want.

I've thought about using some kind of Box/Gaussian blur, but this would not be ideal. I've already thrashed the texture cache in the raymarching phase before the blur even occurs (a worst case reflection could be 32 samples per pixel), and the blur kernel to make the reflections look sufficiently diffuse would be fairly large.

Does anyone have any suggestions? I know it's doable, as Photon Workshop achieved the effect in Unity.

© Game Development or respective owner

Related posts about XNA

Related posts about reflection