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

Comparing libgender/view.C (file contents):
Revision 1.59 by root, Mon Oct 18 12:01:14 2004 UTC vs.
Revision 1.60 by root, Mon Oct 18 12:24:29 2004 UTC

39 39
40 return count; 40 return count;
41} 41}
42 42
43view::view () 43view::view ()
44: gamma(1.0) 44: gamma(1.0), nz_near (1.F), nz_far (2.F)
45{ 45{
46} 46}
47 47
48view::~view () 48view::~view ()
49{ 49{
170 glDepthMask (1); 170 glDepthMask (1);
171 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 171 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
172 172
173 vislist.clear (); 173 vislist.clear ();
174 174
175 z_far = nz_far; 175 z_near = max (nz_near, 1.F);
176 z_far = max (nz_far, z_near * 2.F);
176 c_far = nc_far; 177 c_far = nc_far;
177 178
178 if (z_far < z_near)
179 z_far = z_near * 2.;
180
181 reset_projection (); 179 reset_projection ();
182 180
181 nz_near = 1e37;
183 nc_far = nz_far = z_near + 1.F; 182 nc_far = nz_far = 1.F;
184} 183}
185 184
186void view::end () 185void view::end ()
187{ 186{
188 vislist.clear (); 187 vislist.clear ();
207 glDepthMask (1); 206 glDepthMask (1);
208 glDisable (GL_DEPTH_CLAMP_NV); 207 glDisable (GL_DEPTH_CLAMP_NV);
209 208
210 world.depth_pass (*this); 209 world.depth_pass (*this);
211 210
212 printf ("fps %f far %f cf %f vis %d CAM (%d,%d,%d)\n", timer.fps, z_far, c_far, drawn.size (), orig.x, orig.y, orig.z);//D 211 printf ("fps %f NF %f:%f vis %d CAM (%d,%d,%d)\n", timer.fps, z_near, z_far, drawn.size (), orig.x, orig.y, orig.z);//D
213 break; 212 break;
214 213
215 case POSTDEPTH: 214 case POSTDEPTH:
216 glDepthRange (0., 1. - DEPTH_OFFSET); 215 glDepthRange (0., 1. - DEPTH_OFFSET);
217 glDepthFunc (GL_LESS); 216 glDepthFunc (GL_LESS);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines