Exported constants to their own file

This commit is contained in:
Martin Opat 2024-12-30 09:48:27 +01:00
parent daf19578e7
commit 8f23b7edec
2 changed files with 15 additions and 10 deletions

14
src/consts.h Normal file
View File

@ -0,0 +1,14 @@
#ifndef CONSTS_H
#define CONSTS_H
// TODO: Eventually, export this into a better place (i.e., such that we do not have to recompile every time we change a parameter)
const int VOLUME_WIDTH = 49;
const int VOLUME_HEIGHT = 51;
const int VOLUME_DEPTH = 42;
const int IMAGE_WIDTH = 2560;
const int IMAGE_HEIGHT = 1440;
const int SAMPLES_PER_PIXEL = 8; // TODO: Right now uses simple variance, consider using something more advanced (e.g., some commonly-used noise map)
#endif // CONSTS_H

View File

@ -9,16 +9,7 @@
#include "linalg/linalg.h"
#include "objs/sphere.h"
#include "img/handler.h"
// TODO: Eventually, export this into a better place (i.e., such that we do not have to recompile every time we change a parameter)
static const int VOLUME_WIDTH = 49;
static const int VOLUME_HEIGHT = 51;
static const int VOLUME_DEPTH = 42;
static const int IMAGE_WIDTH = 2560;
static const int IMAGE_HEIGHT = 1440;
static const int SAMPLES_PER_PIXEL = 8; // TODO: Right now uses simple variance, consider using something more advanced (e.g., some commonly-used noise map)
#include "consts.h"
__constant__ int d_volumeWidth;