Path Tracing
Loading...
Searching...
No Matches
config.hpp File Reference
#include "gl/program.hpp"
#include "debug.hpp"
#include <string>
#include <vector>
#include <filesystem>
#include <glm/glm.hpp>
#include <GL/glew.h>
#include <atomic>
#include <glm/gtc/matrix_transform.hpp>
Include dependency graph for config.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SceneModel
struct  RenderConfig
struct  Renderer
struct  CameraConfig
struct  AspectRatioOption
 Aspect-ratio crop preview/screenshot options. More...
struct  LensPreset

Functions

glm::vec3 toneMapCPU (glm::vec3 color, int tone_mapping)
 CPU-side tone mapping, mirrors display frag's toneMap(), so screenshots match what's shown in render output, and not an estimation.
float camFovCap (int projection_mode)
 Max FOV for a projection mode.
int lensPresetCount ()
 Number of presets currently visible depending on debug mode.
const LensPreset & lensPresetAt (int idx)
 Maps a combined UI index to the exact preset, regardless of debug flag.

Variables

int WINDOW_WIDTH = 1280
 Program window resolution.
int WINDOW_HEIGHT = 720
bool is_fullscreen = false
int windowed_x = 100
int windowed_y = 100
int windowed_w = 1280
int windowed_h = 720
const bool USE_COMPUTE_SH = true
std::string screenshot_msg = ""
double screenshot_msg_time = 0.0
const int TM_NONE = 0
const int TM_REINHARD = 1
const int TM_ACES = 2
const int TM_FILMIC = 3
const AspectRatioOption ASPECT_RATIOS []
const int ASPECT_RATIO_COUNT = sizeof(ASPECT_RATIOS) / sizeof(ASPECT_RATIOS[0])
const char * COMPOSITION_GUIDE_NAMES []
const int COMPOSITION_GUIDE_COUNT = sizeof(COMPOSITION_GUIDE_NAMES) / sizeof(COMPOSITION_GUIDE_NAMES[0])
const int PROJ_RECTILINEAR = 0
const int PROJ_FISHEYE_EQUIDISTANT = 1
const int PROJ_FISHEYE_STEREOGRAPHIC = 2
const int PROJ_FISHEYE_EQUISOLID = 3
const char * CAM_PROJECTION_NAMES []
const int CAM_PROJECTION_COUNT = sizeof(CAM_PROJECTION_NAMES) / sizeof(CAM_PROJECTION_NAMES[0])
const LensPreset LENS_PRESETS []
const int LENS_PRESET_COUNT = sizeof(LENS_PRESETS) / sizeof(LENS_PRESETS[0])
const LensPreset LENS_TEST_PRESETS []
const int LENS_TEST_PRESET_COUNT = sizeof(LENS_TEST_PRESETS) / sizeof(LENS_TEST_PRESETS[0])

Function Documentation

◆ camFovCap()

float camFovCap ( int projection_mode)
inline

Max FOV for a projection mode.

◆ lensPresetAt()

const LensPreset & lensPresetAt ( int idx)
inline

Maps a combined UI index to the exact preset, regardless of debug flag.

◆ lensPresetCount()

int lensPresetCount ( )
inline

Number of presets currently visible depending on debug mode.

◆ toneMapCPU()

glm::vec3 toneMapCPU ( glm::vec3 color,
int tone_mapping )
inline

CPU-side tone mapping, mirrors display frag's toneMap(), so screenshots match what's shown in render output, and not an estimation.

See also
display.frag, saveScreenshot

Variable Documentation

◆ ASPECT_RATIO_COUNT

const int ASPECT_RATIO_COUNT = sizeof(ASPECT_RATIOS) / sizeof(ASPECT_RATIOS[0])

◆ ASPECT_RATIOS

const AspectRatioOption ASPECT_RATIOS[]
Initial value:
= {
{"Off", 0.0f},
{"1:1 Square", 1.0f},
{"4:5 Portrait", 4.0f/5.0f},
{"5:4", 5.0f/4.0f},
{"3:2 Photo", 3.0f/2.0f},
{"4:3", 4.0f/3.0f},
{"16:9 Widescreen", 16.0f/9.0f},
{"1.85:1 Cinema", 1.85f},
{"2.35:1 Cinemascope", 2.35f}
}

◆ CAM_PROJECTION_COUNT

const int CAM_PROJECTION_COUNT = sizeof(CAM_PROJECTION_NAMES) / sizeof(CAM_PROJECTION_NAMES[0])

◆ CAM_PROJECTION_NAMES

const char* CAM_PROJECTION_NAMES[]
inline
Initial value:
= {
"Rectilinear", "Fisheye (Equidistant)", "Fisheye (Stereographic)", "Fisheye (Equisolid)"
}

