I’ve just discovered, thanks to a player reporting it, that if one sets the FOV in A Door to the Mists to 60, one suddenly encounters rather nasty flickering of geometry that looks like a culling issue.
This flickering doesn’t seem to be visible at an FOV of 50, or of 70.
My guess is that I’m missing a step somewhere that would update Panda’s culling frustum, or something like that–but if so, then I don’t know what step I’m missing.
Note that this is being done on a custom camera, rather than the default “base.cam” camera.
The FOV is adjusted like so:
lens = world.sceneCamera.node().getLens()
lens.setFov(fov*lens.getAspectRatio())
And the camera and related card and buffer are created or (if antialiasing is toggled) updated like so:
self.cleanupBuffers()
frameProperties = FrameBufferProperties()
frameProperties.setMultisamples(multisamples)
frameProperties.setRgbaBits(8, 8, 8, 0)
frameProperties.setDepthBits(32)
windowProperties = base.win.getProperties()
self.mainBuffer = base.graphicsEngine.makeOutput(base.pipe, "Main Buffer", -1,
frameProperties, windowProperties,
GraphicsPipe.BFRefuseWindow, base.win.getGsg(), base.win)
self.mainBuffer.setClearColor(Vec4(0, 0, 0, 1))
if self.sceneCamera is None:
self.sceneCamera = base.makeCamera(self.mainBuffer)
self.sceneCamera.node().setScene(self.rootNode)
self.sceneCamera.node().setCameraMask(BitMask32(1))
self.updateAspectRatio()
else:
region = self.mainBuffer.makeDisplayRegion(0, 1, 0, 1)
region.setCamera(self.sceneCamera)
self.sceneTexture = Texture()
self.sceneTexture.setWrapU(Texture.WM_clamp)
self.sceneTexture.setWrapV(Texture.WM_clamp)
self.mainBuffer.addRenderTexture(self.sceneTexture,
GraphicsOutput.RTMBindOrCopy)
self.card.setTexture(self.sceneTexture)
Note that “self.sceneCamera” in the latter excerpt should be the same as “world.sceneCamera” in the former, I believe.