mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-22 05:45:38 +00:00
Clamp LODscale. If the object is drawn at zero we produce an Inf value which will produce Nans with later calculations.
This commit is contained in:
parent
0e07f29f80
commit
75260f9f2c
|
@ -738,6 +738,8 @@ void CNew3D::DescendCullingNode(UINT32 addr)
|
|||
float LODscale = m_nodeAttribs.currentDisableCulling ? std::numeric_limits<float>::max() : (fBlendRadius / std::hypot(x, y, z));
|
||||
const LOD *lod = m_LODBlendTable->table[lodTablePointer].lod;
|
||||
|
||||
LODscale = std::clamp(LODscale, 0.0f, std::numeric_limits<float>::max());
|
||||
|
||||
if (m_nodeAttribs.currentDisableCulling || (!outsideFrustum && LODscale >= lod[3].deleteSize)) {
|
||||
|
||||
// Descend down first link
|
||||
|
|
Loading…
Reference in a new issue