ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/view.C
(Generate patch)

Comparing libgender/view.C (file contents):
Revision 1.49 by root, Mon Oct 11 15:26:34 2004 UTC vs.
Revision 1.50 by root, Thu Oct 14 19:54:14 2004 UTC

116} 116}
117 117
118void view::begin () 118void view::begin ()
119{ 119{
120 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 120 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
121 glDepthRange (0, 1. - (1. / pow (2., 16.)));
122 121
123 vislist.clear (); 122 vislist.clear ();
124 123
125 generation++; 124 generation++;
126 125
151 150
152void view::end () 151void view::end ()
153{ 152{
154 vislist.clear (); 153 vislist.clear ();
155} 154}
155
156#define DEPTH_OFFSET (1. / (GLdouble)(1L << 16))
156 157
157void view::pass (enum mode m) 158void view::pass (enum mode m)
158{ 159{
159 mode = m; 160 mode = m;
160 161
162 glDisable (GL_BLEND); 163 glDisable (GL_BLEND);
163 //glDisable (GL_DEPTH_TEST); 164 //glDisable (GL_DEPTH_TEST);
164 165
165 if (mode == view::DEPTH) 166 if (mode == view::DEPTH)
166 { 167 {
167 glEnable (GL_POLYGON_OFFSET_FILL); 168 //glEnable (GL_POLYGON_OFFSET_FILL);
168 glPolygonOffset (0, 5); 169 //glPolygonOffset (0, 5);
170 glDepthRange (DEPTH_OFFSET, 1.);
169 glDepthFunc (GL_LESS); 171 glDepthFunc (GL_LESS);
170 glDisable (GL_LIGHTING); 172 glDisable (GL_LIGHTING);
171 glColorMask (0, 0, 0, 0); 173 glColorMask (0, 0, 0, 0);
172 //cgGLDisableProfile (vsh_profile);// z-fighting??
173 //cgGLDisableProfile (fsh_profile);
174 } 174 }
175 else 175 else
176 { 176 {
177 glEnable (GL_MINMAX); 177 glEnable (GL_MINMAX);
178 glDisable (GL_POLYGON_OFFSET_FILL); 178 //glDisable (GL_POLYGON_OFFSET_FILL);
179 glDepthRange (0., 1. - DEPTH_OFFSET);
179 glDepthFunc (GL_LESS); 180 glDepthFunc (GL_LESS);
180 glDepthMask (0); 181 glDepthMask (0);
181 //cgGLEnableProfile (vsh_profile);
182 //cgGLEnableProfile (fsh_profile);
183 } 182 }
184 183
185 for (vector<octant *>::iterator i = vislist.begin (); i != vislist.end (); ++i) 184 for (vector<octant *>::iterator i = vislist.begin (); i != vislist.end (); ++i)
186 { 185 {
187 octant *o = *i; 186 octant *o = *i;
226 glDisable (GL_DEPTH_CLAMP_NV); 225 glDisable (GL_DEPTH_CLAMP_NV);
227 } 226 }
228 227
229 glColorMask (1, 1, 1, 0); 228 glColorMask (1, 1, 1, 0);
230 glDepthMask (1); 229 glDepthMask (1);
231
232} 230}
233 231
234 232

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines