In a large database, I include a number of separate egg models with a larger switch distance (2000 meters). The farplane is defined at 2500 meters. When I move through the database some of these models seem to be switched on and off between cycles. When I am stationary they are rendered, while when I am moving they are ‘flickering’: one frame they are rendered while the next frame they are not rendered. When this occurs I am definitely closer than 2000 meters. If I am closer than, say, 300 meters, they are rendered all the time.
The near plane was set to 0.5. I increased it to 1.5 and the problem is still the same. The are no other objects near the ones that flicker. One is a large building and the others are hills.
Hmm, well, I don’t know what might be causing this flickering; but one idea to help narrow it down is to add the line:
fake-view-frustum-cull 1
to your Config.prc file. This will draw things in red wireframe when Panda believes they should be culled. (It may adversely affect your framerate, but this is just for a test.)
If setting this option makes your objects change temporarily into red wireframe, then we know it’s a problem with culling for some reason. If, instead, the objects still disappear the same way they did before, then it must be something else.
Thank you for your suggestions. I found it: the sky dome was smaller than the distance to these models, while setDepthWrite of the skydome was set to 0. I have set the DepthWrite of the skydome to 1 and then the flickering was solved. So this problem is solved.