Remove smoothing groups from vk_lightmap and fix some warnings

This commit is contained in:
Magnus Norddahl 2023-09-25 20:35:34 +02:00
commit fae22f1bb7
4 changed files with 33 additions and 32 deletions

View file

@ -186,19 +186,6 @@ void VkLightmap::Render()
bool buffersFull = false;
if (targetSurface->tileSurfaces.Size() == 0) // To do: move this to where we set up the smoothing groups as we don't need the groups after this step
{
for (LevelMeshSurface* surface : mesh->SmoothingGroups[targetSurface->smoothingGroupIndex].surfaces)
{
FVector2 minUV = ToUV(surface->bounds.min, targetSurface);
FVector2 maxUV = ToUV(surface->bounds.max, targetSurface);
if (surface != targetSurface && (maxUV.X < 0.0f || maxUV.Y < 0.0f || minUV.X > 1.0f || minUV.Y > 1.0f))
continue; // Bounding box not visible
targetSurface->tileSurfaces.Push(surface);
}
}
// Paint all surfaces visible in the tile
for (LevelMeshSurface* surface : targetSurface->tileSurfaces)
{
@ -528,14 +515,6 @@ void VkLightmap::CopyResult()
fb->GetCommands()->PopGroup(cmdbuffer);
}
FVector2 VkLightmap::ToUV(const FVector3& vert, const LevelMeshSurface* targetSurface)
{
FVector3 localPos = vert - targetSurface->translateWorldToLocal;
float u = (1.0f + (localPos | targetSurface->projLocalToU)) / (targetSurface->texWidth + 2);
float v = (1.0f + (localPos | targetSurface->projLocalToV)) / (targetSurface->texHeight + 2);
return FVector2(u, v);
}
void VkLightmap::CreateShaders()
{
std::string prefix = "#version 460\r\n";