I enthusiastically read Leland Brown's description of texture shading at  yesterday and prototyped it in Matlab (sorry) because I didn't have my Mac handy to run Terrain Texture Shader and I only had GeoTIFF from USGS, rather than FLT/HDR that the C implementation needed. It's entirely possible that my question would be answered by a closer study of the C source code, apologies in advance if that is the case.
I understand that the operation is a high-pass filter applied in the frequency domain, so I did that: result image at  and code at . My problem involves scaling of the resulting texture. The raw filtered texture has too high dynamic range: mapping its smallest and largest values to grayscale yielded washed out images, so I needed to use some narrower range of values to map to grayscale. For , I used the 0.5% and 99.9% quantiles of the texture's values.
My question then is whether there's a bug in my program that's causing the texture to have too large dynamic range? Or if that's inevitable, what is the recommended way to automatically select the values to clip at? For the examples Leland Brown presents, were they limited to a range smaller than what the algorithm results in, and if so, how were the limits chosen? It seems unlikely but would subsampling the input elevation map via spline interpolation (as suggested by Brown in his 2010 presentation slides) impact this at all?
 Image and some data details: http://imgur.com/WgX6qOB
 Code: https://gist.github....f33cd364dba6ee1