Visualize UV seams on mesh in game view

Hi

I want to be able to visualise the uv seams of a model, like it is possible in some 3D modeling software. Purpose is to “showcase” the work of an artist: I would like to visualize it on the mesh.

As I’m not sure how to proceed, does anyone have a shader that does that ? :stuck_out_tongue: Or could you point me a solution to achieve that effect ?

thanks a lot

This is not something a shader can do. Shaders don’t know that much about a mesh outside of a single triangle, vertex, or pixel at a time. To know if there’s a UV seam you’d need to know about other triangles in a mesh, which shaders explicitly never do.

You’d need to find the seams in a script and draw them on the mesh using some kind of line geometry (like using GL.LINES). Or you can render the UVs to a texture, and fill the background with a solid color and blur / expand the background so it slightly covers the interior. Those last two you can do in Unity by creating a render texture, clearing it to white, rendering your mesh using a custom shader that uses the UVs instead of the vertex position for the screen position, colored black, and then a custom shader that samples that render texture from multiple slightly offset positions around the UV and uses the brightest value.