Help with the merge shader

Started by mafriedl, April 20, 2017, 07:09:01 PM

Previous topic - Next topic

mafriedl

Anyone able to help out with this scene? There are two terrain networks derived from the same heightfield. One is rough (green) and the other smooth (red). My intent is to merge these two terrains so that they intersect based on whichever is highest and they keep their color. This setup does exactly that (see the first example image), until I add more displacement to the terrain - in this case via the power fractal shader. Then the color does not intersect in the same spots as the displacement intersects. My guess is that it's a compute terrain issue, and I've tried adding additional compute terrains after the power fractal displacement/before the merge shader, but no luck. No matter what I try the color doesn't intersect in the same spot as the displacement intersects.

Thanks in advance for taking a look at this - scene file and heightfield attached

bobbystahr

Have you tried the Heightfield Merge in the Add Operator drop down in the terrain editor?
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

mafriedl

Thanks for the response bobbystahr. I hadn't because I want to have two distinctly different sets of terrain merged with a hard intersection between their color and displacement. As far as I know the heightfield merge would blend the terrain before any additional displacement and color info was added. I'm ultimately looking to place color based on where the geometry of the two different terrains intersect, so I couldn't do that with a heightfield merge. I hope that clarifies the result I'm looking for.

Matt

I'm looking into it. Without the Compute Terrain it works correctly, but then you lose the lateral displacement. I'm trying to work out a solution now.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

mafriedl

Quote from: Matt on April 21, 2017, 03:35:33 PM
I'm looking into it. Without the Compute Terrain it works correctly, but then you lose the lateral displacement. I'm trying to work out a solution now.

Matt


Thanks so much for looking into this Matt! for what it's worth I rearranged the script this morning based on some other forum posts I had seen. The problem is still there though.

Dune

If you need a really hard distinction, why not put each path onto a different planet? Or perhaps use a set of displacement to scalars, and subtract for different lines of additional colors/displacements. Then only use one compute terrain after the merge, and have the laterals masked by the subtracted scalars.

mafriedl

Putting each path onto a different planet actually was a pretty good solution, thanks for that. The only issue now is that I'm getting pretty bad flickering when I render through an animated camera, presumably where the two terrains line up very closely...

Dune

Mmm, that's too bad. The only thing that comes to mind now is using render layers to animate planets separately, but I wouldn't know if that is 1. possible, and 2. would solve the problem.

Matt

Maybe the flickering is caused by something else such as GI? I wouldn't dismiss the two-planet method yet. If you can send us a few frames (either here or the support address) we can probably narrow down what's causing it and suggest ways to fix it. If it really is caused by the proximity of the two surfaces, the Animation Check button might help.

Regarding the original Merge Shader issue, I've been working on some improvements which I hope we can release soon, but I wasn't able to really make it work well with the version you have, I'm sorry to say. A different setup might work though.
Just because milk is white doesn't mean that clouds are made of milk.

mafriedl

I've been using a single file GI cache so there isn't any GI flickering. It looks more like faces of the geometry intersecting. I just sent an email with a link to download an image sequence and scene files to support@planetside.co.uk. Thanks for taking a look!

As for the merge shader, I'm glad to hear that there's a solution in the works!