merging two heightfields

Started by monks, October 22, 2008, 06:18:54 AM

Previous topic - Next topic

monks

Hi, I've got two terrains. The first is the dem, the second is a ter of the snow coverage including glaciers. How would I combine the two so that they align correctly (that is vertically)?
I've tried a few things so far including the merge shader and the heightfield merge node. I'm not quite getting the results I want...The glacier ter has it's height range normalised (0 -...) so I'm guessing an add mode would be best for that.

Any help much appreciated
monks

FrankB

Maybe you should include a few renders to depict the issue? I'm not quite certain I can follow your explanation. I have been merging terrains before, maybe I can help, but also other will be able to help once the problem you're facing become - hmm...more visual.

Regards,
Frank

monks

Thanks Frank, all I am trying to do is to add one heightfield to another: that is an ice heightfield to  a terrain heightfield. One should sit atop the other.
The ice heightfield has all alts set to zero where there is no ice. So *Adding* it to the terrain dem should give the correct results.

The thing that's confusing me is what role (if any) an image map shader plays in this. If I have a terrain of the ice, do I also need an image map shader of the ice coverage involved...? I'll post a pic later, thanks again :)

monks

FrankB

I think you are making the folowing mistake, all provided I understood correctly.

"Adding" the ice heightfield to the other is not what you want. This is why: Let's say a given point on your landscape is 100 m high. The height of the same point - but on the ice heightfield - is 102m high. If you ask TG2 to add the two heightfields, the result will be a point that is 100+102=202m high.
Instead, you want (using the hieghtfield merge shader) have TG2 choose the highest from those two heightfields, at any point. You would have to set "Merge mode" to "highest" to get that result.

Let us know if that works for you.
As a side remark I would like to say that I don't believe this will be a good method for realizing your idea. Along the edges of your "ice mask", you will have pretty steep slopes for the ice, I would guess.

Regards,
Frank

monks

#4
The ice heightfield has been normalised so that it ranges from 0m =  lowest point of ice, so adding is working I think. 
The effect I'm looking for is that the ice has depth but it also allows the mountain terrain (the lower dem) to poke though in places like this.

http://forum.cartographersguild.com/attachment.php?attachmentid=7204&d=1224381242

Currently I have this:
[link expired]

-the ice has edges are created by the software (GTS) as viscous fluid flow so it does tail off naturally:
[link expired]

-but I'm not getting the terrain poking through:
[link expired]

I'm sure it has something to do with the fact that I'm using both an imagemap shader and the ice terrain at

the same time in the network...could be. Here's the network:

[link expired]


the heightfield adjust is currently doing nothing so it's not that...

hmm, the heightfield merge node is set to 'mix'.

the merge shader at bottom is set to 'add'


monks

bigben

#5
This is looking overly complicated.  Tackle each part of the problem separately.  The following might do what you want.

1: In the displacement tab of each terrain, uncheck Flatten first (if you don't you have to check Use Y for altitude in step 3)
Connect the adjusted glacier/snow terrain into the input of the terrain's heightfield shader.  This adds the 2 terrains together, no need for merging.

2: Create your snow surface

3: Create a blending shader for your snow surface

  • Connect your adjusted snow terrain into a Text Coords from XYZ (don't need normals)
  • Connect this to a distribution shader and set the minimum altitude to something small like 0.1 and the fuzzy zone to 0
  • Use this as your blending shader for the snow surface.

monks

Thanks Ben. I've had a look at this and it's not working for me yet...I learned a couple of things here though, so it's slowly slowly. I'll do some more tinkering later.

monks