Custom shaders written for Maya’s Software renderer can be translated to equivalent mental ray for Maya custom shaders. This way, two shaders are required (one custom Maya plug-in shader and one mental ray custom shader) but only one shading network is necessary.
In previous versions of Maya, you must create two separate shading networks, one with Maya's plug-in shader and the other with mental ray custom shader. You only need to make one shading network with the Maya plug-in shader, and mental ray for Maya will automatically translate the connection to the corresponding mental ray shader during processing.
int mentalrayCustomNodeGhost(string $shader) { // return "true" if $shader should be used in place of a custom Maya shader of the same name }
To relate a Maya custom shader with a mental ray for Maya custom shader
mental ray for Maya automatically detects that a custom Maya shader has the same name as the new mental ray shader. When rendering, it will use the mental ray shader as appropriate.