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.

  • \$\begingroup\$ You could try implementing bilinear filtering yourself; it's not terribly difficult, although slower than hardware bilinear. However if that's too slow, or one bilinear tap doesn't give good enough results, you might just need to bite the bullet and convert to 8-bit format and/or do several taps. Or target DX11 hardware :) \$\endgroup\$ – Nathan Reed Oct 11 '13 at 0:39
  • \$\begingroup\$ see my answer here gamedev.stackexchange.com/questions/18662/… and rate it up if you like \$\endgroup\$ – Quonux Oct 17 '13 at 20:05

I Guess what you are perusing are more of a physical correct rendering when having more dirtier surfaces.

A Good approach is to reflect multiple rays in a hemisphere around the original reflection vector. from there you can blur them or just sum them for a easy but fast effect.

Of course you could blur the original image, but if you want different materials to have different "Roughness" you should think about blurring the original crisp image instead.

  • \$\begingroup\$ Thanks, this worked very well. It's both more physically correct and more efficient than blurring. \$\endgroup\$ – concernedcitizen Oct 29 '13 at 12:46
  • \$\begingroup\$ Im glad i could help! \$\endgroup\$ – Tordin Oct 29 '13 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.