Delay finding the light lists until after map has loaded

This commit is contained in:
Magnus Norddahl 2023-09-03 06:28:41 +02:00
commit ea02067b0a
4 changed files with 25 additions and 6 deletions

View file

@ -169,6 +169,8 @@ public:
virtual LevelMeshSurface* GetSurface(int index) { return nullptr; }
virtual int GetSurfaceCount() { return 0; }
virtual void UpdateLightLists() { }
TArray<LevelMeshSmoothingGroup> SmoothingGroups; // TODO fill
TArray<LevelMeshPortal> Portals; // TODO fill

View file

@ -538,6 +538,8 @@ void VulkanRenderDevice::SetLevelMesh(LevelMesh* mesh)
{
lastMesh = mesh;
mesh->UpdateLightLists();
GetTextureManager()->CreateLightmap(mesh->LMTextureSize, mesh->LMTextureCount);
GetLightmap()->Raytrace(mesh);
}