Home Unreal Engine

UDK Replace instead of just Blend for Height Maps

polycounter lvl 15
Offline / Send Message
Autocon polycounter lvl 15
So I was curious if you can instead of blending 2 height maps together, use one height map as the base and one as the replace map.

Example

I have a cobble stone texture, I want to blend in some sand. I want the sand to of course blend into the cracks of the cobble stone and fill up until it more of less hides all the stones.

The problem is, that with normal blending you are taking a pixel from 1 height map and blending it with another height map until they are the same color. So if you had a black height map and were blending with a white one it would be turning your resulting heightmap grey.

I want to have a sort of threshold where it wont show sand until the pixels in height map 1 are whiter then they are in height map 2 (which could just be a constant white color)



Not sure if this is possible and I couldnt think of anything that would allow you to blend but not replace the texture until the result of the blended heightmap is greater then the original.

You can see the issue occur if you blending with tessellation. The cobblestones should never change height, but when blending in the sand it changes the height of the cobblestone instead of keeping them static and just waiting until the sand would be able to actually cover up the stones.

Replies

  • tharle
    Options
    Offline / Send Message
    tharle polycounter lvl 9
    if you're doing this with vertex painting and the material editor then you can use an if node to compare the two height maps. multiply the sand height map by the vert colour channel and where it's greater than the cobblestones height map use that, where lesser use the cobblestones height map. use the resulting blended heightmap as a mask for your textures etc. and you should get what you want. note it'll be quite a sharp edge between the two as you cant really control the falloff when using an if node like this.
  • ambershee
    Options
    Offline / Send Message
    ambershee polycounter lvl 17
    Why not just use the heightmap to determine which parts to mask?
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    I'm confused by the question, mind showing a paint-over of what you mean?
  • Autocon
    Options
    Offline / Send Message
    Autocon polycounter lvl 15
    Sorry damn work keeps getting in the way! ha.

    Doing some tests and kinda got what I wanted working, tried the IF node, didnt get that working, possibly inputting things wrong? Not sure.


    So the issue I am having with the first image is that although the sand is fully covering up the stone tiles when it is blending and its not 100% stone or 100% sand it is actually moving the geo. The stones get raised up as they are blending into the sand. When they should remain the same height forever and only raise up when they become full sand.

    Also in areas where the stones height map is very dark, like the crevasses and it blends to the sand height map, which is a lot brighter, you get spikes in those recesses and they dont blend very well. The spiking issue is the worst of it, if I have to live with the fact that the stones move up or down as the sand is blending on or away I can live with that.



    Bottom part of the image is the IF node. Its not filling in the sand into the gaps.

    tessellationground.jpg
Sign In or Register to comment.