mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-22 05:45:38 +00:00
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:
parent
714f6a123a
commit
06b43c45b3
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue