I am developing a material (Mtl). This material does not perform any shading by itself but instead relies on another material (passed as parameter) to do that.
Something like proxy.
This is a simple job. Just override all the Mtl methods like Shade, GetAmbient, GetDiffuse, ... etc, and call corresponding method of paramMtl.
Now I want to make my material compatible with mental ray.
I have implemented imrMaterialPhenomenonTranslation interface and tried to follow the same approach like before.
For every method of imrMaterialPhenomenonTranslation I do something like
imrMaterialPhenomenonTranslation phenTrans = GetIMRMaterialPhenomenonTranslation (paramMtl);
So far so good, but what I need to do in the "else" part? If I put mental ray material in paramMtl (Arch&Design for example) it works just fine, but if I put some 3dsmax material (for example Standard) ... well you can guess what happens. Standard 3dsmax materials does not implements imrMaterialPhenomenonTranslation interface. They rely on the mental ray translation system to translate them.
I suppose I can write some dummy mental ray material with a single material parameter, and translate my material to him, but I prefer to solve my problem by in some more elegant way.
So... Is there a simple way to solve this issue? Maybe there is a such dummy material already existing and I can use it, or there is a way to access mental ray translation system and call some Translate() method?
mrShader = Translate(_3dsmaxMaterial);
Can anyone help me?