Notes |
|
(0012999)
|
Ken Moreland
|
2008-08-13 11:19
|
|
The issue is with how the glPolygonOffset feature works. The polygon offset works by offseting by a constant amount plus some amount proportional to the slope of the polygon in the Z direction. As polygons approach perpendicular to the view plane, their Z slope approaches infinity. This is causing the offset wireframes to pop in front of surfaces they should be behind. It is possible to reverse the offset: push filled polygons back instead of wireframes forward. This approach does not work well either because polygons at corners often get pushed back far enough to let the back facing polygon show through. (I think Utkarsh tried to explain this to me at one point, but I didn't get it at the time.)
I looked at VisIt's wireframe and it does not seem to have the same problem. After looking at its source code a little bit, I think it is shifting the wireframe a constant amount to the front using a standard OpenGL matrix transformation. I will look into making a painter that does that. |
|
|
(0013051)
|
Ken Moreland
|
2008-08-18 12:48
|
|
Changed the topology resolution function to use a constant Z-shift to get around the issue with the z-slope offset in glPolygonOffset.
The original Z-shift code in vtkOpenGLCoincidentTopologyResolutionPainter would place lines and polygons at the same offset and triangle strips at a different offset (WTF?). I fixed that to place vertices in front of lines/wireframes in front of polygons/triangle strips.
Instead of using glDepthRange to perform the Z-shift, I add a transformation to the perspective matrix in front of the perspective transform. It seems to work a little better.
I changed the order of painter in the default painter to place the coincident topology painter after the representation painter. That way it could perform the appropriate Z-shift for the wireframe part when the representation was set to both surface and wireframe.
/cvsroot/ParaView3/ParaView3/Servers/Common/vtkProcessModule.cxx,v <-- Servers/Common/vtkProcessModule.cxx
new revision: 1.86; previous revision: 1.85
/cvsroot/ParaView3/ParaView3/VTK/Rendering/vtkDefaultPainter.cxx,v <-- VTK/Rendering/vtkDefaultPainter.cxx
new revision: 1.10; previous revision: 1.9
/cvsroot/ParaView3/ParaView3/VTK/Rendering/vtkOpenGLCoincidentTopologyResolutionPainter.cxx,v <-- VTK/Rendering/vtkOpenGLCoincidentTopologyResolutionPainter.cxx
new revision: 1.7; previous revision: 1.6
/cvsroot/ParaView3/ParaView3/VTK/Rendering/vtkOpenGLCoincidentTopologyResolutionPainter.h,v <-- VTK/Rendering/vtkOpenGLCoincidentTopologyResolutionPainter.h
new revision: 1.4; previous revision: 1.3
/cvsroot/ParaView3/ParaViewData/Baseline/ExtractGrid.png,v <-- ExtractGrid.png
new revision: 1.3; previous revision: 1.2
/cvsroot/ParaView3/ParaViewData/Baseline/UndoRedo2.png,v <-- UndoRedo2.png
new revision: 1.3; previous revision: 1.2 |
|
|
(0013095)
|
Alan Scott
|
2008-08-19 20:04
|
|
Excellent! Tested client/server |
|