Merge /u/fgarlin/simgear/ branch next into next

https://sourceforge.net/p/flightgear/simgear/merge-requests/73/
This commit is contained in:
Richard Harrison 2020-04-04 20:43:04 +00:00
commit ef002f6dfa
2 changed files with 11 additions and 8 deletions

View File

@ -290,7 +290,6 @@ ClusteredShading::update(const SGLightList &light_list)
// Force upload of the image data // Force upload of the image data
_light_grid->dirty(); _light_grid->dirty();
_light_indices->dirty();
// Upload pointlight and spotlight data // Upload pointlight and spotlight data
writePointlightData(); writePointlightData();

View File

@ -573,7 +573,7 @@ RegisterPassBuilder<ShadowMapPassBuilder> registerShadowMapPass("shadow-map");
class SceneUpdateCallback : public Pass::PassUpdateCallback { class SceneUpdateCallback : public Pass::PassUpdateCallback {
public: public:
SceneUpdateCallback(int cubemap_face, float zNear, float zFar) : SceneUpdateCallback(int cubemap_face, double zNear, double zFar) :
_cubemap_face(cubemap_face), _cubemap_face(cubemap_face),
_zNear(zNear), _zNear(zNear),
_zFar(zFar) {} _zFar(zFar) {}
@ -608,10 +608,14 @@ public:
1.0, 10000.0); 1.0, 10000.0);
} }
if (_zNear != 0.0f && _zFar != 0.0f) { if (_zNear != 0.0 || _zFar != 0.0) {
osg::Matrix new_proj; osg::Matrixd given_proj = camera->getProjectionMatrix();
makeNewProjMat(camera->getProjectionMatrix(), double left, right, bottom, top, znear, zfar;
_zNear, _zFar, new_proj); given_proj.getFrustum(left, right, bottom, top, znear, zfar);
if (_zNear != 0.0) znear = _zNear;
if (_zFar != 0.0) zfar = _zFar;
osg::Matrixd new_proj;
makeNewProjMat(given_proj, znear, zfar, new_proj);
camera->setProjectionMatrix(new_proj); camera->setProjectionMatrix(new_proj);
} }
} }
@ -652,8 +656,8 @@ protected:
} }
int _cubemap_face; int _cubemap_face;
float _zNear; double _zNear;
float _zFar; double _zFar;
}; };
class SceneCullCallback : public osg::NodeCallback { class SceneCullCallback : public osg::NodeCallback {