Ocean hunter in the middle of the game is passing a few matrices with FLT_MAX inside them, which blows apart our near/far calculation. The hardware must have some method to sanitize the near/far for instance if you render something extremely close to the origin you will also blow apart any near/far calc.

This commit is contained in:
Ian Curtis 2019-11-02 20:11:48 +00:00
parent 714f6a123a
commit 06b43c45b3

View file

@ -1584,6 +1584,10 @@ void CNew3D::ClipModel(const Model *m)
void CNew3D::CalcViewport(Viewport* vp, float near, float far)
{
if (far > 1e30) {
far = near * 1000000; // fix for ocean hunter which passes some FLT_MAX for a few matrices. HW must have some safe guard for these
}
if (near < far / 1000000) {
near = far / 1000000; // if we get really close to zero somehow, we will have almost no depth precision
}