Merge pull request #43 from MrRaveYard/pr_preview_switch

Add --preview switch that significantly reduces sample count
This commit is contained in:
Magnus Norddahl 2022-07-06 14:31:20 +02:00 committed by GitHub
commit 9b510f3e84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 7 deletions

View file

@ -17,6 +17,9 @@
extern bool VKDebug;
extern int NumThreads;
extern int coverageSampleCount;
extern int bounceSampleCount;
CPURaytracer::CPURaytracer()
{
}

View file

@ -92,9 +92,6 @@ private:
static void RunJob(int count, std::function<void(int i)> callback);
const int coverageSampleCount = 256;
const int bounceSampleCount = 2048;
LevelMesh* mesh = nullptr;
std::vector<vec3> HemisphereVectors;
std::vector<CPULightInfo> Lights;

View file

@ -29,6 +29,10 @@
extern bool VKDebug;
extern int coverageSampleCount;
extern int bounceSampleCount;
extern int ambientSampleCount;
GPURaytracer::GPURaytracer()
{
device = std::make_unique<VulkanDevice>(0, VKDebug);

View file

@ -90,9 +90,6 @@ private:
static float RadicalInverse_VdC(uint32_t bits);
static vec2 Hammersley(uint32_t i, uint32_t N);
const int coverageSampleCount = 256;
const int bounceSampleCount = 2048;
const int ambientSampleCount = 2048;
int rayTraceImageSize = 1024;
LevelMesh* mesh = nullptr;

View file

@ -119,6 +119,10 @@ bool CPURaytrace = false;
bool VKDebug = false;
bool DumpMesh = false;
int coverageSampleCount = 256;
int bounceSampleCount = 2048;
int ambientSampleCount = 2048;
// PRIVATE DATA DEFINITIONS ------------------------------------------------
static option long_opts[] =
@ -157,10 +161,11 @@ static option long_opts[] =
{"cpu-raytrace", no_argument, 0, 'C'},
{"vkdebug", no_argument, 0, 'D'},
{"dump-mesh", no_argument, 0, 1004},
{"preview", no_argument, 0, 1005},
{0,0,0,0}
};
static const char short_opts[] = "wVgGvbNrReEm:o:f:p:s:d:PqtzZXx5cj:S:CD:";
static const char short_opts[] = "wVgGvbNrReEm:o:f:p:s:d:PqtzZXx5cj:S:CD::";
// CODE --------------------------------------------------------------------
@ -457,6 +462,11 @@ static void ParseArgs(int argc, char **argv)
case 1004:
DumpMesh = true;
break;
case 1005:
coverageSampleCount = 4;
bounceSampleCount = 16;
ambientSampleCount = 16;
break;
case 1000:
ShowUsage();
exit(0);