Saturday, August 22, 2015

Wireframe Contour Rendering with Maya 2016 and mental ray

Rendering a contour image in mental ray for Maya has been a nice way to show wireframes on an object. In Maya 2016 the usual method has become somewhat hidden, so I thought I would post a brief update on how to do that.

1) Create a black surface shader and apply it to your geometry
2) In the hypershade, access the shading group (e.g. surfaceShader1SG) and open the mental ray tab in the Attribute Editor (or Hypershade property editor!)
3) Under Contours, check Enable Contour Rendering and adjust the other options as you like
4) In the render settings, make sure mental ray is selected, and go to the Configuration tab
5) Check "Show Advanced Settings" and find the Contours section at the bottom
6) Check "Enable Contour Rendering" and increase the Over-Sample to something like 3
7) Under the "Draw By Property Difference" section, check "Around all poly faces"

Not quite done... you might see a Warning: Contour Rendering is not supported with Unified sampling

8) Go to the Quality tab and check "Show Advanced Settings"
9) Expand the Legacy Options section at the bottom and choose Sampling Mode: Legacy Sampling Mode

Hit render! *phew*



Note that if you are rendering beauty passes or other things, you probably want to use the original Unified Sampling and just create layer overrides for the contour settings. Also make sure that you have unchecked both "Around all poly faces" and "Enable Contour Rendering" for these non-contour passes/layers/renders, because I have had the filter settings be set to Box (1, 1) in the background without my knowledge due to "incompatibility with contour rendering". Just something to be cautious about; not sure if they may have fixed that in this version.

Thanks for reading,
Stuart

15 comments:

  1. Thank you so much! It helps me a lot! Cheers :)

    ReplyDelete
  2. I follow these steps, and if I have a cube with 4 faces on each side, it renders out showing way more faces near 40 on each side. Keep in mind, I have clicked "3" to smooth it. If I click "1" for un-smooth it works fine.

    ReplyDelete
    Replies
    1. Mental ray automatically renders the smooth mesh faces, unless you tell it not to.

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Thank you! This was very very helpful!

    ReplyDelete
  5. You are a god! Thank you soooooo much! Very very helpful!

    ReplyDelete
  6. Under the Quality tab > Sampling, You can change the mode to Custom Sampling and then increase the min and max values to help make the outlines less jagged.

    ReplyDelete
  7. but what if your doing a batch render it only renders the 1st frame as wireframe

    ReplyDelete
  8. This comment has been removed by a blog administrator.

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. What if the attribute editor doesn't have a mentalray option in hypershade, nor a contour option in the mentalray dropdown in the normal window attribute editor?

    ReplyDelete
    Replies
    1. iam also facing the same problem. iam using 2017. iam not able to see the contours in "surface shader" attribute editor in the mental ray tab.

      Delete