0

Suppose, I have a gray-scaled height map and ten layers with different diffuse textures or solid color textures.

I would like to blend these texture layers in a way determined by the heightmap, as follows: If a heightmap pixel is white, then pixel in the result will come from layer 10; if the heightmap pixel is black, from layer 1; if it’s between, it will show a layer between.

It’s like a terrain where on top there is a snow texture, and at the bottom, there is a water texture.

  • Do you want to mix the different layers as well? E.g., if your heightmap pixel is 5 % black, your final pixel will be half between the corresponding pixel from layer 10 and 9? – Wrzlprmft Dec 28 '14 at 23:08
  • I've done something similar with GNU Octave. You can load the images as matrix of pixels and perform conditional operations (see also here and here). You can save the procedure for further use. – Paolo Gibellini Dec 29 '14 at 16:25
1

Duplicate the height map channel to an alpha channel. For each channel layer

  • Then use threshold filter on each layer alpha so that the one with highest threshold is the back most layer.
  • apply the alpha to your layer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.