Two sided lighting with stock Blinn shader

Sascha.Fichtner
Explorer
Explorer

Two sided lighting with stock Blinn shader

Sascha.Fichtner
Explorer
Explorer

In my MPxGeometryOverride implementation I am rendering a custom render item (of type MRenderItem::NonMaterialSceneItem) using a stock MShaderManager::k3dBlinnShader. While the front side of my triangles are nicely lit, the backsides are all black. And that's independent of the setting for the 'Two Sided Lighting' option. To verify this (mis)behavior I created a simple Polygon Plane. With the 'Two Sided Lighting' option switched off, both the polygon plane and my render item (which is also a plane) behave identical (lighting-wise). With that option switched on, my custom render item behaves exactly like before whereas the polygon plane now has its backfaces properly lit as well.

Is there a way to make two sided lighting work in my setup? I am probably missing something really obvious here... 🙂

Thanks for any help,
Sascha


Note: This should be easy to reproduce by taking the devkit footPrintNode_GeometryOverride example and by:

  • replacing the MShaderManager::k3dSolidShader with a MShaderManager::k3dBlinnShader (incl. switching from 'solidColor' to 'diffuseColor')
  • switching from MRenderItem::DecorationItem to MRenderItem::NonMaterialSceneItem
0 Likes
Reply
555 Views
1 Reply
Reply (1)

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

I can't reproduce this issue with Maya 2018. I simplfieid the shape because I need to add normals.

 

Shade with texture only.Shade with texture only.All light with ambient light.All light with ambient light.

Since there aren't any normals in original code or your reproducing guidance, I think it might be the cause.

 

Yours,

Li

0 Likes