|
2
|
|
Physically Correct and Non-Physically Correct
|
|
Distributed are two types of sub-surface scattering (sss from this point forth) shaders. Though there are more than two phenomenon, there are only two 'types' of scattering with these shaders and phenomenon. The first of the two is the physically incorrect shaders called misss_fast_ This shader makes use of a lightmap approach to try and approximate the sub surface scattering.
Bennefits
- Fast Rendering
- Does not reqiure photons
- Does not require raytracing
- Easy to tweak
- Looks good with very little tweaking
- Fairly easy to understand
- Nice frame to frame coherience (Doesn't have flickering artifacts)
Drawbacks
- Not a physically accurate light simulation
- Does not display correctly in reflections, as the scattering effect is very view dependent
For example this shader would not be a good choice if one was attempting to simulate fiber optic cables, or other physically accurate results where photons must come from the environment, interact with the material internally, and then be passed back out to further interact with the surrounding environment.
|
|
The first phenomenon we'll take a look at is the misss_fast_simple_maya phenomenon. Once you understand this phenomenon the other fast shaders and phenomenon will make sense. The misss_fast_simple_maya_ phenomenon makes use of the misss_fast_ shader.
Excersise 1 - physically inaccurate wedge
Unless otherwise noted all option boxes are assumed to be using their default settings. Be sure to reset your options box settings if in doubt as to their last used settings.
- Create a new scene.
- Window >> Settings/Preferences >> Preferences...
- The Preferences window will open, from the list on the left, select settings
- Under the Working Units section, make sure Linear is set to centimeter
It is important that your scene scale be consistent when using subsurface scattering, as it is scale dependent. Smaller objects will pass more light through than a larger object will. As such for a matter of consistency we are setting the working units to be in centimeters so that you're results will be identical to that of the steps outlined in this tutorial.
|
|
- Create >> Poly Primitives >> Poly Cube
- Set scale to 10 15 10 in the channel box.
- Select the top face of the cube and scale it down in X as shown (pic below) Also feel free to translate it such that it sits above the grid plane.
|
|
|
|
- Create >> Lights >> Spotlight and position it as shown.
- Edit >> Duplicate the potlight and position it as shown.
- Create >> Cameras >> Camera and position it as shown.
|
|
|
|
We created an independent rendering camera so that the use of our perspective camera is not impared, and we don't loose the 'gods eye view' of the scene. Camera bookmarks can work, but are slower than just making use of another camera. In addition, in larger scenes if we chose to render from many different camera angles, having more than one camera, we could very easily do so. With bookmarks this could be done, but not nearly as easily. Be smart, make another camera...always. Also feel free to scale up your cameras and lights, as their world space scale does not matter. (There are a few lights where this is not the case, such as volume lights and area lights!)
|
|
|
|
-
From the Materials section of the mental ray create bar in hypershade, click the "misss_fast_simple_maya" shader.
|
|
|
|
-
Middle mouse button drag the shader from hypershade onto the geometry in the scene to apply it. Your geometry will turn a shitty green color.
The native Maya render engine doesn't recognize all of the shaders and Phenomina mental ray has to offer. As a result the hardware preview will mark your geometry as a green color to let you, the user know that a particular piece of geometry isn't going to show up in a Maya software render. This is fine, as we aren't using the Maya software render, thus we don't care.
-
In the render globals switch to the mental ray render engine.
- Render a test frame at 640 x 480 with the default render global settings.
|
|
Look at that beautiful subsurface scattering...that isn't present.
Note: My camera's environment color has been changed for this tutorial. This is not required.
|
|
The fast brethren of sss shaders requires what is called a 'lightmap' to calculate the scattering. As it sits we really don't have one, thus this shader is not going to behave like it should. It doesn't make sense to mental ray, thus it doesn't make visual sense to us. But, because we're cool enough, we're going to provide the shading group with a lightmap to get this bad boy to render correctly. After that we'll start taking a look at some of the attributes of this shader and how to use them.
Hooking up the lightmap
- In Hypershade create one of these Light Maps nodes (pic) from the lightmaps section of hypershade's create bar.
|
|
|
|
- Open the attribute editor for the lightmap node.
- Under the Lightmap Write section, click the checkered box next to the lightmap attribute.
|
|
|
|
By clicking the checkered box Maya will create a mental ray file texture node. We will use this node to save out a lightmap that will then be passed to the shading group indirectly.
-
See image for instructions. Yeah, we could use the downstream connections button in the attribute editor...but we're cooler than that. We use Hypershade like all the cool kids in the back row.
|
|
|
|
-
Connect misss_fast_lmap_maya1.message >> misss_fast_simple_maya1SG.miLightMapShader
-
Connect mentalrayTexture1.message >> misss_fastSimple_maya1.lightmap
|
So far we have this chunk of coolness not so hard ehh?
|
|
Now, if we were to render this bad boy we'd not really be able to render this due to a crippling mental ray error. While our lightmap node exists, and is correctly hooked up we still have the problem that it isn't being written. This has to do with the fact that our mentalrayTexture node requires some attribute tweaks in order to enable it to actually write a texture file. So...onward to glory!
- ctrl + a to open the attribute editor for the mentalrayTexture1 file.
- Adjust the attributes to match the following image.
|
|
|
|
For those that traditionally use Maya's texture nodes, it may seem somewhat confusing that I'm sourcing nothing. Well, we're not really sourcing a texture, we're writing one. By leaving the Image Name attribute blank we're writing one to memory. We could optionally imput a name as shown in the image above and write one out to disk. For most users writing one out to disk isn't required.
On windows systems, the backslash character \ must be present if one has decided to write the texture to disk.
This file texture must be written as a 32 bit image. Where did I get resolution from? As a general rule of thumb: take the resolution width you'll be rendering at, so for me this would be 640 pixels, and double that value. I end up with 1280 pixels, that is the value I'll use for my file size width. Now, take the height of your rendering resolution, and enter it into the file size height input box. This is a *general* rule of thumb, that does not always apply, and we'll take a look at some examples of this later if we have time.
|
|
Mmmm, subsurface scattering goodness.
|
|
Congratulations! You've made your first sub surface scattering wedge of coolness. ...yeah, kind of anti-climactic...not to mention it looks like crap. I guess the real show of being cool is not falling asleep so far in this tutorial. Anywho, onward to more of 'what' is going on and 'why'.
|
|
2
|