I would like to create a script that attached to any 3d game object creates an outline (silhouette effect) around it when certain bool in the script is set to true. This would be used to create a highlight objects when selected with mouse.
I found many shaders on the internet (which seem to work, but the outline produced by them is kind of inconsistent), but it doesn't help, because my 3d objects are already textured, have submeshes and some of them have complicated materials (all of them use Unity Standard Shader but some of them have a lot of options) and changing shader in one of the materials creates a mess. The same applies to just adding another material to material array of an object.
Should I copy Unity Standard Shader and modify it to draw outline and swap it in material at runtime if I want to save all of the material's settings? Is there a simpler way? No, I don't own Unity Pro.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
4 People are following this question.
Is there a shader to only add an outline?
Making a silhouette outline shader
Model Outline/Silhouette Shader
Shader Edit Help: 2D Outline Coloring
Terrain material makes textures blurry