Page 1 of 1

Outline order?

PostPosted: Tue Mar 20, 2018 1:50 pm
by CrashDummy
Hello,

I commissioned a small shader that apparently has been made with Amplify Shader. This shader has a beautiful outline that is customizable from the inspector.

I have a cylinder that fits into a slightly larger cylinder (sort of pants) and both have the material with different colors outlines.

The problem is that the slightly smaller cylinder outline peeks behind the slightly bigger cylinder.

Here's a photo:

Image

Is there a way I can manually fix this by myself? Or can something be done with ASE?

Thank you in advance!

Re: Outline order?

PostPosted: Tue Mar 20, 2018 4:08 pm
by Amplify_Borba
Hello, thank you for getting in touch and for your support!

It would depend on the technique used for the outline, could you send us a sample of your shader to [email protected] so that we can examine it on our side? Thanks!

Re: Outline order?

PostPosted: Tue Mar 20, 2018 6:56 pm
by CrashDummy
Hi, thanks to you for your answer.

Here's the snippet of the outline part:

https://pastebin.com/j2tL2pUD

The programmer says that he simply checked the "outline" options in the shader editor and hooked up the outline color to the vertex color of the mesh.

Re: Outline order?

PostPosted: Wed Mar 21, 2018 11:55 am
by Amplify_Borba
Thank you for sharing additional details!

If the scale of the smaller object is close to the scale of the larger one, there is indeed some depth fighting between both outlines, however, as you decrease the scale of the smaller object you might notice that the larger one's outline should effectively overlap the smaller one's outline.

In order to best help you, I'm going to need some further information regarding the specific effect you're looking for, if possible being exemplified as a video or a screenshot, so that we can point you the right way, thanks!

Looking forward to your reply!

Re: Outline order?

PostPosted: Wed Mar 21, 2018 12:55 pm
by CrashDummy
Sure!

Image

Unfortunately I can't post the entire shader because of the NDA. Anyway the first CGPROGRAM contains the snippet I posted above (the outline itself).

Cyl1 and Cyl2 are both at xyz 0, 0, 0. Cyl2 is slightly larger than Cyl1 (as you can see in the "current" view the outline is slightly larger). However, Cyl1's outline is still visible.

Thank you for your interest, I really appreciate it.

Re: Outline order?

PostPosted: Thu Mar 22, 2018 10:51 am
by Amplify_Borba
Unfortunately, this type of behavior is expected and not an easy one to manipulate. I would suggest looking into the Render Queue parameter of the Output node and the Depth options, in order to try and approximate the results to the shared image. Despite seeming like a simple depth issue, it might have further implications regarding this technique.

As requested in my previous post, providing further information regarding the specific effect you're looking for, with additional details such as the application and expected final result, would hopefully allow us to point you the right way.