maya 2008 users: See update at end of this post.
The mia_material makes most of the old maya shaders some what redundant. I'm sure it will take me some time to understand its full potential and some effort to learn how it works. So on my last two projects I forced myself to use mia for everything. That way I knew I would learn more quickly. And I have to say it gave great results. It is now my preferred shader for everything but sub-surface scattering.
Here is a problem I encountered, and the solution I found. It involves transparency and the alpha channel.
Mostly I render passes that are composited in after effects, so if I have transparant surfaces, the transparency must show correctly in the alpha channel.
This wireframe shows a test setup - the orange plane with the lump has a mia_material assigned. The blue spheres are there to demonstrate the shaders transparency.
I mapped a ramp texture to the transparency of the mia_material.
The render looks like this.
And the alpha channel, as you can see, shows the plane as having no transparancy.
I guess that this is technically correct because the mia_material is refracting the black background, but this is not what I need for compositing purposes.
The solution is to add a "helper" plane to the setup as shown in the following diagram.
The plane behind the spheres has a black surface shader assigned to it which has it's matte opacity set to zero. The plane is flagged to be visible in refraction, but has primary visibility and most of its other render stat flags disabled.
Now when I render the mia_material refracts the black plane instead of the background. Since the black plane has a matte opacity of zero it does not contribute to the alpha channel, and the mia_shader respects that in the refraction. Here is the result.
update 01 May 2008: In maya 2008 this trick is no longer required so long as you remember to turn on the mia_material Advanced Refraction Attribute called "Propagate Alpha". This is possibly how it was intended to work in maya 8.5 too - but it didnt...