- Home /
Extrude 2D Mesh Vertices In Surface Shader
In a surface shader, how do I calculate the external angle of a vertex and extrude it along that direction? What I want is to created a border around a 2D mesh. The Z value of every vertex is 0 so I can't seem to just expand outward as you normally would when creating a border mesh, since it's flat like a quad.
Here's what I want. The black is my mesh, the green lines mark the mesh triangles, the red is how I want it to expand and the blue shows what my "border" would look like. The border should expand whether the angle is right, acute, or obtuse.
Also, I can't simply expand the whole polygon linearly, or else you get a broken effect like this.
Thank you!
Answer by JasonSpine · May 12, 2019 at 04:25 PM
It's quite and old thread, but I'll answer for others that may be looking for a solution...
Instead of a shader I made a procedural outline mesh generator with vertices calculations based on this algorithm: http://alienryderflex.com/polygon_inset/
Your answer
Follow this Question
Related Questions
Identify if two vertices are connected 0 Answers
Mesh breaks apart when using vertex displacement with shadergraph. 3 Answers
Color triangle on mesh 3 Answers
Vertex snapping of any mesh at runtime 2 Answers
Finding lowest point of a mesh 0 Answers