-
Notifications
You must be signed in to change notification settings - Fork 0
/
params.h
96 lines (79 loc) · 2.66 KB
/
params.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#ifndef __PARAMS_H__
#define __PARAMS_H__
#include <string>
#include "Eigen/Dense"
using namespace Eigen;
bool parseGeometry(char *p, int *w, int *h);
bool isInt(std::string s);
void printHelp();
const double FOVY=M_PI/2.0;
enum FType {mandelbulb, mengersponge};
class Params {
public:
Params() :
width(240), height(180), gs(6), fractal_type(mengersponge),
max_iterations(100), eps(1e-8), bulb_power(8), max_steps(250),
min_distance(0.001), bailout(2.0), far(15.0), zoom(1.0),
camera_pos(0.0, 0.0, 4.0),
camera_yaw(M_PI), camera_pitch(0.0), camera_roll(0.0),
world_yaw(0.0), world_pitch(0), world_roll(0.0),
alias_size(2),
light{Vector3d(3,2,3), Vector3d(4.0, 0.0, 1.05)},
light_en{true, false}, floor_col(0.2,0.5,0.2),
bg_col(1.0,1.0,1.0), fog_dist(0.4), ao_en(false),
shadow_en(false), orbit_en(false), phong_en(true),
reflect_en(false), fog_en(false), torch_en(true),
alias_en(false), alias_random_en(false),
dynamic_DE_thd(true),
display_params(false), font_size(12) {};
bool parseCmdline(int argc, char **argv);
bool saveOutput() { return !outfile.empty(); }
void saveParams();
void loadParams(bool next, bool interpolated);
std::string toString();
void setFileCounters(int keyframe_counter, int config_counter);
int width, height; // image resolution
int gs; // interleave grid step
std::string outfile;
std::string configfile;
bool preview_mode;
enum FType fractal_type;
int max_iterations;
double eps;
int bulb_power;
int max_steps; // maximum ray-marching steps
double min_distance; // minimum distance to surface
double last_distance;
double bailout;
double far; // far clipping plane
double zoom;
Vector3d camera_pos;
double camera_yaw;
double camera_pitch;
double camera_roll;
double world_yaw;
double world_pitch;
double world_roll;
int alias_size;
Matrix3d m_wld;
Matrix3d m_cam;
Vector3d light[2]; // array with lights
bool light_en[2]; // enable light
Vector3d floor_col; // floor color
Vector3d bg_col; // background color
double fog_dist; // fog distance
bool ao_en; // enable ambient occlusion
bool shadow_en; // enable soft shadow
bool orbit_en; // enable orbit trap coloring
bool phong_en; // enable blinn-phong shading
bool reflect_en; // enable reflection (by secondary rays)
bool fog_en; // enable fog
bool torch_en; // enable light from camera position
bool alias_en; // enable aa
bool alias_random_en; // enable random aa
bool dynamic_DE_thd;
bool display_params;
int font_size;
double avg_stepcount;
};
#endif