Remove awful hardcoded byte offset hack

This commit is contained in:
RaveYard 2023-09-10 23:24:00 +02:00 committed by Magnus Norddahl
commit 5912a2c30b
7 changed files with 10 additions and 10 deletions

View file

@ -230,7 +230,7 @@ void VkLightmap::RenderAtlasImage(size_t pageIndex, const TArray<LevelMeshSurfac
LightmapPushConstants pc;
pc.LightStart = firstLight;
pc.LightEnd = firstLight + lightCount;
pc.SurfaceIndex = (int32_t)std::distance((char*)mesh->GetSurface(0), (char*)targetSurface) / 288;
pc.SurfaceIndex = mesh->GetSurfaceIndex(targetSurface);
pc.LightmapOrigin = targetSurface->worldOrigin - targetSurface->worldStepX - targetSurface->worldStepY;
pc.LightmapStepX = targetSurface->worldStepX * viewport.width;
pc.LightmapStepY = targetSurface->worldStepY * viewport.height;