- Home /
How to highlight the borders of an object
Hi, I'm making a game where I need to move some "simple" 3D objects, like the included cubes and some hand-code-made figures like a tethrahedron, pyramid, and something like that (no curve surfaces). I wanted to highlight the selected one in a similar way unity editor does, highlighting the borders with a straight line of aabout one pixel of a different color. Any suggestions? Thank you!
Answer by CodeElemental · Apr 07, 2014 at 08:56 AM
You could try the free Outline Diffuse Shader. http://wiki.unity3d.com/index.php/Silhouette-Outlined_Diffuse
Just Create a material that will be rendered with this shader, and add it to the highlightable object.
I'm trying using that shader but for some reason it doesn't work. It just turns my objects in black and white.
EDIT: maybe I pasted it wrong, now it seems to work, thank you!
The shader in the link gives syntax error on 125 and 137. I couldn't resolve it.
"The shader in the link gives syntax error on 125 and 137." you should copy the second code, after the image