--- libgender/view.C 2004/10/06 01:41:30 1.18 +++ libgender/view.C 2004/10/06 15:57:26 1.28 @@ -1,5 +1,8 @@ #include +#include +#include + #include "oct.h" #include "view.h" @@ -68,13 +71,20 @@ void view::begin () { vismap.clear (); + vislist.clear (); generation++; 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); } @@ -98,8 +108,8 @@ glDepthFunc (GL_LESS); glDisable (GL_LIGHTING); glColorMask (0, 0, 0, 0); - //cgGLDisableProfile (CG_PROFILE_ARBVP1); - cgGLDisableProfile (CG_PROFILE_ARBFP1); + cgGLEnableProfile (vsh_profile);// z-fighting?? + cgGLDisableProfile (fsh_profile); } else { @@ -107,8 +117,8 @@ glDisable (GL_POLYGON_OFFSET_FILL); glDepthFunc (GL_LESS); glDepthMask (0); - cgGLEnableProfile (CG_PROFILE_ARBVP1); - cgGLEnableProfile (CG_PROFILE_ARBFP1); + cgGLEnableProfile (vsh_profile); + cgGLEnableProfile (fsh_profile); } for (vector::iterator i = vislist.begin (); i != vislist.end (); ++i) @@ -116,8 +126,40 @@ drawn.clear (); + if (mode == view::LIGHTED) + { + glEnable (GL_DEPTH_CLAMP_NV); + glDepthFunc (GL_LEQUAL); + glDisable (GL_DEPTH_TEST); + 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); + }