Jump to content

Wireframe and UV Distortion with mantra

Recommended Posts


i am trying to render a wireframe of the topology straight from mantra. Feely a bit stupid, but it seems way more complicated then i thought. I read about wren or creating a "wireframe-geo", but in my case, i need it from mantra as an additional image plane (via bind export).
Trying to create a mantra beauty render of an asset as kind of Model QC, so besides the wireframe it would be great to also include the uv distortion (as in maya) in my render, to see if the uvs are strechted or compressed.

most important is the wireframe, would be great, if somebody could point me in the right direction.


Share this post

Link to post
Share on other sites

perfect, looks good as a start, thank. only proplem of this approach is the inconsistent thickness of the lines. but should work for now!

Share this post

Link to post
Share on other sites

For a wireframe shader with consistent line widths, first create a primitive attribute that contains all point positions. Then inside a shader choose point pairs for ptlined() to determine the shortest distance to your shading position to check against a custom wire width.


// primitive attribute with point positions
int pts_prim[] = primpoints(0, @primnum);

v[]@pos = {};
foreach(int pt; pts_prim){
    vector p = point(0, 'P', pt);
    append(@pos, p);
// shader snippet feeding point positions into ptlined()
// determining shortest distance to check against wire width.
int num = len(pos);

float dist = 1e6;
for(int i = 0; i < num; i++){
    vector pos_0 = pos[i];
    vector pos_1 = pos[(i + 1) % num];
    float dist_curr = ptlined(pos_0, pos_1, P);
    if(dist_curr < dist){
        dist = dist_curr;

stroke = dist <= stroke;



  • Like 3

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now