Jump to content

Wireframe and UV Distortion with mantra


Recommended Posts

Hello,

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.

Cheers,
Daniel
 

Link to comment
Share on other sites

  • 1 year later...

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.

image.thumb.png.a95b68aedf855173a577c7a148dbcf09.png

// 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;

 

wireframe.hipnc

  • Like 5
Link to comment
Share on other sites

  • 3 months later...

Hi Helmut,

do you mean artistic wireframe edges or the outer rim of the entire mesh?

Either way, if you are talking about turning the wireframe into something more complex you could always color ramp the distance values and/or distort them with some noise:

wireframe_cartoon.thumb.jpg.07dfbb819a8fb04af2c38e0e4215b6c7.jpg

wireframe_art.hipnc

 

In case you meant the entire mesh, you can color ramp a lambert shader like this:

 

Also, a more painterly look can be achieved by using images to control gradient thresholds:

cartoon_shader.thumb.jpg.d01964153ba2c98e347dcfc47a87503f.jpg

https://www.sidefx.com/forum/topic/68331/

 

Link to comment
Share on other sites

  • 3 weeks later...

Hallo Konstantin,

thank you for the files and the link. I will have a closer look.

I was thinking about something like Cinema4D sketch and toon shader. because I'm current on my final animation project and would like to have the look of a painting like Pissarro or Sisley etc. but brush strokes rendering seems more complicated than I naively thought and in deep shader creation and writing was not part of the school - so every tips and tricks are highly appreciated. 

Edited by primzahl
typos
Link to comment
Share on other sites

Hi Helmut,

I got fairly good results by distorting colorful circles on top of images/renderings like so: https://forums.odforce.net/topic/44391-na/?tab=comments#comment-208974

To get closer to certain artists' way of painting though you would need to breakdown their visual style first. There won't be the one uber-cartoon shader that covers it all.

Hirai Toyokazu also used to present his cartoon shading workflows on CMIVFX. Maybe you can get hold of this:
https://web.archive.org/web/20180827020108/https://cmivfx.com/houdini-cartoon-effect

Link to comment
Share on other sites

thank you both for your input and links, I will have a look at it and if I have further questions, Iwill post in an own thread, . But I guess, I have to change the look to something much simpler, since I have to be done by the end of May.

Unfortunately, CMIVFX seems down and there seems no way to get the content.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...