Commit c62540c7633dc156b9eb1914b24b4888b26b6a3f
1 parent
f85b1b3a
normalization
Showing
1 changed file
with
14 additions
and
13 deletions
Show diff stats
main.cu
... | ... | @@ -182,21 +182,21 @@ void glut_render(void) { |
182 | 182 | glut_render_modelview(); //set up the modelview matrix with camera details |
183 | 183 | glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen |
184 | 184 | GT.glCenterline0(); //render the GT network (the only one loaded) |
185 | + glDisable(GL_DEPTH_TEST); | |
185 | 186 | } |
186 | 187 | |
187 | 188 | if (num_nets == 2) { //if two networks are loaded |
188 | - glEnable(GL_DEPTH_TEST); //enable depth | |
189 | - glut_render_left_projection(); //set up a projection for the left half of the window | |
190 | - glut_render_modelview(); //set up the modelview matrix using camera details | |
191 | - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen | |
192 | - | |
193 | 189 | glEnable(GL_TEXTURE_1D); //enable texture mapping |
194 | - if(light_fac == 0) | |
190 | + if (light_fac == 0) | |
195 | 191 | glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color |
196 | 192 | else |
197 | 193 | glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
198 | - | |
199 | 194 | glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map |
195 | + | |
196 | + glEnable(GL_DEPTH_TEST); //enable depth | |
197 | + glut_render_left_projection(); //set up a projection for the left half of the window | |
198 | + glut_render_modelview(); //set up the modelview matrix using camera details | |
199 | + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen | |
200 | 200 | |
201 | 201 | GT.glCylinder(sigma, radius); //render the GT network |
202 | 202 | if (adjoint_fac == 1) { |
... | ... | @@ -229,17 +229,17 @@ void glut_render(void) { |
229 | 229 | } |
230 | 230 | if (num_nets == 2) { //if two networks are loaded |
231 | 231 | if (compareMode) { |
232 | - glEnable(GL_DEPTH_TEST); //enable depth | |
233 | - glut_render_left_projection(); //set up a projection for the left half of the window | |
234 | - glut_render_modelview(); //set up the modelview matrix using camera details | |
235 | - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen | |
236 | - | |
237 | 232 | glEnable(GL_TEXTURE_1D); //enable texture mapping |
238 | 233 | if (light_fac == 0) |
239 | 234 | glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color |
240 | 235 | else |
241 | 236 | glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);//map light to texture |
242 | 237 | glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map |
238 | + | |
239 | + glEnable(GL_DEPTH_TEST); //enable depth | |
240 | + glut_render_left_projection(); //set up a projection for the left half of the window | |
241 | + glut_render_modelview(); //set up the modelview matrix using camera details | |
242 | + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen | |
243 | 243 | |
244 | 244 | _GT.glCylinder(sigma, radius); //render the GT network |
245 | 245 | if (adjoint_fac == 1) { |
... | ... | @@ -279,6 +279,8 @@ void glut_render(void) { |
279 | 279 | } |
280 | 280 | } |
281 | 281 | } |
282 | + glDisable(GL_DEPTH_TEST); | |
283 | + glDisable(GL_TEXTURE_1D); | |
282 | 284 | |
283 | 285 | if (num_nets == 2) { // works only with two networks |
284 | 286 | std::ostringstream ss; |
... | ... | @@ -287,7 +289,6 @@ void glut_render(void) { |
287 | 289 | else |
288 | 290 | ss << "Compare Mode"; // default mode is compare mode |
289 | 291 | |
290 | - glDisable(GL_TEXTURE_1D); | |
291 | 292 | if (light_fac == 1) |
292 | 293 | glDisable(GL_LIGHTING); |
293 | 294 | glMatrixMode(GL_PROJECTION); // set up the 2d viewport for mode text printing | ... | ... |