Fixes for large worlds

This commit is contained in:
Wojtek Figat
2022-07-04 20:35:29 +02:00
parent 8da4e546da
commit 2e947ab85a
3 changed files with 5 additions and 6 deletions

View File

@@ -196,7 +196,7 @@ void Model::Draw(const RenderContext& renderContext, MaterialBase* material, con
const BoundingBox box = GetBox(world);
BoundingSphere sphere;
BoundingSphere::FromBox(box, sphere);
int32 lodIndex = RenderTools::ComputeModelLOD(this, sphere.Center, (float)sphere.Radius, renderContext); // TODO: large-worlds
int32 lodIndex = RenderTools::ComputeModelLOD(this, sphere.Center - renderContext.View.Origin, (float)sphere.Radius, renderContext);
if (lodIndex == -1)
return;
lodIndex += renderContext.View.ModelLODBias;