Spherical Blur


When I was working on technology for Metastream, one of the things I was doing was trying to make good spheremaps.

This utility is a rewrite of one piece of technology I did there, a "spherical blur." I've figured out how to make this thing run in real-time now, so I thought I'd post this slow noisy one.

This app is ugly because you have to run from the command line, but it will give you a nice graphical preview while it's rendering.

SBlur can take a spheremap: and blur it like this:

You can then mess with it in Photoshop, including using my Fresnel plugin to add edge highlights and make your own fake reflectance functions.

You can download the app here: SBlur [360kb] Here's some documentation (included in the zip.)

sblur: blurs a spheremap
Copyright (C) Herf Consulting LLC 2000-2001. All rights reserved.

Usage: inputfile.JPG diffusesamples specularsamples shininess

The input is a JPG, and output is a "max quality" JPG.

It needs three values as input.

  1. Diffuse samples: number of samples to use for computing hemispherical (diffuse) reflection. Typically use 20 for a preview, 200 for a medium-noisy result, and 500-1000 for final-quality.

  2. Specular samples: Used for weighted sampling of specularity.

    If your shininess is high, you must use more samples to get rid of noise. For high specularity (50+) 5000 or more samples is not unreasonable.

  3. Shininess: Analogous to Phong shininess (50-100 is shiny).


Generally, you can start tweaking material parameters using low numbers of samples (<200 for each), and then just multiply by 10 for a final render.

Use many more specular samples than diffuse, since they're "weaker" and, as a result, noisier too. If you wanted, say, equal parts diffuse and specular, you might need 10x as many specular samples.

Weighting of specular vs. diffuse is not predictable (though it will make sense if you don't change shininess), but in general you have to do it visually.


All files will be written with their parameters in the filename, so you can remember the values.


Blur the jpg at low quality (50 diffuse samples), no specular:
> SBlur bryce.jpg 50 0 0

Blur the jpg at medium quality, with specular coefficient 25:
> SBlur bryce.jpg 500 2000 25

Thanks to Ben Weiss for the "bryce.jpg" I've used as an example file.