Can't see the spotlight

Why do I have to enable “setShaderAuto (True)” when I set the spotlight? And when it is enabled, how much of my original scene content becomes transparent, how can I solve this?
After enabling

Before activation

I’m guessing that your ground-plane doesn’t have very many vertices–perhaps just one at each corner–and that aside from “setShaderAuto” you’re not applying any shaders to the ground-plane.

If so, then the reason for the lack of lighting without “setShaderAuto” may well be simply that old fixed-function lighting operates on the vertices of the model being lit. With all of the vertices far away from the light, the vertices are dark, and so all the space between them is dark, too.

To test this, you could try leaving out the call to “setShaderAuto” and then moving your spotlight over to one of the corners of the ground–if I’m right, you should see that corner light up.

As to the transparency, do the affected models perhaps have vertex colours applied? If so, then perhaps they have an alpha-value of less than one in their vertex colours, which is being applied by the auto-shader.

Unfortunately, the use of vertex lighting is useless in the Panda.

Well, you are right. It is indeed caused by too few vertices, I have added vertices to make it look more normal, thank you very much!

Well, indeed, although I understand this function, I always cannot see the expected effect when using it! Haha