Page 1 of 1

Isolating Edges Of A Mesh

PostPosted: Mon Dec 18, 2017 3:09 pm
by finepointcgi
Hello!

First I want to say thanks for making such a great program. Its really elevated my work and my understanding of shades in Unity. Im running into a problem with isolating the edges of a mesh to apply detail like damage. I don't even know where to begin, most of the nodes I don't know what they do so im sure im just missing something. Could a shader be made that Test adjacent polygons to find corner of the geometry. Any help would be appreciated.

Kind of like this https://docs.unity3d.com/540/Documentat ... ffect.html but I want to apply a normal map instead of drawing a line.

Thanks,

Mitch

Re: Isolating Edges Of A Mesh

PostPosted: Mon Dec 18, 2017 4:59 pm
by Amplify_Borba
finepointcgi wrote:Hello!

First I want to say thanks for making such a great program. Its really elevated my work and my understanding of shades in Unity. Im running into a problem with isolating the edges of a mesh to apply detail like damage. I don't even know where to begin, most of the nodes I don't know what they do so im sure im just missing something. Could a shader be made that Test adjacent polygons to find corner of the geometry. Any help would be appreciated.

Kind of like this https://docs.unity3d.com/540/Documentat ... ffect.html but I want to apply a normal map instead of drawing a line.

Thanks,

Mitch


Hello finepointcgi, thank you for your support and kind words!

Regarding your question, detecting edges using only a shader can be a bit tricky, usually you would aid the process by providing some additional information to work with.

We recommend vertex painting your edges in order to mask the intended textures as a rather simple way of achieving the effect you desire, be sure to check out this cool free vertex painter.

You would then use a node setup similar to the following one to lerp between a damaged and non-damaged texture by using the previously painted Vertex Color channel as the alpha.

image (10).jpeg
image (10).jpeg (233.62 KiB) Viewed 2156 times


Another interesting solution for damage detail would be to use a decal system, such as this one.

Please let us know if you have any further questions, thanks!