I hope I can make this clear. I want to combine two heightfields, one of low dunes and another of rocks and mesas that will protrude from the dunes, so the combine function will be MAX. I want to color/texture the rocks and mesas differently from the surrounding sands, and because there is overlap in the sand and rock heights-- rocks emerging from the troughs between dunes are lower than the surrounding dunes, for example, while mesas tower over all the dunes-- I need to use a mask to differentiate between them. What I have in mind is a mask where each pixel = 1 if it was derived from the rocks input heightfield and 0 if it was derived from the dunes input heightfield. Any hints on how to do this? I’m something of a WM newby, so please be gentle and assume more or less complete ignorance! :shock:
I’m also having some difficulty combining the heightfields-- actually the problem is in loading them as bitmaps-- but I asked that question in a separate post.
Hi!
I made a macro sometime back where I did sort-of that differentiation… Let me find it… … not this one… ah! here it is… I called it “Abs. Difference”… I think it made it’s way into WM’s normal realease, so everyone might have it… It works for WM (Basic or Standard) 1.0 or later… If you don’t have it, it is basicly the following:
Both terrains are subtracted one from the other (A-B and B-A) and both these differences are combined (Max)… Simple! What this means is that you subtract one terrain from the other to get the portion of terrrain A that is above terrain B, OR portion of terrian B tat is above terrain A…
This is probably too complex for what you want, and perhaps a simple subtractin is what you need! If rocks are always heigher than dunes, you want to subtract (rocks - dunes = rocky_zone)
:arrow: You then need to use bias/gain to pump up all non-zero values to 1, or use a Height Selector to select the 0-height only (best method for a 1/0 mask) and then invert that with an Inverter.
In any case, the “Abs. Difference” Macro also has outputs for each partial subtraction, so you can use it anyway!
If you don’t have it, you can get it here: Abs. Difference Macro
Thanks! That answered that question, I think. I’m still having trouble with the one in the other thread, however, if you don’t mind taking a look over there again.