Go to: Related nodes. Attributes.
The Shading Map shader allows you to create various
non-photorealistic shading effects. For example, you can use it to
create cartoon-style materials. Use a Shading map shader in
conjunction with a regular shader (such as a Phong or Blinn shader)
and a texture (such as a Ramp or File texture). It works like a
post process --- first, the regular shader computes a color for
each point on the surface. Then, the shading maps shader
replaces this color with another color. This mapping is
based on two things; the brightness of the original color,
and the hue of the original color.
For example, you can create a material that renders the bright
areas of an object (the areas facing light) as red, and the dark
areas of an object (facing away from light) as blue. To do this,
use a Shading Map shader, a Lambert shader, and a Ramp texture. The
Ramp texture is red on the top, and blue on the bottom. Connect the
Lambert shader's Out Color attribute to the Shading Map shader's
Color attribute. Connect the Ramp texture's Out Color attribute to
the Shading Map shader's Shading Map Color attribute. When you
render, the Lambert shader calculates the color for each point on
the material. Then the Shading Map shader replaces the color at
each point by 'looking up' a color at on the Ramp texture. The hue
of the original color gives the horizontal position on the ramp,
and the brightness of the original color gives the vertical
position. The original color is replaced with the color at that
position on the Ramp. So in this example, the bright areas become
red, and the dark areas become blue. For a different example, let's
say you used the same Ramp texture turned sideways. Then no matter
how bright the pixel was, it would be mapped to the same color
intensity. Colors of different hues would be mapped to different
shades of red or blue. Using similar techniques, Shading Map
shaders can be used to do cartoon-style rendering. In the table
below, important attribute have their names indicated in
bold in the description column.
This node is MP safe
Node name |
Parents |
Classification |
MFn type |
Compatible function sets |
shadingMap |
node
|
shader/surface |
kShadingMap |
kBase
kNamedObject
kDependencyNode
kShadingMap |
Related nodes
lambert, reflect, phongE,
phong, blinn,
anisotropic, volumeShader, simpleVolumeShader, surfaceShader, displacementShader, layeredShader, useBackground, defaultShaderList
Attributes (40)
color, colorB, colorG,
colorR, glowColor, glowColorB, glowColorG, glowColorR, mapFunctionU, mapFunctionV, matteOpacity, matteOpacityMode, outColor, outColorB, outColorG, outColorR, outGlowColor, outGlowColorB, outGlowColorG, outGlowColorR, outMatteOpacity, outMatteOpacityB, outMatteOpacityG, outMatteOpacityR, outTransparency, outTransparencyB, outTransparencyG, outTransparencyR, renderPassMode, shadingMapColor, shadingMapColorB, shadingMapColorG, shadingMapColorR, transparency, transparencyB, transparencyG, transparencyR, uCoord, uvCoord,
vCoord
Long name (short name) |
Type |
Default |
Flags |
|
uvCoord
(uv ) |
float2 |
0.0, 0.0 |
    |
|
|
|
mapFunctionU
(mfu ) |
enum |
0 |
    |
|
mapFunctionV
(mfv ) |
enum |
2 |
    |
|
color
(c ) |
float3 |
|
    |
|
|
|
|
shadingMapColor
(sc ) |
float3 |
|
    |
|
shadingMapColorR
(scr ) |
float |
0.5 |
     |
|
|
shadingMapColorG
(scg ) |
float |
0.5 |
     |
|
|
shadingMapColorB
(scb ) |
float |
0.5 |
     |
|
|
glowColor
(g ) |
float3 |
|
    |
|
glowColorR
(gr ) |
float |
0.0 |
     |
|
|
glowColorG
(gg ) |
float |
0.0 |
     |
|
|
glowColorB
(gb ) |
float |
0.0 |
     |
|
|
transparency
(it ) |
float3 |
|
    |
|
transparencyR
(itr ) |
float |
0.0 |
     |
|
|
transparencyG
(itg ) |
float |
0.0 |
     |
|
|
transparencyB
(itb ) |
float |
0.0 |
     |
|
|
outColor
(oc ) |
float3 |
|
  |
|
outColorR
(ocr ) |
float |
0.0 |
  |
|
|
outColorG
(ocg ) |
float |
0.0 |
  |
|
|
outColorB
(ocb ) |
float |
0.0 |
  |
|
|
outTransparency
(ot ) |
float3 |
|
  |
|
outTransparencyR
(otr ) |
float |
0.0 |
  |
|
|
outTransparencyG
(otg ) |
float |
0.0 |
  |
|
|
outTransparencyB
(otb ) |
float |
0.0 |
  |
|
|
outGlowColor
(ogc ) |
float3 |
|
  |
|
outGlowColorR
(ogr ) |
float |
0.0 |
  |
|
|
outGlowColorG
(ogg ) |
float |
0.0 |
  |
|
|
outGlowColorB
(ogb ) |
float |
0.0 |
  |
|
|
matteOpacityMode
(mom ) |
enum |
2 |
    |
|
matteOpacity
(mog ) |
float |
1.0 |
     |
|
outMatteOpacity
(omo ) |
float3 |
|
  |
|
outMatteOpacityR
(omor ) |
float |
0.0 |
  |
|
|
outMatteOpacityG
(omog ) |
float |
0.0 |
  |
|
|
outMatteOpacityB
(omob ) |
float |
0.0 |
  |
|
|
renderPassMode
(arp ) |
enum |
1 |
     |