[vtkusers] Mesh visualization

Patrick Lagace plagace at giref.ulaval.ca
Mon Jul 10 16:28:15 EDT 2000


> In response to Patrick Lagace's request I've added a flag in vtkMapper to address the issue of
> rendering coincident points/lines on top of polygons. I did not use Patrick's glPolygonOffset()
> call (which works splendidly with lines) but rather I used the glDepthRange() to adjust z-buffer
> mapping. (Bob Obara at Simmetrix actually was the one who implemented it initially.) The reason
> that I did not use the glPolygonOffset() approach is because it did not address the point/line
> coincident problem, that is, you might want to show points on top of lines on top of polygons.

I see your point... but I've tried the glDepthRange() method (i've looked at the cvs code, and
coded a quick fix to my app to see if the method was visually acceptable)

My conclusions:
   -With a low offset ( < 0.01) , glDepthRange(offset,1) we still have the "visual artifacts" of
coincident primitives intersection.  90% of the mesh is "clean" (i mean, all is visually Ok,  but
some slanted surfaces are really not "perfect" and are still showing "dashed lines").
  -With a high offset ( > 0.01),  the coincident primitives bug does not show up, be we have
another type of visual artifact: some lines from surfaces very close behind some polygons show
through it.

Maybe there is an "ideal value" for the glDepthRange offset but I do not manage to find one.  I've
tried the newly commited "zRes" calculation from vtkOpenGLPolyDataMapper

GLint size;
glGetIntegerv(GL_DEPTH_BITS, &size);
float zRes = 1.0 / ((double)(1<<size));

the computed value ( in my case, 3.7e-9 ) seems _very_ low and do not remove any visual artifacts.


???  I propose a double solution:   using  glPolygonOffset for the polygons,  and glDepthRange for
the points.

?

Patrick Lagacé
plagace at giref.ulaval.ca





More information about the vtkusers mailing list