I was revisiting some of our old shader code (order 2, i.e. 9-coefficients) trying to fix ringing in some high contrast environments. I am looking at Stupid Spherical Harmonics (SH) Tricks by Peter-Pike Sloan, the section about Windowing.
The Lanczos and Han functions mentioned are of form:
respectively, for a given filtering window of width "w". The rest of text, as far as I can see, seems to imply that w should be equal to the order of SH used. (w=6 for 6th order).
Initially, I would expecting filtering to be done by convolution in spatial domain, by projecting the filter function to the SH basis and then multiplying its y[l,0] coefficients into appropriate bands (y[l,m]) of the filtered function. However, all the other notions in there seem to point to this actually being done as multiplication in frequency domain. More specifically, as if the filtering function as presented here above _already is_ the frequency domain presentation. So it would just multiply of y(l,m) coefficients of the filtered function by values of the filter evaluated at integers.
This looks rather unusual to me, but I guess there is some reasoning behind all that.
As a side note, I got some ok-ish results with filtering in spatial domain (aka. bluring) using Han function as above (*) with value w=1.5 through convolution as described above. (Where the number w=1.5 was "tuned" by manual binary search with visual assessment of results to minimize visible ringing without introducing "too much" blur.) While on the other hand, using the multiplication directly in frequency domain looked way too blurry for w=3 and was ringing too much if I tried increasing the number (as with multiplication in the frequency domain wider "window" leads to less blur, while it opposite happens in the spatial domain.)
I would appreciate if anyone can shed a bit of light onto this.
Thanks a lot in advance,
(*) That form of the function does look strange for spatial domain but 1.5 is an arbitrary "hand-tuned" factor anyway.
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
GDAlgorithms-list mailing list