From 5bb277ff31a1fbe24a12ad534b437d3e6c2d7a2c Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Wed, 15 Jun 2022 14:42:02 +0800 Subject: [PATCH] Disable light bounces for now, after some internal discussion pertaining to future improvements --- src/level/level_light.cpp | 6 ++++-- src/lightmap/cpuraytracer.cpp | 5 +++-- src/lightmap/gpuraytracer.cpp | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/level/level_light.cpp b/src/level/level_light.cpp index f4f3287..f21d467 100644 --- a/src/level/level_light.cpp +++ b/src/level/level_light.cpp @@ -88,7 +88,7 @@ void FLevel::SetupLights() defaultSunColor = vec3(1, 1, 1); defaultSunDirection = vec3(0.45f, 0.3f, 0.9f); Samples = 8; - LightBounce = 1; + LightBounce = 0; GridSize = 32.0f; for (int i = 0; i < (int)Things.Size(); ++i) @@ -132,10 +132,12 @@ void FLevel::SetupLights() if (Samples > 128) Samples = 128; Samples = Math::RoundPowerOfTwo(Samples); - // number of light bounces + /* + // number of light bounces (temporarily disabled) LightBounce = thing->args[2]; if (LightBounce < 0) LightBounce = 0; if (LightBounce > 8) LightBounce = 8; + */ // auto probe grid size GridSize = thing->args[3] ? thing->args[3] : 64.0f; diff --git a/src/lightmap/cpuraytracer.cpp b/src/lightmap/cpuraytracer.cpp index d831b34..b31a8e3 100644 --- a/src/lightmap/cpuraytracer.cpp +++ b/src/lightmap/cpuraytracer.cpp @@ -60,11 +60,12 @@ void CPURaytracer::Raytrace(LevelMesh* level) CreateHemisphereVectors(); CreateLights(); - printf("Ray tracing with %d bounce(s)\n", mesh->map->LightBounce); + //printf("Ray tracing with %d bounce(s)\n", mesh->map->LightBounce); + printf("Ray tracing in progress...\n"); RunJob((int)tasks.size(), [=](int id) { RaytraceTask(tasks[id]); }); - printf("\nRaytrace complete\n"); + printf("\nRay tracing complete\n"); } void CPURaytracer::RaytraceTask(const CPUTraceTask& task) diff --git a/src/lightmap/gpuraytracer.cpp b/src/lightmap/gpuraytracer.cpp index 9aa7131..495f308 100644 --- a/src/lightmap/gpuraytracer.cpp +++ b/src/lightmap/gpuraytracer.cpp @@ -90,7 +90,8 @@ void GPURaytracer::Raytrace(LevelMesh* level) HemisphereVectors.push_back(H); } - printf("Ray tracing with %d bounce(s)\n", mesh->map->LightBounce); + //printf("Ray tracing with %d bounce(s)\n", mesh->map->LightBounce); + printf("Ray tracing in progress...\n"); RunWithProgressDots([&]() { size_t maxTasks = (size_t)rayTraceImageSize * rayTraceImageSize; @@ -149,7 +150,7 @@ void GPURaytracer::Raytrace(LevelMesh* level) if (device->renderdoc) device->renderdoc->EndFrameCapture(0, 0); - printf("Raytrace complete\n"); + printf("Ray trace complete\n"); } void GPURaytracer::CreateVulkanObjects()