2007-09-10

Sitting in the Shade with Maya... mia_material shadow shading.



Hello guys and gals.

Just a quick heads-up.

It's come to my attention that there is a performance issue with the "segment" shadow mode and the mia_material shadow shader. It's fine for transparent objects (i.e. it does the job it's "supposed to do").

However, for opaque objects, it is actually doing a bunch of unnecessary work, especially in "Segment" shadow mode - which is the default mode in Maya.

The workaround is very simple; don't use the shadow shader for opaque objects.

Normally, you would use the same instance of mia_material in your surface, shadow and photon slots. Well, if your material is opaque, simply don't put it in the shadow slot. This could gain you some performance.

/Z

(In Max this isn't an issue, since first of all, "segment" shadow mode isn't the default, and secondly, the UI frontend actually does the above already, i.e. it doesn't assign the shadow shader at all to opaque objects.)

11 comments:

kobayashy said...

The shadow method is now set to simple by default since Maya 8.5.

But this is a great trick in a scene that requires sorted shadow for some shader.

Caello said...

Looks great Zap´s !

shtefcs said...

nice work. I prefer 3d studio max.

www.cg-links.com
www.cg-files.com

djx said...

Thanks for the tip Master Zap.
I wrote a simple pop up window for maya that lets you choose which connections are made when you create the material. http://www.djx.com.au/blog/2007/10/14/mrcreatecustomnodemel/

Andrew Glazebrook said...

Very cool work !!

Peter Lorenz said...

..but if I don't plug it into the shadows slot, shouldn't I plug something else in instead?

Master Zap said...

Note I was talking about an opaque material. They, by the very definition of being opaque, need no shadow shader!

/Z

[BSOD] said...

nice, just sorted my scene right out,

shujah said...

I applied Mia Material to my model, kept a point light, and rendered. The model is not visible in the render view, can you help me?

kunal said...

i am using maya 2009 mental ray sun for architectural exterior scene...but i m unable to get transparent shadow for glass i am using in the scene.....m using normal blinn with transparency...dont know how to work with mib_shadow _transparency node.. any advise please?

Saykuus said...

How you doing Zap.. really appreciate all the info on mental you been sharing.. Im having trouble understanding the difference of using shadow method simple vs sorted.. Can you give some real world examples of y to chose one over the other.. also segmented as well.. been looking all over the net n keep gettin the same examples