-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
180 lines (147 loc) · 4.76 KB
/
README
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
Raytracer project for the Bachelor Thesis
The thesis can be found here:
http://www.cse.chalmers.se/~uffe/bachelor/kandidatarbetestartpaket/Elumi-a%20ray%20tracer%20-%20DATx02_12_34.pdf
Ohloh project page:
https://www.ohloh.net/p/elumi-raytracer
############################################################
Usage
raytracer [options]
Allowed options:
-h [ --help ] produce help message
--no_opengl Do not use OpenGL
-i [ --input-file ] arg Input file
-o [ --output-file ] arg Output file
-s [ --settings-file ] arg Settings file
############################################################
Scene-file
The scene file uses xml-syntax.
Descriptions:
- PhaseFunction:
type = [isotropic | HG | Schlick]
Example:
<Object fileName="cornell.obj"/>
<Settings fileName="settings.xml"/>
<Camera>
<Position x="0" y="0.717527" z="-2.69957"/>
<Direction x="0" y="0" z="1"/>
<Normal x="0" y="1" z="0"/>
</Camera>
<Light type="Point" intensity="1.5" falloff="Linear" visible="1">
<Position x="5" y="1.2" z="2.9"/>
<Color r="0.5" g="1" b="0.8"/>
</Light>
<Light type="Area" intensity="1.5" falloff="Quadratic" visible="0">
<Position x="0.1" y="1.2" z="0.2"/>
<Color r="1" g="1" b="1"/>
<Axis1 x="0.5" y="0" z="0" samples="3"/>
<Axis2 x="0" y="0" z="0.5" samples="3"/>
</Light>
<Light type="Spot" intensity="2" falloff="Linear" outer="45" inner="40">
<Position x="-1.5" y="1.0" z="2.1"/>
<Direction x="0" y="-1" z="0"/>
<Color r="1" g="1" b="1"/>
</Light>
<Environment type="Cube">
<Top src="land_top.png" />
<Bottom src="land_bottom.png" />
<Front src="land_front.png" />
<Right src="land_right.png" />
<Back src="land_back.png" />
<Left src="land_left.png" />
</Environment>
<Environment type="Sphere">
<Sphere src="data/scenes/textures/angmap24.jpg" />
</Environment>
<Volume type="uniform" attenuation="1.5" emission="1.1">
<PhaseFunction type="isotropic" />
<Position x="0" y="0.75" z="0"/>
<U x="0.25" y="0" z="0"/>
<V x="0" y="0.25" z="0"/>
<W x="0" y="0" z="0.25"/>
</Volume>
############################################################
Settings-file
The settings file uses xml-syntax. See example:
<Screen width="1024" height="1024"/>
<Tracer version="4" pattern="1" batches="auto" first_bounce="0"/>
<Recursion maxDepth="10" attenuationThreshold="0.015625"/>
<Threading threads="auto"/>
<Tonemapping on="1" key="0.18" white="10"/>
<Tree version="3"/>
<Wireframe enable="0"/>
<Supersampling samples="1" pattern="0" />
<Photonmapper photonmap="1" photonmap_size="1024" final_gather_samples="0" photons="65536" radius="0.3" caustics="0.5" scaling="4" kernel="1" />
<Volume step_size="0.1" />
Description:
photonmap:
0 GPU gatherer/arrayPM
1 CPU gatherer/hashPM
2 CPU gatherer/arrayPM
############################################################
mtl-file
Ka 0.01 0.01 0.01 // ambient rgb
Kd 0.1 0.1 0.1 // diffuse rgb
Ks 0.30 0.30 0.30 // specular rgb
Tf 0.10 0.10 0.10 // Transparancy rgb (but only 1 channel used in our impl.)
Ns 200 // Specularity constant
Ni 1.33 // Index of refraction
f 1.33 // Fresnel index (if not used, default is 0)
r_spread 0.05 // Glossy reflection
r_samples 10
Ni_spread 0.05 // Glossy refraction
Ni_samples 10
map_Kd path //Diffuse map
map_Ks path //Specular map
map_Bump path //Bump map. Used for parallax mapping
map_Norm path //Normal map
map_R path //Reflection map
map_D path //Transparency map
axis 0 //Axis x,y, or z (0,1,2)
scale 0.1 //Scale texture (smaller is larger)
projector 0 //Projector function 0,1,2,3 (Plane,cube,sphere,cylinder)
corresponder 0 //Corresponder function 0,1,2,3 (repeat,mirror,clamp,border)
use_position //Use position instead of normal (used mainly for sphere mapping)
relief //Use relief mapping
############################################################
Build instructions (BETA, not tested)
eclipse
* import / projects from git
* new / convert to cpp
* properties
* settings
* GCC C++ compiler
* Includes
* glm
* glfw
* glew
* devil
* Miscellaneous
* -fopenmp
* GCC C++ Linker
* Libraries
* -l (libraries)
* png
* IL (devil)
* ILU (devil manipulations library, used for rotating environment maps)
* boost_program_options
* boost_thread
* boost_chrono
* boost_timer
* boost_system
* GLEW
* # GL
* # GLU
* glfw
* -L (search path)
* glfw
* glew
* devil
* Run/Debug settings
* Edit
* Arguments
* sword2.obj test.png
* Enviroment
* LD_LIBRARY_PATH (separate with ;)
* glfw
* glew
* devil