Planetside Software Forums

General => Terragen Discussion => Topic started by: mafriedl on April 20, 2017, 07:09:01 PM

Title: Help with the merge shader
Post by: mafriedl on April 20, 2017, 07:09:01 PM
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
Title: Re: Help with the merge shader
Post by: bobbystahr on April 20, 2017, 07:38:23 PM
Have you tried the Heightfield Merge in the Add Operator drop down in the terrain editor?
Title: Re: Help with the merge shader
Post by: mafriedl on April 20, 2017, 07:52:55 PM
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.
Title: Re: Help with the merge shader
Post by: 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
Title: Re: Help with the merge shader
Post by: mafriedl on April 21, 2017, 04:13:24 PM
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.
Title: Re: Help with the merge shader
Post by: Dune on April 22, 2017, 02:12:24 AM
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.
Title: Re: Help with the merge shader
Post by: mafriedl on April 27, 2017, 05:29:15 PM
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...
Title: Re: Help with the merge shader
Post by: Dune on April 28, 2017, 01:53:26 AM
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.
Title: Re: Help with the merge shader
Post by: Matt on April 28, 2017, 04:55:53 PM
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.
Title: Re: Help with the merge shader
Post by: mafriedl on April 28, 2017, 06:22:28 PM
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!