Using MPxShaderOverride within MPxGeometryOverride?

Using MPxShaderOverride within MPxGeometryOverride?

Anonymous
Not applicable
477 Views
1 Reply
Message 1 of 2

Using MPxShaderOverride within MPxGeometryOverride?

Anonymous
Not applicable

Hi,

I am trying to use a custom MPxShaderOverride plugin to render an MPxGeometryOverride. The SDK documentation  says this should be possible but I can see any example.

The only way I see one can use a particular shader in geomerty override is to set a shader for renderItems and the function to do this allows only MShaderInstance type shaders. To make things worse, the shader created through MShaderInstance ignores most of the semantics in my shader.

Does anyone has an experience with this?

 

Thanks.

 - Moumine

0 Likes
478 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable

I know this is a very old question, but in case others run into the same problem...

 

Create a custom MPxHardwareShader and give it a unique draw classification when you register it. When you register your shader override, pass that same draw classification as the first arg.

 

In your scene create an instance of the MPxHardwareShader and assign it to the nodes being handle by your MPxGeometryOverride. When it comes time to render them Maya will use your shader override.

0 Likes