Alex Romosan wrote: > the latest commit to src/Main/CameraGroup.cxx changed the value of > zNear from .1 to .4 and this causes strange artifacts to show up when > panning around (like holes in the cockpit, etc.). the following patch > changes it back: > > --- src/Main/CameraGroup.cxx 27 Dec 2008 14:35:33 -0000 1.9 > +++ src/Main/CameraGroup.cxx 29 Dec 2008 06:58:41 -0000 > @@ -446,7 +446,7 @@ > cgroup->buildGUICamera(pNode); > } > } > - bindMemberToNode(gnode, "znear", cgroup, &CameraGroup::_zNear, .4f); > + bindMemberToNode(gnode, "znear", cgroup, &CameraGroup::_zNear, .1f); > bindMemberToNode(gnode, "zfar", cgroup, &CameraGroup::_zFar, 120000.0f); > bindMemberToNode(gnode, "near-field", cgroup, &CameraGroup::_nearField, > 100.0f); > > any reason for the change? FlightGear displays an enormous visual range, from 4 inches in front of your eyes out to 120km now and more in the future. It's a basic fact when using Z-buffered computer graphics that the precision of the Z-buffer deteriorates with huge near-far spreads and that the near plane distance has a much greater effect than the far plane. The symptoms are flickering, jitter, and other unpleasantness. About a year ago I added a scheme to use several cameras within the scene graph to work around this problem. Each camera draws a slice of the scene using the full range of the Z buffer. This mostly works well, though depending on your video hardware you can occasionally see a line in the scene. This should be able to be eliminated with some tuning. Recently, as part of the work in implementing shadow maps, I moved the cameras out of the scene graph to a "top level". For some reason this provoked the "black-rectangle" bug on some video hardware that's reared its head in the forums, but that's another story :) Anyway, my intention is to restrict shadows to the near camera. Shadow maps are even more sensitive to near-far plane precision issues than the normal Z buffer, so I'm experimenting with pushing the near plane out. .4 meters seemed sufficient to me, but others don't agree, so perhaps we can settle on some value larger than .1. The near plane value is settable, both in the camera configuration and as a "live" property in /sim/rendering/camera-group/znear.
Tim ------------------------------------------------------------------------------ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel