The Best Way to Render Wireframe in Maya

A quick google for render wireframe in Maya will get you some sound results. Unfortunately, I tried them and they didn’t consistently produce the results I needed. So here is the most consistent, and thus in my opinion best way to do wireframe in Maya.

Method 1: “The Best Way” – Mental Ray Contours

Why is it the best?

It does not tessellate your objects. It can be applied to multiple objects without having to do new UV Snapshots. It can render in smooth shaded. It is quick and easy. And it uses the power of mental ray, and can look sweet if you do it right.

Process

  1. Assuming you have something to render, create a new material (can be anything that has a shader group – lambert, blinn, phong, etc.). In this example, I will be creating a lambert.
  2. Call the new material WireFrameMTRL and the shading group WireFrameSG. Who doesn’t like being a little organized ;) ?
    Note: If you clicked somewhere else and can’t get to the shading group easily, you can just go to the Hypershade and find the tab Shading Groups to find it.
  3. Go to the newly created lambert’s shading group WireFrameSG.
  4. Open the mental ray -> Contours tab.
    Note: If it isn’t there, you need to enable mental ray in your plug-ins Manager. Mental ray is called “Mayatomr.dll” so find it and load it.
  5. Click Enable Contour Rendering.
  6. Set the color to something you’d like. I like white.
  7. Set the width to something like 0.2 – 1.0. This setting is the absolute width of the wire frame lines. You can comeback and play with this later.
  8. Apply the material to the object.
  9. Open Render Settings
  10. Select render using Mental Ray (if it’s not there, go see the note for #4).
  11. Find the Contours Tab (it is under the features tab in 2009)
  12. Select Enable Contour Rendering
  13. Open the Draw By Property Difference Tab
  14. Select Around All Poly Faces
  15. Render!

And that is the easiest and most consistent way to get wireframe without the flaws of the other methods.

Here’s a shot of the result from one of my recent projects (with render settings fine tuned):

Rendering Wireframe with Mental Ray

The Worse Ways

For full disclosure, here are some other not so good ways to render wireframe.

Method 2: UV Snapshot

I don’t feel like doing the process for this one. It is somewhat of a pain to explain without pictures and frankly I don’t want to take them since it isn’t a method I’d advise. So here is a pretty decent video that does: http://www.youtube.com/watch?v=ZUFAtkVJdpg&NR=1

Method 3: Maya Vector

Rendering in Maya Vector is fairly painless to test. Unfortunately, Maya needs to tessellate all quads whose vertices do not fall on the same plane.  There is a way to find these planes if you have a few but in my case, almost all my quads are non-planar so there was no point trying to fix them.  So here we go on the process:

Process

  1. Assuming you have objects to render, open up your render settings dialog.
  2. Render using Maya Vector.
  3. Go to the Maya Vector settings.
  4. You can select Fill objects if you’d like. It will fill the object with a color you can select through the settings or leave it fill-less. For the example below, I unchecked fill objects.
  5. Un-check show back faces.
  6. Select Include Edges in the Edge Options Tab
  7. Choose an edge weight. I chose 0.5 for the example below.
  8. Choose Entire Mesh for Edge Style.
    Note: Outlines gives you a pretty cool effect. So try that too :)
  9. Render!
Wireframe render using Maya Vector. Oh boy look at the tessellation.

Method 4: Hardware Buffer

Hardware buffer is another painless way to render out in wire frame. Unfortunately, it doesn’t look nearly as cool as the previous two images. Anyways, here’s the process:

Process

  1. Open up the Hardware Rendering Buffer from Window > Rendering Editors.
  2. In the Hardware Rendering Buffer, open Render > Attributes.
  3. In the Attribute Editor, change the Rendering Mode > Draw Style to Wireframe.
  4. Render!

This one looked terrible so I didn’t capture an image of it. I couldn’t figure out how to do back-face culling so this quickly became the worst of the techniques.

Method 5: Toon Shader

