In this series of tutorials, we'll be taking a detailed look at each of mental ray's contour nodes. Each video is a self-contained tutorial centering on one of mental ray's nodes. This means that these tutorials can be viewed in any order you wish, allowing you to jump straight to the content that is most relevant to you. Over the course of these tutorials, we'll learn how each node works and best practices to utilize for attaining desired results while saving time. Software required: Maya 2008 and up.
Kyle was one of the first authors for Digital-Tutors (now a Pluralsight company) and has been a part of the team for over 10 years. Kyle began his career in computer graphics education as a college instructor and worked as a Digital-Tutors rendering tutor and curriculum manager since 2002.
Introduction and Project Overview [Autogenerated] in this lesson will take a look at the contrast function levels contour Shater. So if you'll open up the star file for this lesson and just quickly hit render, you'll see that we have just a very simple object in this scene. And on this object, I've got just a very simple ramp shader that's been applied to this to give it a little bit more of a hand drawn, sort of associated look. So let's see what we can do about using the contours to now add some kind of an outline to this and start to give us a little bit more of a hand drawn appearance. So let's go over to the metal ray nodes and you'll take Take a look inside the contrast door and the Contour contrast, and in this particular lesson, we're just gonna focus on the contrast function levels. Now, if you've already had a chance to go through the lesson on the simple shade er's, you'll see that these are really connected in pretty much the same way. All we have to do is take a look inside the render sittings. If you're using my 2009 or higher, you can take a look inside the features tab and we could scroll all the way down in the bottom two contours. Let's enable contour rendering and all the way down at the bottom to the customs shed. Er's Let's plug in our function levels Contour shader, And then we'll make sure that we use the corresponding store function as well. So for the contrast Shader, let's start with this. So we use the contrast function levels, not it's simple counterpart and for the store, Shader will use the contrast store function there. We are now in this situation, if you take a look inside the contrast function levels. This particular note, unlike its simple counterpart, actually does have several attributes that are responsible for its final appearance. Now, at this point, if we were to simply hit render, we would still not see any sort of contour lines on our object. The reason is that we actually first need to go to each material and take a look inside It's Sheeting group and if we go into the mental ray area, we can enable contour rendering. So we need to make sure we do this for all of our Schrader's so select this. Go to the shading group, enable Contour, and then we can change the line color. And in my case, I want the line color to be black. So now let's just say what we have and see what this gets us, and you'll see that once the render completes that we now have central Contour lines. Although what we start to get is really not quite what we would want if we were trying to go for a little bit more of a hand drawn look. So let's go back and we'll take a look inside the attributes and we can always focus back on our contrast node. For the moment, the reason that we start to get this very triangulated type of appearance is because of this particular checkbox, the difference index. So if we were to turn this off, this will now stop trying to triangulate this at render time and trying to actually outlined those triangles. And instead, now, when we hit render, we start to get something that's a little bit more consistent with an outline. So we do have a few options right now. This is set to a difference label, which means this will try to draw an outline or a contour outline around every single object in the scene based on its object name. We can also tell this to simply drawn outline around any kind of different materials sulfur. To render this, we really shouldn't see much of a difference it all again because the actual labels and the material names are pretty much the same. Every object has just one material. Now we can also start to include contrast lines so anyplace where there's a sufficient amount of contrast, areas like these differences in shading and even areas around the shadows should now start to receive a silhouette or rather, a contour line. And once we render, you can see that's exactly what we have. Any place that has, ah, high enough amount of contrast. We now start to get those types of effects, so really, we can start to get some pretty interesting types of fix that we can start to pull off here. So if we were to start thio in Greece or rather decrease this in Delta, this is referring to the normal angle that's responsible or that has to be met in order for some kind of a contour line to appear. So right now, this is set to roughly a 90 degree angle, and this will become a little bit more apparent if I turn off the contrast and you can see that only these areas of this particular mess that are oriented at least 90 degrees away from the camera start to receive some kind of an outline around them. So if we wanted to start to bring some lines into some of these inner areas of the mesh, we could just start to lower this normal delta. So if we were to bring this down to about 10 degrees now, the requirements that need to be met in order to make some kind of a contour lines should be much less. And you can see now that this, uh, area that is anything less than 10 degrees, we're headed away from the camera. We now start to get some kind of a contour line that starts to appear here. If we want, we can even start to lower this a little bit more again if we want to increase the sensitivity to the contrast lines. And there we go. Now we can start to get much more detailed outline of this particular piece of geometry again, because now the requirements for some kind of a contour line to appear based on the normal direction is now much, much less. And we can always come in and begin to combine these. So now, if you wanted to add the contrast back on here, we can begin to reintroduce that as well. Now, just like what the's situation we had with E simple Contour lines, it really is not necessary to connect these as the custom shade er's. You'll notice that if we connect these, just like with the simple shakers that these options to draw around property differences and draw by simple contrast have been disabled. So if we wanted to instead shade our contours based on these particular options rather than the contrast later, we do have that option. And truthfully, we really shouldn't see much difference at all if we decide to used these options versus these contrast traitors. So here we can choose to enable a outline around different materials, and if we want to enable some kind of a normal contrast, we should be able to do that as well. So anywhere where there's a high enough change in the color and high enough change in the normal, let's say about three degrees, you can see that we can start to get these contours outlines without having to use our contrast shader or store nodes at all. And if we wanted to start to get our contrast outlines back, we can enable the color contrast and you start to increase this to some sort of a value which will start to alter its sensitivity to changes in contrast, so when you start to give this a fairly low value to begin with, and now we can start to retrieve the effect of our contrast lines. Now you will notice that right now the lines do appear somewhat jagged in the render. So if we want to improve the quality of these, one of things we can do here, the render settings is to increase the over sample value. It's over to bump this up to a value of to save this for comparison and rear ender, you can see how the lines become much, much smoother if you compare what we had before to what we have now. So that's a look at how we can use these optional nodes for the contrast function levels contour, Shater