- Home /
Outline flat mesh
Hello all.
I am attempting to outline a flat code generated mesh to create a spell indicator.
currently every example i can find is using a shader to invert the edge normals of a mesh at a certain threshold... however seeing as all my normals are simply vertical how would i achieve an outline?
I have tried all the shaders on here: http://wiki.unity3d.com/index.php/Silhouette-Outlined_Diffuse as well as other multiple shaders and it only turns the underside of my mesh blue (which makes sense as its the inverted normal)
Any help would be greatly appreciated.
Answer by Namey5 · Jun 16, 2019 at 12:17 PM
It's actually much simpler in this case; we can follow the same logic of those shaders, but instead of expanding based on normals, we can just expand the mesh itself. Rather than using a shader, seeing as your mesh is code generated anyway, you could make a second version of the mesh that is slightly larger and below the object with your outline colour. In theory this would be done by pushing vertices away from their neighbours, but your implementation might already have a size factor to begin with.
Your answer
Follow this Question
Related Questions
Dymanic Mesh Hiding 2 Answers
Nicely fade transparency with standard shader? 2 Answers
Geometry shader output to mesh in Unity 4 0 Answers
Hiding parts of mesh but only on defined objects 0 Answers
Do TEXCOORDS need to be in sequence? 1 Answer