Quote Originally Posted by töff View Post
It seems to me, without having tried it, that the directional masks might be generated more easily from the height map with 4 applications (n,s,e,w) of photoshop's standard "render lighting" filter.

Feel free to Fred Picker Stamp me ...

This is all a very clever idea with great results. Cheers!
If I had photoshop, I might try it

I've actually come up with a much better way than the curves I was playing with.

I illuminate (emboss) three copies of the heightfield at 0, 120 and 240 degrees.
These get combines as RGB layers into a new image.
That RGB image gets converted into a HSV image and the H layer is grabbed out. This layer represents the direction (without magnitude) of the heightfield as a value from 0 to 255. I then posterize that layer into the number of faces desired, and select each colour sequentially, using that as a mask for rotated copies of the pattern.

It takes a while to run, especially for large images, but I like the results.

And it lets you (if desired) use up to 16 faces when generating the result:
thatch_16.png

I think I worked out the last couple of bugs on the weekend, so I will post it up, hopefully tomorrow.

-Rob A>