Hi Everyone,
I have a rather strange behavior in my Hololens project regarding shaders and meshes generated via scripts.
The problem is the following:
I have a script that generates a mesh and configures the MeshFilter and the MeshRenderer. The mesh seems perfect in the editor in play mode apart from the coloring. I only get a completely homogeneous color no matter what material and/or shader and color I use. Even if I additionally use a Texture nothing changes. In the attached image I have a triad prefab shaded correctly seen in the green rectangle. In the yellow rectangle you can see a roof like mesh shaded just plain gray with no ambient lighting. Strangely the gray color is not even the color I assign in the script. The blueish color only shows (also incorrectly shaded) if I use rim lighting on the mesh (seen in the red rectangle).
As to the normal vectors, I double checked them and even if I don’t use my own normals but let “RecalculateNormals
” figure them out, I get the same results.
At this point I’m pretty desperate since I haven’t found any clues as to what might cause this. I guess I am missing something very important/basic but I’m really out of ideas. I hope someone here can point me in the right direction. Oh, and I’m using Unit 5.6.2f1.
Thanks for any help,
Kornel