add external supersampling to animate script
[chaz/rasterize] / config.h
1
2 /*
3 * CS5600 University of Utah
4 * Charles McGarvey
5 * mcgarvey@eng.utah.edu
6 */
7
8 #ifndef _CONFIG_H_
9 #define _CONFIG_H_
10
11 /*
12 * BACKFACE_CULLING
13 * If enabled, triangles that are facing away from the viewer, according to
14 * the right-hand rule and counter-clockwise winding of the verticies, will
15 * not be drawn. This option can improve performance in some situations, but
16 * it may also cause visual problems for models that aren't entirely closed.
17 */
18 #if BACKFACE_CULLING
19 #define IF_BACKFACE_CULLING(X) X
20 #else
21 #define IF_BACKFACE_CULLING(X)
22 #endif
23
24 /*
25 * CLIPPING
26 * If enabled, triangles will be not be drawn if they are entirely outside of
27 * the viewing volume. The number of pixels tested while rasterizing a
28 * triangle can also be minimized, which leads to a huge performance boost.
29 * For that reason, this is on unless explicitly disabled, and you really
30 * always want to leave it enabled. Note that this does not have anything to
31 * do with viewport clipping, which is always performed. Also note that any
32 * triangle which is partially within the viewing volume will be entirely
33 * drawn, which may be somewhat unexpected.
34 */
35 #ifndef CLIPPING
36 #define CLIPPING 1
37 #endif
38 #if CLIPPING
39 #define IF_CLIPPING(X) X
40 #else
41 #define IF_CLIPPING(X)
42 #endif
43
44 /*
45 * DEPTH_TEST
46 * If enabled, a z-buffer will be used to perform some sort of depth testing,
47 * resulting in the generally desirable situation where triangles that are
48 * further away will not appear in front of triangles that are closer. There
49 * is a performance penalty for this, so it must be enabled.
50 */
51 #if DEPTH_TEST
52 #define IF_DEPTH_TEST(X) X
53 #else
54 #define IF_DEPTH_TEST(X)
55 #endif
56
57 /*
58 * DOUBLE_FLOAT
59 * If enabled, scalars will be of type double. This provides and insane level
60 * of precision at a performance cost. The default behavior just uses floats.
61 */
62 #if DOUBLE_FLOAT
63 #define IF_DOUBLE_FLOAT(X) X
64 #else
65 #define IF_DOUBLE_FLOAT(X)
66 #endif
67
68 /*
69 * EXPORT_BMP
70 * If enabled, each scene rasterization will be saved as a BMP image file.
71 * This is on unless explicitly disabled.
72 */
73 #ifndef EXPORT_BMP
74 #define EXPORT_BMP 1
75 #endif
76 #if EXPORT_BMP
77 #define IF_EXPORT_BMP(X) X
78 #else
79 #define IF_EXPORT_BMP(X)
80 #endif
81
82 /*
83 * EXPORT_PPM
84 * If enabled, each scene rasterization will be saved as a PPM image file.
85 * This is on unless explicitly disabled.
86 */
87 #ifndef EXPORT_PPM
88 #define EXPORT_PPM 1
89 #endif
90 #if EXPORT_PPM
91 #define IF_EXPORT_PPM(X) X
92 #else
93 #define IF_EXPORT_PPM(X)
94 #endif
95
96 /*
97 * EXTRA_INLINE
98 * If enabled, functions that are defined in interface files will be marked as
99 * inline. The compiler will generally inline functions according to its own
100 * optimization heuristics, and this inline marking may persuade the compiler
101 * to inline a function that it otherwise would not. This option may bring a
102 * small performance boost, but it can also increase the size of the program
103 * executable.
104 */
105 #if EXTRA_INLINE
106 #define IF_EXTRA_INLINE(X) X
107 #else
108 #define IF_EXTRA_INLINE(X)
109 #endif
110
111 /*
112 * LIGHTING
113 * If enabled, local lighting will be used to increase realism of the scene.
114 * This option has a performance cost, but it can produce interesting visuals.
115 * The behavior of this option is effected by its precise value:
116 * 1 Phong lighting model with flat (per-face) interpolation.
117 * 2 Phong lighting model with Gouraud (per-vertex) interpolation.
118 * 3 Phong lighting model with Phong (per-pixel) interpolation.
119 */
120 #if LIGHTING
121 #define IF_LIGHTING(X) X
122 #else
123 #define IF_LIGHTING(X)
124 #endif
125
126 /*
127 * NDEBUG
128 * If enabled, assertions and other nonessential checks will not be compiled
129 * into the programs.
130 */
131 #if NDEBUG
132 #define IF_NDEBUG(X) X
133 #else
134 #define IF_NDEBUG(X)
135 #endif
136
137 /*
138 * CACHE_GEOMETRY
139 * If enabled, models will be saved to a quick-loading binary format after
140 * they are loaded. Or, if a cached version of a model is discovered when a
141 * model is requested to be loaded, it is loaded from the cache instead. This
142 * provides a decent speed improvement in cases where the model would
143 * otherwise be loaded from some kind of text format which would load slowly.
144 */
145 #if CACHE_GEOMETRY
146 #define IF_CACHE_GEOMETRY(X) X
147 #else
148 #define IF_CACHE_GEOMETRY(X)
149 #endif
150
151 /*
152 * CALC_NORMALS
153 * If enabled, per-vertex normals are calculated for models that don't come
154 * with pre-computed normals. This occurs at loading time. The normals are
155 * calculated by averaging the true normals of all the faces shared by each
156 * vertex. Otherwise, only per-face normals are calculated for such models,
157 * also at loading time.
158 */
159 #if CALC_NORMALS
160 #define IF_CALC_NORMALS(X) X
161 #else
162 #define IF_CALC_NORMALS(X)
163 #endif
164
165 /*
166 * SMOOTH_COLOR
167 * If enabled, color will be interpolated across the face of a triangle.
168 * Otherwise, the color will flat, and the average color of the colors
169 * associated with each vertex will be used.
170 */
171 #if SMOOTH_COLOR
172 #define IF_SMOOTH_COLOR(X) X
173 #else
174 #define IF_SMOOTH_COLOR(X)
175 #endif
176
177 /*
178 * VERBOSITY
179 * If enabled, a description of what is happening will be printed to stdout.
180 * Otherwise, nothing is printed. The behavior of this option is effected by
181 * its precise value:
182 * 1 Print just a few very general descriptions.
183 * 2 After rasterization, also print the triangle count and other
184 * information that may be interesting.
185 * 3 Also print the number of seconds it took to render the entire scene,
186 * according to wall time.
187 * 4 Also print the number of triangles as they are being rastered. This
188 * uses ANSI escape codes which may not be supported on all terminals.
189 * It also causes a lot to be printed, so it can actually decrease render
190 * performance, especially on a slow (or remote) terminal.
191 * The default setting for this option is 3.
192 */
193 #ifndef VERBOSITY
194 #define VERBOSITY 3
195 #endif
196 #if VERBOSITY >= 2
197 #define IF_RASTER_STATS(X) X
198 #else
199 #define IF_RASTER_STATS(X)
200 #endif
201 #if VERBOSITY >= 3
202 #define IF_RENDER_TIMER(X) X
203 #else
204 #define IF_RENDER_TIMER(X)
205 #endif
206 #if VERBOSITY >= 4
207 #define IF_RENDER_PROGRESS(X) X
208 #else
209 #define IF_RENDER_PROGRESS(X)
210 #endif
211
212 #endif // _CONFIG_H_
213
This page took 0.046521 seconds and 4 git commands to generate.