When generating a mesh using Mesh.add_surface(format,Vector3Array), I can generate the mesh correctly. I can add it as a resource to a MeshInstance node. The mesh displays correctly, except for how it interacts with lighting.
The MeshInstance does not interact with external lighting whatsoever. It does not diffract, it does not scatter uniformly. The only color seen is the emission color.
If an imported OBJ mesh is used instead, the problem is gone and the MeshInstance interacts with light correctly.
If the Mesh.regen_normalmaps() function is used, the problem persists. Only emission is seen.
If the mesh is saved as a resource using ResourceSaver.save and added to another MishInstance, the problem persists. Only emission is seen.
In the attached image, you can see four MeshInstance nodes. A cube, demonstrating the correct behavior of the external light. Next: Black paraboloid as saved from Mesh.addsurface and assigned to a MeshInstance. Its emission color is set to black. Next: Red paraboloid, as assigned to a MeshInstance at compile time using self.setmesh. Its emission color is set to red. Next: Greed paraboloid, an attempt to use SurfaceTool (which is not a solution, as it is not parallelizable for efficiency). For SurfaceTool, both with and without generate_normals have the incorrect behavior.
My question is this: What am I doing wrong? How can I programatically add a locally generated mesh to the scene and have light diffuse and diffract correctly (not in a serial manner, as in SurfaceTool)? Is it something to do with normals? Thank you very much for reading; I am enjoying Godot a lot.