Fix large worlds rendering of meshes

Add `Double4x4` for higher precision matrices operations

#2985
This commit is contained in:
Wojtek Figat
2025-02-11 13:01:48 +01:00
parent 21f8dab5de
commit aa8add7b38
13 changed files with 338 additions and 9 deletions

View File

@@ -334,9 +334,7 @@ void StaticModel::Draw(RenderContext& renderContext)
GlobalSurfaceAtlasPass::Instance()->RasterizeActor(this, this, _sphere, _transform, Model->LODs.Last().GetBox());
return;
}
Matrix world;
GetLocalToWorldMatrix(world);
renderContext.View.GetWorldMatrix(world);
ACTOR_GET_WORLD_MATRIX(this, view, world);
GEOMETRY_DRAW_STATE_EVENT_BEGIN(_drawState, world);
if (_vertexColorsDirty)
FlushVertexColors();
@@ -372,9 +370,7 @@ void StaticModel::Draw(RenderContextBatch& renderContextBatch)
if (!Model || !Model->IsLoaded())
return;
const RenderContext& renderContext = renderContextBatch.GetMainContext();
Matrix world;
GetLocalToWorldMatrix(world);
renderContext.View.GetWorldMatrix(world);
ACTOR_GET_WORLD_MATRIX(this, view, world);
GEOMETRY_DRAW_STATE_EVENT_BEGIN(_drawState, world);
if (_vertexColorsDirty)
FlushVertexColors();