Lighting issue when camera is moving

Hello, I’ve been working with panda for a few days now. I recently encountered a weird issue with spot lights and also directional lights, you can see it here (sorry it’s laggy and not edited):

youtube.com/watch?v=Pw3H3ioDC8s

The ceiling and also other things are affected by light depending on camera position and angle so when I’m moving it changes from light to dark and makes this blinking. Now I don’t know if it’s intended to be that way, I just want some parts of the model more lighted than others which I can’t achieve using ambient light only. Is there anything I can do with it? Or do you think my model is wrong?

Seems like a specular issue.
Try to play a bit with / reduce the specular value of the ceiling and see what happens.

Probably just a problem with too few vertices. Normal OpenGL lighting is computed only on the vertices and blended between them, so it looks weird when your lights are close to edges and moving between vertices.

You can either increase the number of vertices in your model, or you can enable per-pixel lighting. Per-pixel lighting is enabled as part of the auto-shader code, so you can just do model.setShaderAuto().

David

I once had a similar problem where the light source was moved when the camera moved. Is your spotlight attached to the camera node, or are you moving the light node in some way (probably a side effect of other movements) ?

Thank you guys, I’ll try to take your advices! I try to make my models using as few polygons as possible, I didn’t know it could cause some problems, anyway this per-pixel lighting seems promising.

I’m quite sure I’m not moving the light node but it’s a good point, I’ll check if its position isn’t changing somehow.

So I checked if anything was moving and both the light and the model stay still. Then I tried to allow per-pixel lighting - this didn’t solve the problem but it showed that those shadows get weird only when I’m rotating the camera, when I’m moving it’s fine:

youtube.com/watch?v=277NIqMm … e=youtu.be

I tried allowing default camera control and create another light, all stayed buggy. Now I think it’s a specular lighting issue as was said, but I wasn’t able to get rid of it. I used material on the model and set it’s shininess to 0, but it did nothing. I’m kinda newbie with this engine so I guess it’s some stupid bug, I just can’t see it.