Unwanted color gradient on mesh faces DisplayConduit


I’ve created a basic Display Conduit class to draw my custom mesh. I wanted to have mesh where every face is a solid color so I created a collection of meshes from my original mesh where every mesh only have one face (or when I “extrude” the faces then 5-6 faces). When the displaypipeline draws the mesh it creates a gradient on the mesh face where one corner is darker than the other. How do I get rid of this effect? I just want a solid color face.

With best regards Matti.

Are you using DrawMeshFalseColors to draw your mesh? If so then you probably have your vertex colors set up incorrectly.

I draw each mesh with only one color:

e.Display.DrawMeshShaded(m, new DisplayMaterial(color, 0));

Should i try to determine the vertex colors separately?

Ok. I drew the mesh with the false colors and worked just fine :). So I assume that the problem was with the shader (when I drew the mesh “shaded” it rendered some shadows to the faces?)

Thanks for the help.

Good to hear using DrawFalseColors worked. Not sure how this is supposed to work. It may very well be that those are indeed the shadowing results. Maybe ensuring vertex normals are all parallel helps with your original code.