erebus

view liberebus/src/erebus_impl.h @ 31:53a98c148bf8

- introduced SurfaceGeometry to carry all the geometric information input to BRDF sampling and evaluation functions. - made Reflectance keep an (optional) pointer to its material - simplified PhongRefl::sample_dir, with the help of SurfaceGeometry - worked around microsoft's broken std::thread implementation's deadlock on join
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 07 Jun 2014 09:14:17 +0300
parents c8a6fb04fefa
children 9d6368850fe1
line source
1 #ifndef EREBUS_IMPL_H_
2 #define EREBUS_IMPL_H_
4 #include <vector>
5 #include <vmath/vmath.h>
6 #include "erebus.h"
7 #include "image.h"
8 #include "scene.h"
9 #include "threadpool.h"
11 struct Option {
12 enum Type { INT, FLOAT, VEC } type;
13 int ival;
14 float fval;
15 Vector4 vval;
16 };
18 struct Block {
19 int x, y, width, height;
20 int sample;
21 int frame;
22 };
24 struct erebus {
25 Scene *scn;
27 Image<float> fbimg;
28 Image<float> accum; // sample accumulator per pixel
29 Option options[ERB_NUM_OPTIONS];
31 ThreadPool *tpool;
33 // render state
34 float inv_gamma;
35 long cur_time;
36 int cur_sample;
37 int cur_frame;
39 // interactive input
40 std::vector<bool> keystate;
41 std::vector<bool> bnstate;
42 int mouse_pos[2];
44 // debugging stuff
45 int dbg_nodesel;
46 };
48 float randf(float low = 0.0f, float high = 1.0f);
50 #endif // EREBUS_IMPL_H_