point light makes database flash

I have a database in which I drive with the mouse, and an ambient light plus a point light, see code:

    # Add an ambient light
alight = AmbientLight('alight')
alight.setColor(Vec4(0.7, 0.7, 0.7, 0))
alnp = render.attachNewNode(alight)

# add a point light
    light2 = PointLight('pointlight')
plnp2 = render.attachNewNode(light2)

The ambient light gives no problem, but inclusion of the point light results in flashing: the light appears to switch on and off depending on my mouse movements. So if I turn the heading of the camera then the point light illuminates some objects in the database while they are not illuminated anymore when I turn the heading just a little bit further. This results in flashing on and off of objects in the database.

What could be the reason for this ?

Your attenuation value is (0, 0, 0), that’s kind of a weird value; have you tried other values? The default value is (1, 0, 0), and normally there’s a 1 in one component. If you really don’t want attenuation at all, you should use a DirectionalLight instead.

But in general, point lights can introduce flashing artifacts because they’re computed per-vertex instead of per-pixel (unless you enable per-pixel shading, which can be expensive depending on your scene). This happens if the vertex density of your scene doesn’t match the falloff cone of your point.