Textures not working properly

I am trying to apply black and white textures to a mesh using a material and then using the diffuse colour command to colour in the texture randomly. The shadow part of the texture works properly and does give a proper colour although the side of the mesh exposed to light yet remains black and white. Why does this happen? And how can I fix it?

here is a screenshot of the code -


where plcolor is a randomly generated colour and texturefile is the black and white texture.

here is an image of how it looks -
image

Try also to color the ambientColor (note that you probably have to set the scene.ambientColor to white).

I have set the ambient colour to white although I have multiple such planets with different colours each, how do I go about this issue?

Any way I could solve this Issue?

We can’t really go further if we don’t have a playground to help, or at least an online demo with the inspector enabled.

I cannot create a playground, as the code is huge, about 800 lines and it contains a lot of the DOM elements as well that’s why it would be a task adding it to the playground and I am not sure how I could have an online demo?

Unfortunately we cannot help if we do not see the code running
It is like asking a doctor to cure a disease without seeing the patient :frowning: