--- libgender/view.C 2004/10/06 05:24:03 1.23 +++ libgender/view.C 2004/10/06 15:57:51 1.29 @@ -1,5 +1,8 @@ #include +#include +#include + #include "oct.h" #include "view.h" @@ -75,11 +78,13 @@ reset_projection (); // check occlusion queries here +#if 0 for (vector::iterator i = checklist.begin (); i != checklist.end (); ++i) //printf ("%p %d\n", *i, occ_query_result ((*i)->occ_query)); occ_query_result ((*i)->occ_query); checklist.clear (); +#endif world.detect_visibility (*this); } @@ -103,14 +108,12 @@ glDepthFunc (GL_LESS); glDisable (GL_LIGHTING); glColorMask (0, 0, 0, 0); - //cgGLDisableProfile (vsh_profile); + cgGLEnableProfile (vsh_profile);// z-fighting?? cgGLDisableProfile (fsh_profile); } else { -#if 0 glEnable (GL_MINMAX); -#endif glDisable (GL_POLYGON_OFFSET_FILL); glDepthFunc (GL_LESS); glDepthMask (0); @@ -123,8 +126,39 @@ drawn.clear (); + if (mode == view::LIGHTED) + { + glEnable (GL_DEPTH_CLAMP_NV); + glDepthFunc (GL_LEQUAL); + glEnable (GL_COLOR_MATERIAL); + glDisable (GL_CULL_FACE); +#if 0 + cgGLDisableProfile (vsh_profile); + cgGLDisableProfile (fsh_profile); +#endif + glShadeModel (GL_FLAT); + GLfloat m[4] = { 1, 0, 1, 0 }; + glColor3f (1, 0, 1); + //glMaterialfv (GL_FRONT_AND_BACK, GL_AMBIENT, m); + //glLightModelfv (GL_LIGHT_MODEL_AMBIENT, m); + + static int count; count++; + if (farlist.size ()) + printf ("%d: size %d\n", count, farlist.size ()); + + for (vector::iterator i = farlist.begin (); i != farlist.end (); ++i) + (*i)->draw_bbox (*this); + + farlist.clear (); + + glEnable (GL_DEPTH_TEST); + glDisable (GL_DEPTH_CLAMP_NV); + glShadeModel (GL_SMOOTH); + } + glColorMask (1, 1, 1, 0); glDepthMask (1); + }