Names for the lens projection dropdown, indexed by config.cam_projection_mode

Note
must stay synced with PROJ_* constants in globals.glsl

◆ COMPOSITION_GUIDE_COUNT

const int COMPOSITION_GUIDE_COUNT = sizeof(COMPOSITION_GUIDE_NAMES) / sizeof(COMPOSITION_GUIDE_NAMES[0])

◆ COMPOSITION_GUIDE_NAMES

const char* COMPOSITION_GUIDE_NAMES[]
inline
Initial value:
= {
"Off", "Rule of Thirds", "Golden Ratio", "Center Cross", "Diagonal"
}

Names for the compositions dropdown, indexed by renderer.composition_guide

See also
drawCompositionGuides

◆ is_fullscreen

bool is_fullscreen = false
inline

◆ LENS_PRESET_COUNT

const int LENS_PRESET_COUNT = sizeof(LENS_PRESETS) / sizeof(LENS_PRESETS[0])

◆ LENS_PRESETS

const LensPreset LENS_PRESETS[]
Note
Applies fov/aperture too, so every preset is visible immediately without having to separately enable DoF or widen the FOV by hand.

◆ LENS_TEST_PRESET_COUNT

const int LENS_TEST_PRESET_COUNT = sizeof(LENS_TEST_PRESETS) / sizeof(LENS_TEST_PRESETS[0])

◆ LENS_TEST_PRESETS

const LensPreset LENS_TEST_PRESETS[]
Initial value:
= {
{"Test: Lateral CA",
"Pinhole so only lateral CA shows - fringing at the corners, clean at center",
80.0f, 0.00f, 0, 0.0f, 1.0f, 0.00f, 0.00f, 0.00f, PROJ_RECTILINEAR, 0.0f, 0.030f, 0.000f},
{"Test: Axial CA (Bokeh Fringe)",
"DOF on, only axial CA - color fringing on out-of-focus highlights",
60.0f, 0.15f, 0, 0.0f, 1.0f, 0.00f, 0.00f, 0.00f, PROJ_RECTILINEAR, 0.0f, 0.000f, 0.030f},
{"Test: Hexagonal Bokeh",
"6-blade aperture - look at out-of-focus highlights",
60.0f, 0.15f, 6, 0.0f, 1.0f, 0.00f, 0.00f, 0.00f, PROJ_RECTILINEAR, 0.0f, 0.000f, 0.000f},
{"Test: Barrel Distortion",
"Pinhole, wide FOV - straight lines bow outward",
90.0f, 0.00f, 0, 0.0f, 1.0f, 0.00f, -0.25f, 0.00f, PROJ_RECTILINEAR, 0.0f, 0.000f, 0.000f},
{"Test: Pincushion Distortion",
"Pinhole - straight lines pinch inward",
60.0f, 0.00f, 0, 0.0f, 1.0f, 0.00f, 0.25f, 0.00f, PROJ_RECTILINEAR, 0.0f, 0.000f, 0.000f},
}
const int PROJ_RECTILINEAR
Definition globals.glsl:93

Isolated single-feature tests, dev-only. Each isolates exactly one parameter so its effect is easy to read in isolation - hidden from end users.

◆ PROJ_FISHEYE_EQUIDISTANT

const int PROJ_FISHEYE_EQUIDISTANT = 1

◆ PROJ_FISHEYE_EQUISOLID

const int PROJ_FISHEYE_EQUISOLID = 3

◆ PROJ_FISHEYE_STEREOGRAPHIC

const int PROJ_FISHEYE_STEREOGRAPHIC = 2

◆ PROJ_RECTILINEAR

const int PROJ_RECTILINEAR = 0
Note
must stay synced with PROJ_* consts in globals.glsl

◆ screenshot_msg

std::string screenshot_msg = ""
inline

◆ screenshot_msg_time

double screenshot_msg_time = 0.0
inline

◆ TM_ACES

const int TM_ACES = 2

◆ TM_FILMIC

const int TM_FILMIC = 3

◆ TM_NONE

const int TM_NONE = 0
Note
must stay synced with TONE_MAPPING consts in globals.glsl

◆ TM_REINHARD

const int TM_REINHARD = 1

◆ USE_COMPUTE_SH

const bool USE_COMPUTE_SH = true

Switches between using fragment or compute shaders for the path tracer

Note
false = fragment; true = compute

◆ WINDOW_HEIGHT

int WINDOW_HEIGHT = 720

◆ WINDOW_WIDTH

int WINDOW_WIDTH = 1280
inline

Program window resolution.

◆ windowed_h

int windowed_h = 720

◆ windowed_w

int windowed_w = 1280
inline

◆ windowed_x

int windowed_x = 100
inline

◆ windowed_y

int windowed_y = 100