mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-21 10:20:46 +00:00
Fix lightmapper still using hacks to detect levelmesh changes
This commit is contained in:
parent
776b615e10
commit
2c795a5a8b
3 changed files with 13 additions and 18 deletions
|
@ -46,18 +46,17 @@ VkLightmap::~VkLightmap()
|
|||
lights.Buffer->Unmap();
|
||||
}
|
||||
|
||||
void VkLightmap::Raytrace(LevelMesh* level, const TArray<LevelMeshSurface*>& surfaces)
|
||||
void VkLightmap::SetLevelMesh(LevelMesh* level)
|
||||
{
|
||||
bool newLevel = (mesh != level);
|
||||
mesh = level;
|
||||
if (newLevel)
|
||||
{
|
||||
UpdateAccelStructDescriptors();
|
||||
UpdateAccelStructDescriptors();
|
||||
|
||||
lightmapRaytrace.Reset();
|
||||
lightmapRaytraceLast.Reset();
|
||||
}
|
||||
lightmapRaytrace.Reset();
|
||||
lightmapRaytraceLast.Reset();
|
||||
}
|
||||
|
||||
void VkLightmap::Raytrace(const TArray<LevelMeshSurface*>& surfaces)
|
||||
{
|
||||
if (surfaces.Size())
|
||||
{
|
||||
lightmapRaytrace.active = true;
|
||||
|
|
|
@ -90,8 +90,8 @@ public:
|
|||
VkLightmap(VulkanRenderDevice* fb);
|
||||
~VkLightmap();
|
||||
|
||||
void Raytrace(LevelMesh* level, const TArray<LevelMeshSurface*>& surfaces);
|
||||
|
||||
void Raytrace(const TArray<LevelMeshSurface*>& surfaces);
|
||||
void SetLevelMesh(LevelMesh* level);
|
||||
private:
|
||||
void UpdateAccelStructDescriptors();
|
||||
|
||||
|
|
|
@ -475,6 +475,7 @@ void VulkanRenderDevice::BeginFrame()
|
|||
{
|
||||
levelMesh->UpdateLightLists();
|
||||
GetTextureManager()->CreateLightmap(levelMesh->LMTextureSize, levelMesh->LMTextureCount);
|
||||
GetLightmap()->SetLevelMesh(levelMesh);
|
||||
|
||||
#if 0 // full lightmap generation
|
||||
TArray<LevelMeshSurface*> surfaces;
|
||||
|
@ -484,9 +485,7 @@ void VulkanRenderDevice::BeginFrame()
|
|||
surfaces[i] = mesh->GetSurface(i);
|
||||
}
|
||||
|
||||
GetLightmap()->Raytrace(mesh, surfaces);
|
||||
#else
|
||||
GetLightmap()->Raytrace(levelMesh, {});
|
||||
GetLightmap()->Raytrace(surfaces);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -564,12 +563,9 @@ void VulkanRenderDevice::SetLevelMesh(LevelMesh* mesh)
|
|||
|
||||
void VulkanRenderDevice::UpdateLightmaps(const TArray<LevelMeshSurface*>& surfaces)
|
||||
{
|
||||
if (surfaces.Size() > 0)
|
||||
if (surfaces.Size() > 0 && levelMesh)
|
||||
{
|
||||
if (levelMesh)
|
||||
{
|
||||
GetLightmap()->Raytrace(levelMesh, surfaces);
|
||||
}
|
||||
GetLightmap()->Raytrace(surfaces);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue