Search Unity

Question Making a CAD-like wireframe shader ?

Discussion in 'Shaders' started by Aioshiro, Mar 15, 2023.

  1. Aioshiro

    Aioshiro

    Joined:
    Jul 10, 2020
    Posts:
    1
    Hi,
    I'm currently making an application where I use CAD-generated objects and I would like to make a shader to have objects render as "simplified" wireframe. By that, I mainly mean displaying the main edges of the objects, and not display any triangles. I attached an example from Solidworks so you see what I mean.

    I didn't find anything really relevant online, and I must admit having some doubt if that's possible, as CAD is using things like B-splines where Unity works with tesselation. But I take any idea you may have, thanks a lot !

    PS : I'm on Unity 2022.2.3f1 with URP if that may help.
     

    Attached Files:

  2. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,546
    Like you mention, CAD software is using curves and generating geometry from those curves. So they have the advantage of only having to just render the curve data as lines.

    In a game engine, your geometry is simply made of triangles, there are no "main edges".

    You could at least create a URP version of this perhaps to only render the quads of the mesh: