Multiple Heightfields Question

Started by vossity, October 11, 2019, 02:55:11 pm

Previous topic - Next topic

vossity

Hi, 

I'm having trouble getting two heightfields to work in my scene. (both exported from world machine)
Currently they both show up, but I can't seem to get any textures to show up on the second heightmap. 
I'm terrible at explaining so I included some images to help. 

The first one is fine, as you can see but the second lacks any texture. It looks fine on it's own, meaning the bitmap I plugged into it does show up. 
I tried merging them in different ways but I can't seem to get anything to work. 
I'm a bit of a newbie with Terragen so I may just be missing something super obvious?

Thanks for the help in advance!

Oshyan

In Terragen it is generally best to create, load, or otherwise add data in a particular way, starting with terrain, then proceeding to surface shading and populations. This is how the default project is setup, to help illustrate this.

Terrain is created with displacement, which is additive (generally speaking; even when you are using negative displacement values, it's still being "added" to what's already there). You start with a flat planetary sphere, then you displace that to create terrain shapes using built-in fractal noise functions, imported terrains, etc.

If you import 1 terrain that creates a mountain and you position it at 0,0,0 and then import another terrain that creates a crater and connect it directly to the output of the mountain heightfield node, if you position it at 0,0,0 it will overlap the existing mountain and you will get a sort of merge of the two shapes, an additive combination of their height values. However if you move the new imported crater heightfield to a different location that is outside the area where the mountain heightfield exists, it will simply displace the flat plane of the planetary sphere, and will not affect the mountain, even though it is connected to the mountain heightfield's output. The two heightfields simply operate on the same base planet and operate in different areas. This is the simplest way of working and it is very effective if you have non-overlapping heightfields.

If you want to overlap your heightfields and blend them smoothly, you can instead use a Merge shader. With this node you can choose how the two inputs are blended, creating an Average, for example, instead of an Additive blend.

You also want to avoid having multiple Compute Terrain nodes. So again you want to create all your terrain shapes up in the Terrain area, wiring things in series where possible (i.e. for simple additive displacement blending), or using Merge nodes to gain more control where necessary, but *all* the output from the multiple terrain nodes should then go into a *single* Compute Terrain (in most cases). That then connects in to a single Base Colours node and brings you into the next stage, Surface Shading. 

Ideally you want to avoid additional displacement taking place in Surface Shading, although some smaller-scale stuff is generally fine. You will import your image maps and, if you simply position them with the same size and location as your corresponding heightfields, they will again not overlap or interfere with each other. I think that's the result you're aiming for here, judging by the screenshot.

- Oshyan

vossity

Thanks for your explanation! 
The image maps for both of the heightfields do not overlap, as they show up where I want them to go on their own (if that makes sense, I've placed them in accordance to the correct displacement). I instead tried merging the two image map shaders with a merge shader (and removed the secondary compute terrain) and it seems to be trying to mix the two images together. They seem to be in the correct spot however.  Is there a way to get the two image maps to not mix together? Playing with the modes and masks does not seem to do anything. 

Thanks!

Oshyan

What happens when you simply put them in-line, the output of one Image Map connecting to the input of the other, and then going into the Planet object? That's the configuration I'm suggesting.

- Oshyan

vossity

oh my goodness, that worked. I guess I was overthinking it way too much. 
Thank you so much for your help and the tips as well.

Oshyan

No problem, let us know if you have any other questions.

- Oshyan