Author Topic: Help with the merge shader  (Read 609 times)

Offline mafriedl

  • Member
  • *
  • Posts: 9
Help with the merge shader
« on: April 20, 2017, 11: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
« Last Edit: April 21, 2017, 01:46:11 AM by mafriedl »

Offline bobbystahr

  • Member
  • *
  • Posts: 7639
  • Turn, and face the Strange Ch Ch Changes...D Bowie
Re: Help with the merge shader
« Reply #1 on: April 20, 2017, 11:38:23 PM »
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

bobbystahr

Offline mafriedl

  • Member
  • *
  • Posts: 9
Re: Help with the merge shader
« Reply #2 on: April 20, 2017, 11: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.

Offline Matt

  • Planetside Staff
  • *
  • Posts: 2816
  • I'm the crazy one
Re: Help with the merge shader
« Reply #3 on: April 21, 2017, 07: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
Just because milk is white doesn't mean that clouds are made of milk.

Offline mafriedl

  • Member
  • *
  • Posts: 9
Re: Help with the merge shader
« Reply #4 on: April 21, 2017, 08:13:24 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.

Offline Dune

  • Member
  • *
  • Posts: 12394
  • Corkscrew Bird
    • www.ulco-art.nl
Re: Help with the merge shader
« Reply #5 on: April 22, 2017, 06: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.
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline mafriedl

  • Member
  • *
  • Posts: 9
Re: Help with the merge shader
« Reply #6 on: April 27, 2017, 09: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...

Offline Dune

  • Member
  • *
  • Posts: 12394
  • Corkscrew Bird
    • www.ulco-art.nl
Re: Help with the merge shader
« Reply #7 on: April 28, 2017, 05: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.
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline Matt

  • Planetside Staff
  • *
  • Posts: 2816
  • I'm the crazy one
Re: Help with the merge shader
« Reply #8 on: April 28, 2017, 08: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.
Just because milk is white doesn't mean that clouds are made of milk.

Offline mafriedl

  • Member
  • *
  • Posts: 9
Re: Help with the merge shader
« Reply #9 on: April 28, 2017, 10: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!

 

anything