WIP fake raytracer output

This commit is contained in:
RaveYard 2023-08-31 20:06:13 +02:00 committed by Magnus Norddahl
commit ef031c2073
4 changed files with 32 additions and 4 deletions

View file

@ -481,8 +481,8 @@ void VulkanRenderDevice::InitLightmap(int LMTextureSize, int LMTextureCount, TAr
{
Printf("Running VkLightmap.\n");
VkLightmap lightmap(this);
lightmap.Raytrace(&mesh);
//VkLightmap lightmap(this);
//lightmap.Raytrace(&mesh);
Printf("Copying data.\n");
@ -490,6 +490,10 @@ void VulkanRenderDevice::InitLightmap(int LMTextureSize, int LMTextureCount, TAr
auto clamp = [](float a, float min, float max) -> float { return a < min ? min : a > max ? max : a; };
std::sort(mesh.surfaces.begin(), mesh.surfaces.end(), [](const std::unique_ptr<hwrenderer::Surface>& a, const std::unique_ptr<hwrenderer::Surface>& b) { return a->texHeight != b->texHeight ? a->texHeight > b->texHeight : a->texWidth > b->texWidth; });
RectPacker packer(LMTextureSize, LMTextureSize);
for (auto& surface : mesh.surfaces)