MShaderInstance from MPxHardwareShader

MShaderInstance from MPxHardwareShader

Anonymous
Not applicable
430 Views
2 Replies
Message 1 of 3

MShaderInstance from MPxHardwareShader

Anonymous
Not applicable

How do I create an MShaderInstance from a class derived from MPxHardwareShader? The documentation for MShaderManager has a method MShaderInstance* geShaderFromNode(), but it requires surfaceShader as an MObject type.

0 Likes
431 Views
2 Replies
Replies (2)
Message 2 of 3

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

I don't think you can, MPxHardwareShader is a VP1 interface.

 

You can find more porting details here.

http://images.autodesk.com/adsk/files/VP2_API_Porting_Guide_Details0.pdf

 

Yours,

Li

Message 3 of 3

Anonymous
Not applicable

Yup. It seems I can't.

 

I have heavily modified dx11Shader plugin and was wondering how to use this as a scene level shader for a class derived from MSceneRender. I have come up with a way to do this without using shaderOverride method of MSceneRender. I have created a named set in my scene. Inside my plugin I am enumerating all the objects and using a sequence of MGlobal::execute() methods to put them in my shading group. 

 

BTW, thanks for the link. It describes the philosophy behind API design. We need such docs for APIs in addition to docs containing references describing methods and classes 😉

0 Likes