2014年1月15日 星期三

mask3d node

set cut_paste_input [stack 0]
version 7.0 v10
push $cut_paste_input
Group {
 name mask3d
 selected true
 xpos 1457
 ypos -418
 addUserKnob {20 User}
 addUserKnob {18 pos l Position t "Select the colour that corresponds to the position you want."}
 pos {5.994726658 48.59552765 6.745039463}
 addUserKnob {13 rad l Radius}
 rad {0.7 {rad.x} {rad.x}}
 addUserKnob {7 fall l "Falloff Exponent" R 1 10}
 fall 3.25
 addUserKnob {7 gain l Hardness}
 gain 0.54
}
 Input {
  inputs 0
  name __POS_INPUT__
  xpos 95
  ypos 536
 }
 Expression {
  temp_name0 distR
  temp_expr0 (Br-parent.pos.r)/rad.x
  temp_name1 distG
  temp_expr1 (Bg-parent.pos.g)/rad.y
  temp_name2 distB
  temp_expr2 (Bb-parent.pos.b)/rad.z
  temp_name3 len
  temp_expr3 sqrt((distR*distR)+(distG*distG)+(distB*distB))
  expr0 pow(1-len,fall)
  expr1 pow(1-len,fall)
  expr2 pow(1-len,fall)
  expr3 pow(1-len,fall)
  name __POSITION_KEY__
  xpos 95
  ypos 597
 }
 Clamp {
  channels rgba
  name Clamp1
  xpos 95
  ypos 641
 }
 Group {
  name Perlin_gain
  help "This is an implementation of Ken Perlin's gain function. It boosts micro-contrast (acutance, in photographic terms) without clipping. When set to 0.5, it has no effect. When >0.5, gain is boosted; when <.5, gain is muted. Only luminance is affected; not hue nor saturation. Superwhites remain untouched."
  tile_color 0xcc9d6d00
  xpos 95
  ypos 686
  addUserKnob {20 "" l User}
  addUserKnob {7 realGain l "Perlin Gain function" t "This is an implementation of Ken Perlin's gain function. It boosts micro-contrast (acutance, in photographic terms) without clipping. When set to 0.5, it has no effect. When >0.5, gain is boosted; when <.5, gain is muted. Only luminance is affected; not hue nor saturation. Superwhites remain untouched."}
  realGain {{parent.gain}}
 }
  Input {
   inputs 0
   name Input1
   selected true
   xpos 130
   ypos -89
  }
  Expression {
   temp_name0 gain
   temp_expr0 parent.realGain
   temp_name1 lum
   temp_expr1 "0.2125*Br + 0.7154*Bg + 0.0721*Bb"
   temp_name2 val
   temp_expr2 .5*((lum<.5)?((1-gain)>0?pow(2*lum,log(1-gain)/log(0.5)):0):2-((1-gain)>0?pow(2-2*lum,log(1-gain)/log(0.5)):0))
   expr0 r>1?r:r*(val/(lum+0.00001))
   expr1 g>1?g:g*(val/(lum+0.00001))
   expr2 b>1?b:b*(val/(lum+0.00001))
   name KPGain
   tile_color 0xd47f3b00
   label "TRUE GAIN\nFUNCTION"
   xpos 130
   ypos -24
   addUserKnob {20 "" l User}
  }
  Output {
   name Output1
   xpos 130
   ypos 98
  }
 end_group
 Clamp {
  channels rgba
  name Clamp2
  selected true
  xpos 95
  ypos 731
 }
 Output {
  name Output1
  xpos 95
  ypos 839
 }
end_group

Enable the mip production shader in Maya mentalRay

The Mental Ray production shaders are hidden by default.  mip_* mib_* mia_*
Simply go to your script editor, type in:
optionVar -intValue "MIP_SHD_EXPOSE" 1;
Also check out info on the finest in Mental Ray websites from Zap
http://mentalraytips.blogspot.com.br/2007/10/production-shaders-hidden-treasures-of.html
To find more info you can always search "Mental Ray production shaders" as well as read the 2013 Mental Ray production manual online.

http://docs.autodesk.com/MENTALRAY/2013/ENU/mental-ray-help/