Jump to content


Texture shading questions

- - - - -

  • Please log in to reply
No replies to this topic

Ahmed Fasih

Ahmed Fasih


  • New Member
  • Pip
  • 1 posts
  • Gender:Male
  • United States

I enthusiastically read Leland Brown's description of texture shading at [1] 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 [2] and code at [3]. 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 [2], 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?


Many thanks!




[1] http://www.textureshading.com/

[2] Image and some data details: http://imgur.com/WgX6qOB

[3] Code: https://gist.github....f33cd364dba6ee1

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users