DisplayConduit.DrawMeshShaded + Texture + FlatShade Bug

I’m getting undesirable behaviour with DisplayConduit.DrawMeshShaded when using a Texture when in FlatShade mode.

This appears to be related to Issue with DrawMeshShaded in a Rhino 8 DisplayConduit - Rhino Developer - McNeel Forum - but specific to when FlatShade mode is turned on.

The issue arose in my own code which I am not able to share, but have replicated the issue in a gh script using Human.

using Mesh.SetSurfaceParametersFromTextureCoordinates helps, but things still look weird in flat shade mode. Textured meshes in the actual Rhino model (not drawn via GH or custom display conduit) in flat shade mode look fine.

Tested on Rhino 8 SR27

Screenshots pulled from script:

Normal appearance (Flat shade mode off)

No surface parameters + flat shade (shading completely fails)

No surface parameters + flat shade on then off (texture mapping is lost)

Surface parameters + flat shade, texture appears parameterised to each mesh face

Surface parameters + flat shade on then off, normal appearance restored

textured_flat_shade_bug.gh (7.9 KB)