• About us
  • Contact Us
  • Terms and Conditions
  • Forum
  • Materials
  • Shaders
  • Tools
  • Video
  • Learn
  • Gallery
My Mental Ray

Navigation

  • Main Page
  • Cookbook

MYMR WIKI Tools

  • Creating pages
  • Markup n styles
  • Page protection
  • Help

 

Toolbox

  • Upload file
  • Special pages
  • Printable version
  • Permanent link
Article    Discussion    View source    History   
Personal tools
  • Log in / create account

Production shader library

From Wiki

Jump to: navigation , search

Contents

  • 1 Production shader library
    • 1.1 Why are they "Hidden"?
    • 1.2 So how do I "unhide" them
      • 1.2.1 Maya 2008
      • 1.2.2 3ds max 2008
    • 1.3 Is there documentation?
    • 1.4 What is the intent behind these shaders?
    • 1.5 So what do they do, in a nutshell?

Production shader library

The mental images "production" shader library was introduced with mental ray 3.6. After a first appearance as a closed beta on the lamrug.org, it got its first introduction to the general public with Maya2008.

Why are they "Hidden"?

To many peoples surprise, the shaders were included as "hidden", i.e. they do not automatically appear in the user interface of the product. The reason for this simply boils down to a matter of resources; there was not enough time available for reliable quality assurance of these shaders within Autodesk. And I think everyone agrees that in the choice between having the shaders but "hidden" in this "officially unsupported" state in this version is better than not having them in there at all, which would have been the alternative.

In a sense, one can consider this release a "very open beta".

As Ken Pimentel, product manager of 3ds max puts it on his blog:

 These had to ship as "unsupported" or the QE/Doc team would have quit enmasse. 
 These tools will ship with documentation and you'll learn how to install them.

So how do I "unhide" them

This depends on the application, and the "method" you want to use.

Maya 2008

In Maya2008, the easiest (but somewhat "crude" way) is to go into the file C:\Program\Autodesk\Maya2008\scripts\others\mentalrayCustomNodeClass.mel and remove any line with a mention of the "mip_*" shaders. It's near the end of the file.

Somewhat less crude is to rather than removing them, commenting them out by writing // (two forward slashes) in the beginning of the lines in question. This will make the rest of the line "inert" and not do anything.

An even less crude method is to actually put the shaders in some form of category..

3ds max 2008

In 3ds max 2008, open the file c:\Program\Autodesk\3ds max 2008\mentalray\shaders_standard\include\production_max.mi and find any line except the first one that reads

"hidden"

And change it to

# "hidden"

The reason you should skip the first line is that this is an internal dummy node that only exists to be able to add these gui attributes in the first place, it cannot do something, won't work if instanced in the scene, so just keep it "hidden".

Is there documentation?

Yes, extensive docs in PDF format. http://www.mentalimages.com/2_1_8_documents/production.pdf

What is the intent behind these shaders?

Some of the shaders are just "standardized" versions of very simple tools. For example mip_rayswitch is just an extremely trivial ray switching shader. It is not rocket science or technically advanced, it is just there so that everyone now has a ray switching node to reach for, rather than having to search the net for something like ctrl_rays or Puppets shaders, and finding some shader not available for operating system X or whatever. It doesn't mean it's the best ray switching shader, just a quick default one that is readily available.

As a matter of fact, several of the shaders were designed with the primary intent of being simple defaults for various things. Another example, mip_mirrorball, pretty much does with Maya's EnvBall already does, so it is partially redundant for a Maya user... yet, 3ds max does not have an equivalent shader, and hence it is useful there. Conversely, the extremely simple mip_cameramap shader is only intended to project things back from the rendering camera, for any more "fancy" camera projection, there is ample tools in most applications to do similar things in more powerful ways... yet mip_cameramap is simple and it gets its job done, even though its "job" is somewhat limited in scope.

Having "standard" shaders like this also helps a lot in writing online tutorials, which allows these to be more cross-platform, as well as helps people to exchange files between applications.

So what do they do, in a nutshell?

mip_rayswitch and mip_rayswitch_advanced simply allows different results of some part of a shader tree depending on the type of ray. The "advanced" one simply works with the type "shader" rather than the type "color" - that's it.

mip_rayswitch_environment solves the age old problem of "I want this one photo for my background, but this other thing for my reflection environment". Maya can somewhat solve this (to an extent) with the camera image planes, whereas 3ds max has no workable tool for this. This shader simply allows different results for rays that just go "straight through" the scene (technically, eye rays, transparency rays children of eye rays, or refraction rays that was not actually refracted, i.e. ran through an IOR of near-1.0), vs. any other type of ray.

mip_gamma_gain simply applies a gamma and a multiplier to a color. Totally redundant for Maya users, who has nodes for this already, but 3ds max actually lacks a gamma node. Would help people write cross platform Phenomena that needs such adjustments.

mip_card_opacity is a trivial opacity shader, that takes some other shader and applies an opacity to it. The intent is to use it for billboard style objects. The trick here is that for opacity zero, the shader actually uses mi_trace_continue, which causes the surface to behave "as if it isn't even there", which means that things like the Z-depth and motion buffers will actually contain data for the next object, rather than the opaque billboard object.

mip_mirrorball and mip_grayball are simple shaders that unwrapps a simple photo of a gray or mirror ball (just a normal photo of the ball, cropped so the edges of the ball touches it) such that it can be used as environment right away with no tinkering in tools like HDRshop. Please note that the intent is only for when the mirror/grayball photo is shot from the same angle as the background plate is shot. For anything "more advanced" than that you would need traditional unwrapping techniques.

mip_motionblur is a post 2.5d motion blur shader. Make sure your scene is set up to generate motion vectors, and apply it as an output shader.

mip_motion_vector works similar to the above but outputs "magic colors" that several styles of post tools accept, such as ReelSmart MotionBlur, ReelFx SmoothKit, and Toxik, among others.

mip_cameramap is a simple "project back to the scene" camera mapper from the rendering camera. The intent for this is to work together with mip_rayswitch_environment or mip_matteshadow, where you generally put this shader in the "background", using your scenes background plate photo in the "map" slot of it.

mip_matteshadow (and the material Phenomenon mip_matteshadow_mtl) are the real work-horse shaders in this pack. It is intended when you want to add CG objects onto a photo of a real world scene. It does everything the 3ds max "Matte/Shadow" material and the Maya "Use Background" shaders do, but on steroids, correctly, and with a truckload of more features, including:

  • Non-self-shadowing shadow reception
  • Built in non-self-occluding ambient occlusoin
  • Non-self-reflecting glossy reflections
  • Catches and generates bounce light through FG
  • Can catch special "illuminator" lights to light up the plane
  • Several outputs for the various sub-effects

The reason for all the "non-self-X" features is that if you have a photograph of a real scene, it already contains the shadows, occlusion, reflections, etc. that already existed in the real world. As long as all that is used is a flat plane, this never becomes a problem, but if the stand-in model for the background is in any way more complex, you quickly get into cases where shadows get added which are already in the photo, reflections get cast which are already in the photo, etc. This shader resolves all that.

Retrieved from "http://www.mymentalray.com/wiki/index.php/Production_shader_library"
Copyright © 2008 My Mental Ray Community. All Rights Reserved.
No part of this website may be reproduced unless for personal use without prior written permission from The My Mental Ray Community.