The second best method to render wireframes in maya is to use the toon shader. I personally like the mental ray method better for the control and power of mental ray but this one seems just as good for simplicity’s sake.

http://www.artbycrunk.com/blog/2008/09/rendering-wireframe-using-toonshader/

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

No related posts.

About Ayan

Ayan Ray is a creative technologist living in the San Francisco Bay Area. He specializes in creating applications for Flash, PHP, Android, iPhone, and HTML5/CSS. He holds an undergraduate degree from Carleton University in Information Technology with distinction and numerous awards. This blog is all about his observations in technology, entrepreneurship, and his daily life. In his free time, he enjoys reading, staying fit by swimming, playing soccer and volleyball, and spending time with his friends and family.
This entry was posted in 3D and tagged , . Bookmark the permalink.

57 Responses to The Best Way to Render Wireframe in Maya

  1. nice.. hmm.. the countour shader method is for a higher skill level.. when i made the toonshader tuts it was to focus on simplicity :) .. it also renders faster that the countours version… end of the day they both work :)

  2. Ayan says:

    I wouldn’t consider the contour shader method much more difficult. Maya makes it very easy to render and anyone should be able to follow simple directions (and if not, they shouldn’t be using Maya). I did have an issue with the toon shader when I tried it (changing slight settings in render style, if I remember correctly) and unfortunately I didn’t blog about it :( and now I’m too lazy to try again. Bottom line, like you said, they both work. Just note to others, you don’t need to try the other methods ;) . I originally tried that UV snapshot method and was disappointed … lost time and had to look for another method.

  3. casey miller says:

    Hi Ayan,

    Awesome tutorial! I tried the contour method but I am only seeing the texture border edges rendering, not the whole wireframe. Any suggestions?

    Casey

  4. casey miller says:

    Hi Ayan,

    I thought it was the texture border edges, but after removing the clothing to see what it did to the whole body, turns out it was just rendering the edges that weren’t obscured by any other geometry (ie. the shirt) so in actuality it rendered a white border all the way around my geometry. I don’t know it’s weird. I’m playing with it but if you have any ideas then I’d appreciate them. Thanks.

    Casey

  5. Ayan says:

    Hey Casey,

    Can you post up a link to an image of the problem? Did you double check all the settings? Did you apply the material to all objects you want to be viewed in wire frame?

    • casey miller says:

      Hi Ayan,

      Here is a screencap of my render settings, SG contour settings, and the actual render of the cartoony character. It just puts a white outline around the character even though I have it to outline all poly faces. Thanks for your help on this :D

      http://yfrog.com/jnwireexamplej

      Casey

      • Ayan says:

        Eyaah! From the looks of it, it should work. Try reseting your mental ray settings to default and follow the steps again. I can’t put my finger on what exactly is the problem. It could be a hardware issue on your end, or it could be another setting that offsets this one. Or it could be a duplicate mesh (lol yes unlikely)… You can also try importing the character into a new file and try the steps again. If all of that fails, send me the file and I’ll see what’s the problem.

        • casey miller says:

          Sweet! A former instructor/friend of mine figured out the problem. This won’t work if you have a subdivision approximation on your character, or if you are using the “3″ key on the keyboard to create a smooth proxy. I was doing both. Took off the approximation, hit “1″ on the keyboard and it worked! Solid! Hope this helps for anyone else having this issue, and thanks Ayan again for the tutorial and your help in this matter :)

          • Ayan says:

            Great to hear it’s fixed. And thanks for posting up the solution!

          • James says:

            Hey Casey,

            Thanks for posting this info, I was having exactly the same problem, and it was driving me nuts. Simply removed the Subdivion Approximation, and that worked. Even having ’3′ activated so that it would come out smooth, so, just to say thanks. :)

  6. mayanic says:

    hey,
    I’m just wondering how to achieve the same look within mental ray that you get with the vector renderer and “hidden edges” activated?! I’m mean that you can see the back-face-culling faces . . .

    plz help
    br matt

    • Ayan says:

      I was hoping the culling option controlled the contours but it didn’t work :( . For your case, it seems much easier to use the vector renderer. For mental ray, if you wanted to use it, I would recommend using render layers and selecting the faces and do it yourself. This obviously would be impossible to manage if you are animation though :( . A long shot would be a custom contour shader but I’m too newb for that >.<. Good luck with whatever you do! You could overlay your vector in premiere after as another option.

  7. ME says:

    Is it possible to render wireframe using the contour shader on a model with the model in subdivided (3 on the keyboard) or something similar, but only render the simple mesh (smoothed simple wireframe)

    I want to be able to render a wireframe that demonstrates my topology but as the model was created to be subdivided, it looks terrible in unsmoothed mode.

    M

    • Ayan says:

      Maya 2009+ render the smooth mesh preview in mental ray. If you have an older version than that, you will need to smooth it. What is preventing you from just smoothing it and rendering it as a fail-safe?

  8. Luca says:

    Hi Ayan, nice techniques, good job on the explanation. Simple. I bumped into your blog looking for techniques to render only vertex from a modeled mesh. Do you know by any chance a technique or know if its possible?

    Any idea would be very appreciated.

    Thanks

    • Steve says:

      A quick solution to rendering vectors using maya 2011

      “display menu” turn on heads up display “poly count”

      Select your object and make a mental note of exactly how many verts …. I dont like waste :)

      “Ndynamics menu” – “Nparticles” – “Create Nparticles tool (options)”

      In the tool setting set the number of particles to the amount of verts you memorised ;)

      Create the partcles in the scene and select them then shift select your object and go to “nParticles menu” – “goal”

      Hit play and let the particles settle on each vertice and stop the playback….go to the “nSolver” menu while the particles are selected then “initial state” – “set from current” (this simply states that the particles will stay where they are for the beginning of the animation) , rewind the time line to frame 0 and they wont move.

      Hide your original object and voila job done…now its entirely up to you to decide how you want to render the particles as clouds, single points etc.

      Cheers !

  9. robin d says:

    Hi,

    I’m trying to follow the mental ray contour wireframe method.. I believe I’ve followed the instructions to the t, however the contours are not rendering.

    I’m using a model I imported from Zbrush, simple exposure maya lenses on my camera, and final gather.

    • Ayan says:

      What version of Maya are you using? I haven’t used a lens before but I could take a look at it if you are sill having problems with it. What is rendering btw?

  10. Greedo says:

    Thanks for the very easy to setup contour tutorial. It was just what need to complete a retro-80 model. This was way faster then trying to setup a toonshader with contour.

  11. Pingback: Need help with wireframe render. - Scratch Made Cars - Car Blueprints Forum

  12. Tarry says:

    ME :Is it possible to render wireframe using the contour shader on a model with the model in subdivided (3 on the keyboard) or something similar, but only render the simple mesh (smoothed simple wireframe)
    I want to be able to render a wireframe that demonstrates my topology but as the model was created to be subdivided, it looks terrible in unsmoothed mode.
    M

    Is there a way to do this? I’m having the same issue. I need the wire frames to be smooth like the model but not so tesselated that it is just a solid color?

    • Victor says:

      Probably the best way to do that would be the UV method.
      Mainly because the texture actually follows the contour of the mesh and while the mesh is tessellated at render time, the texture will not.

  13. Yes there is. The Contours plug-in for Maya has a shader to do exactly what you’re looking for. Have a look at http://www.ticket01.com/products/contours/index.html for more info. You can also watch a video the easy process of hooking the shader up here http://www.youtube.com/watch?v=-tw6vU4DUf8.

  14. Yes, there is a solution. Please look at CGTalk http://forums.cgsociety.org/showthread.php?f=87&t=928268.

    Hopefully this time the author of this blog will approve the comment ;)

  15. Joeri says:

    Woot!
    Saved my day here, thanks 1000x

  16. The best way to render wireframe in maya.. Super :)

  17. Scott says:

    What render settings are you using to get such smooth wierframe lines? I increased the sample level a bit in my render globals but they still look really choppy and pixelated. Thanks.

    • Andrew Labret says:

      Try adjusting these attributes in your render settings this is the most common way to fix the issue you are encountering using wireframe (Method 1) on this page.

      These adjustment tabs can be found by locale Render Settings>Features>Contours> change “Over-Sample” to greater than 1 and/or “Filter Support” sections as well.

      I currently am using filter type box and a over-sample rate of 3 and a filter support of 1.6 this should connect your wireframe lines nicely if they are looking jagged.

      Cheers

  18. Roberta says:

    I am having the same problem rendering the wireframe with smooth mesh preview 3 on. While the method above works perfectly, it seems that it isn’t able to render a smooth wireframe. Is there any way to fix this?

    When I render with smooth mesh preview on, my wireframe appears extremely dense as if I really did smooth my object.

    • faux says:

      For rendering the contours around the low res edges on a smooth previewed mesh (as seen in the viewport) you’d need to turn on Between Different Materials in the Contour section of the render globals. Then assign different shaders per face on your mesh so that no two touching faces had the same shader (kind of of like colouring in countries on a map).
      If overlap in the 3D space occurs you’ll have to bump up the Normal Contrast to around 30.

      Sounds like a lot of work? …script :)


      //Face assigning materials for smooth preview type
      //mentalRay contour renders. v0.2
      string $colourface[];
      int $facecount[];
      $geom = `ls -sl`;

      string $deMaterials[] = {“csm1SG”,”csm2SG”,”csm3SG”,”csm4SG”,”csm5SG”,”csm6SG”};

      if (`objExists csm1`)
      {print “Onward”;}
      else
      {
      for ($k = 1; $k $i; $i++)
      {
      select -r ($geom[0] + “.f[" + $i + "]“);
      $oface = `ls -sl`;
      PolySelectConvert 2;
      PolySelectConvert 1;
      select -d $oface[0];
      $lface = `ls -sl -fl`;

      for ($j = 0; $j < size ($lface); $j++)
      {
      $colourface[$j] = `getFacetSG $lface[$j]`;

      }

      string $diff[] = stringArrayRemove($colourface, $deMaterials);

      select -r $oface[0];

      sets -e -forceElement $diff[0];
      }

      select -r $geom[0];

      print ($geom[0] + " smooth wireframed for mentalRay");

      //Cheers to xyz.net for this proc//
      proc string getFacetSG( string $facet )
      // Input (string) – facet component to query (e.g. "pSphere1.f[0]")
      // Result (string) – Shading Group shading facet (e.g. "lambert2SG")
      {
      string $facetSG = "";

      // Get array of all Shading Groups
      string $shadingGroups[] = `ls -type shadingEngine`;

      for ( $shadingGroup in $shadingGroups )
      {
      // If this facet is a member of the shading set for this
      // Shading Group, tag this as the facet's shader
      if ( `sets -isMember $shadingGroup $facet` )
      {
      $facetSG = $shadingGroup;
      break;
      }
      }

      return $facetSG;
      }

  19. Carter says:

    Ok I officially love you for putting this up.
    Thanx, I really did not want to do a toon shader since Vector decided renderings was not gonna happen today. Short ans sweet tutorials are the best. <3

  20. Cassi Clagg says:

    Hello may I quote some of the insight from this post if I provide a relation back to your site?

    • Ayan says:

      Possibly. Send me the article/post that you want to publish so I can see. I’d much rather prefer a link back (and it’s easier). If you want to update the content, that’s another story.

  21. Jon Block says:

    Hi, do you know how to plug in any of the custom contour shaders? For example, the contour_shader_widthfromlight? I can get basic contours to work fine, but can’t get any of the contour shaders to even show up.
    thanks

  22. Ali Haider says:

    No mention of Polydata? – Wireframes where the wire itself has perspective, color, can cast shadows, and a bunch more attributes like color change along the wire, control of thickness, etc.

    http://products.provide3d.com/polyData/

    examples:
    http://www.skillboard.com/trash/ao_skyTest_01wire2.jpg
    http://products.provide3d.com/polyData/gallery/pop_image.html
    can also render Nurbs http://products.provide3d.com/nurbsData/pop_image.html

    Anyways – thought it was worth a mention for a professional grade wireframe.

  23. Thiago says:

    Hello! Thanks for your explanation! Your “Method 1″ worked here. Before, I had to do it with printscreen :(

    My blog: thiagopaiola.blogspot.com

  24. Bharti says:

    Thanks a lot………….

  25. Phú Thịnh says:

    Thank u very much, man! Finally i done it

  26. Pingback: Design Patterns: GoF Masterpiece | Ayan Ray's Blog

  27. news says:

    Im getting a javascript error, is anyone else?

  28. Pingback: Wireframe Maker Script Release | Kate McFadden's Portfolio

  29. Pingback: Wireframe Maker Script Release | Kate McFadden's Portfolio

  30. Arturo says:

    Thanks man! this was really useful, I rendered the lambert black with no lights linked to it to make it “invisible”, thanks a lot!

  31. Pingback: Contours and Renders - Ninja Beaver Studios

  32. Paul says:

    Hi,

    Thanks for the tutorial, Was really clear! Pretty sure I’m following correctly but I’m getting an issue with a couple of my models, basically… A couple of my models have turn out looking great with a ‘wiremesh’ but a couple just have an outline! Just curious if you know what might be causing this! All my models in the scene have the same shader!

    Cheers,
    Paul

  33. Paul says:

    Hey Ayan,

    In relation to my previous post.. all the models I’m talking about are in the same scene! Most pieces of geometry work fine but a couple only renders an outline! Just making sure I was clear enough! Any help is much appreciated!

    Thank you,
    Paul

  34. josh says:

    anyway you could post your settings for the lighting or all of them? I did the exact settings you listed and am getting ugly looking wireframes…i followed the tutorial to the t, but no luck. I’d greatly appreciate if you could email me or post something up here.

    thanks,

    josh

  35. Hello Amigos,

    I have made a python script that lets you render wireframe that to with AO just one click (the link is under my name) follows the same steps as explained above in this tutorial.. except AO added if you press CTRL

  36. MR. C says:

    You can use the vector renderer to make a smooth preview wireframe render:

    Select all the edges in your model. Create a quick selection set.
    Add a Mesh, Smooth node to create a hi-res subdivision.
    Make sure all the normals of the smoothed object are soft.
    Now select the quick selection set. It will select all the original edges. Make all these edges hard. This is what the vector renderer will use for outlines.
    Now render with the vector renderer turning on edges.

    Voila. Thanks to one of the Autodesk Maya blogs for having a short tut about it a while back. Works great. In 2012-2013 the vector renderer even lines up with mental ray :)

  37. Pingback: [Maya] The Best Way to Render Wireframe in Maya | 3D Gumshoe

  38. Britney says:

    Maya Vector is triangulating my wireframe. Is there a way to fix that?

  39. beril says:

    thank you!

  40. Brigitta says:

    Hi, I have been using this method that you stated here for a while but recently it has been causing problems. Basically what will happen is that the wires will render and all but they render subdivisions so my meshes which are low poly are now really high poly and obviously this is not what I want. I have never had this problem before and all my smooth mesh settings have not been edited and are at the default setting. Does anyone know how to fix this so that it only shows hows the amount of polys that are actually present on the models?

    • faux says:

      ^^ Thats the downfall of this method.

      Either use my script above or normalise the UVs per poly face, plug a ramp texture into your shader and set it to box ramp. Then adjust the ramp color and position handles to fit the look your after :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>