… | |
… | |
73 | generation++; |
73 | generation++; |
74 | |
74 | |
75 | reset_projection (); |
75 | reset_projection (); |
76 | |
76 | |
77 | // check occlusion queries here |
77 | // check occlusion queries here |
|
|
78 | #if 0 |
78 | for (vector<octant *>::iterator i = checklist.begin (); i != checklist.end (); ++i) |
79 | for (vector<octant *>::iterator i = checklist.begin (); i != checklist.end (); ++i) |
79 | //printf ("%p %d\n", *i, occ_query_result ((*i)->occ_query)); |
80 | //printf ("%p %d\n", *i, occ_query_result ((*i)->occ_query)); |
80 | occ_query_result ((*i)->occ_query); |
81 | occ_query_result ((*i)->occ_query); |
81 | |
82 | |
82 | checklist.clear (); |
83 | checklist.clear (); |
|
|
84 | #endif |
83 | |
85 | |
84 | world.detect_visibility (*this); |
86 | world.detect_visibility (*this); |
85 | } |
87 | } |
86 | |
88 | |
87 | void view::end () |
89 | void view::end () |
… | |
… | |
101 | glEnable (GL_POLYGON_OFFSET_FILL); |
103 | glEnable (GL_POLYGON_OFFSET_FILL); |
102 | glPolygonOffset (0, 1); |
104 | glPolygonOffset (0, 1); |
103 | glDepthFunc (GL_LESS); |
105 | glDepthFunc (GL_LESS); |
104 | glDisable (GL_LIGHTING); |
106 | glDisable (GL_LIGHTING); |
105 | glColorMask (0, 0, 0, 0); |
107 | glColorMask (0, 0, 0, 0); |
106 | //cgGLDisableProfile (vsh_profile); |
108 | cgGLEnableProfile (vsh_profile);// z-fighting?? |
107 | cgGLDisableProfile (fsh_profile); |
109 | cgGLDisableProfile (fsh_profile); |
108 | } |
110 | } |
109 | else |
111 | else |
110 | { |
112 | { |
111 | #if 0 |
|
|
112 | glEnable (GL_MINMAX); |
113 | glEnable (GL_MINMAX); |
113 | #endif |
|
|
114 | glDisable (GL_POLYGON_OFFSET_FILL); |
114 | glDisable (GL_POLYGON_OFFSET_FILL); |
115 | glDepthFunc (GL_LESS); |
115 | glDepthFunc (GL_LESS); |
116 | glDepthMask (0); |
116 | glDepthMask (0); |
117 | cgGLEnableProfile (vsh_profile); |
117 | cgGLEnableProfile (vsh_profile); |
118 | cgGLEnableProfile (fsh_profile); |
118 | cgGLEnableProfile (fsh_profile); |
… | |
… | |
121 | for (vector<octant *>::iterator i = vislist.begin (); i != vislist.end (); ++i) |
121 | for (vector<octant *>::iterator i = vislist.begin (); i != vislist.end (); ++i) |
122 | (*i)->display (*this); |
122 | (*i)->display (*this); |
123 | |
123 | |
124 | drawn.clear (); |
124 | drawn.clear (); |
125 | |
125 | |
|
|
126 | if (mode == view::DEPTH) |
|
|
127 | { |
|
|
128 | static int count; count++; |
|
|
129 | if (farlist.size ()) |
|
|
130 | printf ("%d: size %d\n", count, farlist.size ()); |
|
|
131 | |
|
|
132 | glDepthFunc (GL_LEQUAL); |
|
|
133 | for (vector<octant *>::iterator i = farlist.begin (); i != farlist.end (); ++i) |
|
|
134 | (*i)->draw_bbox (*this); |
|
|
135 | |
|
|
136 | farlist.clear (); |
|
|
137 | } |
|
|
138 | |
126 | glColorMask (1, 1, 1, 0); |
139 | glColorMask (1, 1, 1, 0); |
127 | glDepthMask (1); |
140 | glDepthMask (1); |
128 | } |
141 | } |
129 | |
142 | |
130 | |
143 | |