Adverti horiz upsell
Subsurface Scattering: Using the Misss_Fast_Simple_Maya shader
Subsurface Scattering: Using the Misss_Fast_Simple_Maya shader
Jozvex, updated 2005-12-13 13:14:09 UTC 296,267 views  Rating:
(10 ratings)
Page 2 of 4

The SSS shaders -

Once you're inside Maya, change the renderer over to Mental Ray if you don't have it set to that by default. (If Mental Ray isn't an available renderer to select, perhaps your 'Mayatomr.mll' plugin isn't loaded). Open up the Hypershade. Over on the left, the 'Create Bar' by default is set to 'Create Maya Nodes'. Change it over to 'Create Mental Ray Nodes' and (fingers crossed) you should see the Misss shaders now under the Materials section:

click for larger version


You'll probably notice that there are actually seven shaders! Each of them have specific uses, but three of them you'll use the most because they are Mental Ray 'phenomenon', while the others are not. Mental Ray phenomenon are a full shader network that has been compacted into one shader node for convenience. The three phenomenon shaders are:

  1. Misss_fast_simple_maya - This is the shader we will be learning how to use in this tutorial. The point of this shader is to be fast to render, artifact free during animation and to produce an SSS effect that is pleasing to the eye. The effect it produces is not based on any true physics simulation.
  2. Misss_fast_skin_maya - This shader uses the same basic ideas from the Miss_fast_simple_maya shader, only it is more complex and has been specifically tailored for creating organic looking skin.
  3. Misss_physical - This shader uses photon mapping to realistically calculate SSS. It is quite a lot more complex than the other two shaders and takes much longer to setup, tune and render.
The other Misss shaders are components of the three phenomenon, that people can use if they wish to construct their own custom phenomenon or shader networks.

Finally actually using SSS -

Ok! Time to actually use the Misss_fast_simple_maya shader. I have created a scene file for you to use if you'd like (it'll help you to get the same results as me), or you can just create your own simple scene with an object and one light. My starting scene looks like this:



(Download Maya 6 scene) (Download Maya 6.5 scene)


Nothing fancy, just a fairly simple box modelled object (spheres are SO five minutes ago), a spotlight casting raytraced shadows and a floor/backdrop object. The test object named Geo_Object still has the default lambert material applied to it. So, first things first, let's apply the SSS shader!:

  1. Select the test object, right click on it in the viewport and go to Materials > Assign New Material > Misss_fast_simple_maya.
The shader is applied! Wow, tutorial over! Ehem, well, not quite. Let's look at a render of what we get now:




Hmm, it's um, delightful! But as 'delightful' as it is, there's actually no SSS yet. Currently we only really have a tan coloured lambert with a bit of specularity. To get the SSS effect working we need a few more things set up. Let's look at the settings of the SSS shader. To get to the settings if you're not already looking at them:

  1. Select our test object.
  2. Open the Attribute Editor and change over to the 'misss_fast_simple_maya1' tab.
Note: Those people who are using my scene, your tab might actually say 'misss_fast_simple_maya2' instead of 1 for some reason, don't panic just ignore it, hehe.

Here are what the default settings look like:




Another Note: I'm using Maya 6.5, so if you're on Maya 6 and they look slightly different, it doesn't matter.

As you can see there are quite a few settings. I'll go over them all a bit later on once we've actually got the SSS working. The section we're interested in at the moment is the 'Lightmap' section.

  1. Click on the texture-applying button to the right of the 'Lightmap' slot and Maya will automatically create and connect a 'mentalrayTexture1' node.



Stop right there! What's a lightmap you ask? A lightmap is basically what Mental Ray calls a baked texture. It's an image map that's saved to disk (or loaded if you've previously saved one) during rendering, containing the lighting and shading information of your object. The way that the misss_fast_simple_maya shader will work at rendertime (once we've finished the next few steps) is by creating a lightmap, using that lightmap to calculate the SSS effect, then applying those new SSS calculations onto the object, at which point it renders in all it's SSSy glory. It sounds like a lot of render work and that it might be slow, but it's defintely not slow at all!

So anyway, by hitting the texture-applying button we've attached a mentalrayTexture node (basically just like a different Maya File Texture node). You should now be looking at the mentalrayTexture1 node's settings:




This node will handle the reading and writing of the lightmap file. There are some important and necessary options we need to change here:

  1. Tick the 'Writable' checkbox to enable our lightmap to be written.
  2. Change the 'File Size Depth' to 32 bits.
  3. Change the 'File Size Width' to double the width of your render resolution, and the 'File Size Height' to the same height as your render resolution.
  4. For example, if you're using my provided scene which is set to render at 400x300, your lightmap resolution should be 800x300. It's just what the misss_fast_simple_maya algorithm likes. You can actually set the resolution higher than this minimum requirement in order to get even more detail, but usually it's not necessary.
Now, this next step is optional:
  1. In the Image Name slot, type "mySuperSSS" or "C:mySuperSSS" (without the quotes, also with no extension). Both cases will cause the lightmap to be saved to the root area of the C: drive (on Windows).
Why is that step optional? Because if you left that filename blank, Mental Ray would just hold the lightmap in memory for the length of the render and then discard it. It would still work perfectly fine though. A reason you might save the lightmap to the harddrive as a file, is if perhaps your lightmap is applied to a huge/intricate object that takes quite a while to calculate the lightmap for, and you don't actually need it to be rebuilt each time you tweak other aspects of your scene. Then you'd do one rendering which saves the lightmap to disk, then turn off the 'Writable' option and from then on it simply reads the information it needs from disk without further calculation. There are also other reasons you might want to save the file to disk, one of which I'll talk about right at the end of this tutorial. Now your settings should be similar to this:




The two last settings to mention on this node are the 'Local' and 'Filter' checkboxes. You would need to turn the 'Local' option on if you were using Maya 6.5 and have other computers helping out via Mental Ray Satellite, (or a renderfarm using Mental Ray Standalone) because you don't want all the computers trying to create their own lightmaps. Turning on 'Local' creates only one lightmap on the master machine. The 'Filter' option when turned on applies mipmap-esque filtering to the lightmap, which is usefull for high resolution lightmaps seen from far away in your scene. Filtering however causes the lightmap to use 30% more memory, so only use it when it seems necessary.

Am I explaining all this ok? I sure hope so, haha. Moving on! Now that we've set it up so that a lightmap will be saved, let's look at a new render!:




Err? It's still the same! Yes, we're ready to create lightmap data, but we're not yet using it for anything. Time to follow a few more steps:

  1. In your Render View, click the 'Keep Image' button (down arrow pointing into a box) so that we can compare this render to the next result we'll get!
  2. Navigate your way to the Shading Group node of the Misss_fast_simple_maya (so you can see all the MR shader slots). You navigate to the Shading Group node by:
  1. Selecting your test object.
  2. Clicking over to the Misss_fast_simple_maya tab of the Attribute Editor,
  3. Then clicking on the button up at the top right, to the left of the 'Presets' button. It's basically the 'go to output connections' button.
  4. Finally, expand out the Mental Ray section.
Here's all that in pictures:

click for larger version


A Shading Group node (or SG node) is like a control centre, (all shaders in Maya are usually attached to one). It's here that you can plug in all sorts of Maya and Mental Ray shading networks to achieve your final result. Most of the time, when you're only using Maya shaders, you rarely have to do anything on a Shading Group node because Maya is good at connecting everything up here automatically. When using Mental Ray shaders however, because most of the available slots are optional, it's currently a manual setup task. When you 'apply' a material to an object, the object is actually connected to the Shading Group node of the material you specified. If you look at our expanded Mental Ray section: