Silhouette Shader

Node-based Shader Editor

Silhouette Shader

Postby sazberryftw » Tue Feb 13, 2018 11:57 am

Hi,

Is it possible to use ASE to create a silhouette shader? I'm aware of the Outline feature built into ASE currently, but this seems to render an outline on all edges rather than just the silouhette based on the camera position.

I've also noticed that with the Outline feature I get floating outlines if my models are using their own imported normals or on intricate details. Calculating normals within Unity fixes this issue but I don't want to manually calculate normals.

I've attached some screenshots to explain what I mean.
Attachments
Silhouette_Shader.jpg
Silhouette_Shader.jpg (176.54 KiB) Viewed 5580 times
sazberryftw
 
Posts: 27
Joined: Wed Aug 23, 2017 1:38 pm

Re: Silhouette Shader

Postby Ricardo Teixeira » Tue Feb 13, 2018 2:07 pm

Hello,

Thank you for reporting the issue, we would be happy to examine it!

Can you share a sample for further testing on our side? (model and shader)

Feel free to send file download links directly to [email protected].

Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Silhouette Shader

Postby sazberryftw » Tue Feb 13, 2018 2:41 pm

Hi Ricardo

Thanks for getting back to me. In regards to the issue with the current Outline effect - I'm not entirely sure what to send you. All I'm using is the tick box for "Outline", and this issue occurs on anything that doesn't have soft normals (such as a standard Unity cube).

However, I am looking for information on whether there are nodes that will let me create a silhouette effect instead of the way the Outline effect currently works. I want the outline to only be around the outer edges based on the position of the camera.

The desired effect below is not done with an Amplify shader.
Attachments
Silhouette_Shader_02.jpg
Silhouette_Shader_02.jpg (84 KiB) Viewed 5576 times
sazberryftw
 
Posts: 27
Joined: Wed Aug 23, 2017 1:38 pm

Re: Silhouette Shader

Postby Ricardo Teixeira » Tue Feb 13, 2018 4:36 pm

sazberryftw wrote:Hi Ricardo

Thanks for getting back to me. In regards to the issue with the current Outline effect - I'm not entirely sure what to send you. All I'm using is the tick box for "Outline", and this issue occurs on anything that doesn't have soft normals (such as a standard Unity cube).

However, I am looking for information on whether there are nodes that will let me create a silhouette effect instead of the way the Outline effect currently works. I want the outline to only be around the outer edges based on the position of the camera.

The desired effect below is not done with an Amplify shader.


Thank you for the additional information, I just wanted to confirm that we could replicate the issue on our side.

Changing the Outline mode to "Vertex Scale" should resolve the issue. Alternatively, I recommend looking into the Custom Outline setups, they are quite flexible.

Image

Looking forward to your feedback!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Silhouette Shader

Postby sazberryftw » Tue Feb 13, 2018 5:23 pm

Ricardo Teixeira wrote:Thank you for the additional information, I just wanted to confirm that we could replicate the issue on our side.


You can recreate the issue by using the example outline shader that comes with Amplify, and apply it to any object with hard edges, such as a cube. I assume this happens just because of the way vertex offset is calculated?

Ricardo Teixeira wrote:Changing the Outline mode to "Vertex Scale" should resolve the issue. Alternatively, I recommend looking into the Custom Outline setups, they are quite flexible.

Image

Looking forward to your feedback!


Using "Vertex Scale" seems to still outline inner edges (see screenshot). It also seems to scale from the pivot of the mesh rather than the center, is this how it's meant to work? Am I able to change it to scale from the center of the mesh? I have attached a Unity package with the asset from the screenshot.

I am using version 1.4.2 of ASE incase that is an issue.
Attachments
Outline_Inside.jpg
Outline_Inside.jpg (73.51 KiB) Viewed 5566 times
OutlineShader_Issues.unitypackage
(137.53 KiB) Downloaded 124 times
sazberryftw
 
Posts: 27
Joined: Wed Aug 23, 2017 1:38 pm

Re: Silhouette Shader

Postby Ricardo Teixeira » Tue Feb 13, 2018 7:22 pm

Yes, I tested it with the default Cube.

Unfortunately, although you can tweak the way the outline is drawn, I don't think that you can quickly fully exclude overlaying outline effects.

I will have to get back to you tomorrow as soon as the ASE developer gets back to me. (national holiday here)

Thank you for bringing up the issue, hopefully there's something we can do to help.

Apologies for the inconvenience!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Silhouette Shader

Postby sazberryftw » Wed Feb 14, 2018 9:18 am

Okay thanks for the info. :) Look forward to hearing more.
sazberryftw
 
Posts: 27
Joined: Wed Aug 23, 2017 1:38 pm

Re: Silhouette Shader

Postby Ricardo Teixeira » Wed Feb 14, 2018 2:01 pm

sazberryftw wrote:Okay thanks for the info. :) Look forward to hearing more.


In order to mitigate the outline issues, so to speak, we recommend using a custom outline similar to the screenshot; Transparent, ZTest=Always, and ZWrite=On. In any case, this solution will not work for every type of model.

In order to add a flawless outline you will need to implement a custom screen space solution. It involves a few additional scripts but it's quite flexible.

Unity Shaderlab Outline - Screen Space

I hope the information above helps, be sure to let us know if you have any additional questions.
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Silhouette Shader

Postby sazberryftw » Wed Feb 14, 2018 3:23 pm

Ricardo Teixeira wrote:In order to mitigate the outline issues, so to speak, we recommend using a custom outline similar to the screenshot; Transparent, ZTest=Always, and ZWrite=On. In any case, this solution will not work for every type of model.


Thanks, I implemented this and I can see what you mean.

Ricardo Teixeira wrote:In order to add a flawless outline you will need to implement a custom screen space solution. It involves a few additional scripts but it's quite flexible.

Unity Shaderlab Outline - Screen Space

I hope the information above helps, be sure to let us know if you have any additional questions.


Thanks for the information. I have a Valve Silhouette shader (package attached below) that appears to create a silouhette without the use of a screen space post effect. However, it masks out everything but the outline. Is it possible to use their method combined with the standard shader within Amplify? :)

I just stumbled across this whilst googling: viewtopic.php?f=8&t=425
Is the multi-pass effect mentioned what I'm trying to achieve?
Attachments
SilhouetteShader.unitypackage
(99.63 KiB) Downloaded 207 times
sazberryftw
 
Posts: 27
Joined: Wed Aug 23, 2017 1:38 pm

Re: Silhouette Shader

Postby Ricardo Teixeira » Wed Feb 14, 2018 5:00 pm

sazberryftw wrote:I just stumbled across this whilst googling: viewtopic.php?f=8&t=425
Is the multi-pass effect mentioned what I'm trying to achieve?


I believe that was before we included support for Outline effects as we do at the moment.

Regarding the Valve example, it's great reference but unfortunately it requires multi-pass support. We're actually working on multi-pass support as we speak, it should be available in a couple of weeks.

I would definitely recommend looking into the screen-space solution as it provides the best results, regardless of the geometry used.

Apologies for any inconvenience caused, we'll keep your email on record and notify you as soon as multi-pass support is available.
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Next

Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 0 guests

cron