How to setup phong shading (pixel shading)?


when developing a plugin, I used Rhino.Display.VisualAnalysisMode ----> UpdateVertexColors() to setup color for each vertex on my mesh, but it looks not nice and not smooth.
I’ve tried to find the way to setup color for each pixel on the mesh, but there is no related topic.

Could you give me your help?
Thank you very much!

Here are some posts about how to update vertex colors of a mesh:

Its up to you to filter which vertex should be which color.

To fix it too are more smooth color you maybe should increase the total numbers of vertexes of your mesh.
The more vertexes the more smooth it will render.

Thanks for your help!

I’ve tried many way to work with mesh vertex. Adding more vertex is a good way, and I had tried (it’s good when making the model, but when rendering model => there is no change because my model can not be allowed to add any vertex), but now I only want to render mesh by pixel shading.

Could you give me some ideas?

If your mesh is coarse, then it isn’t going to look smooth. Also, if your view is set to Shaded, no anti-aliasing will be applied. So try Rendered mode.

Beyond this, we will need more information on what you are trying to do to be helpful.

Thank you!
I’m going to try texture mapping way. Hope that way is better for my project!