MantisBT - ParaView
View Issue Details
0006658ParaView(No Category)public2008-03-25 21:302009-05-13 13:59
Alan Scott 
Ken Moreland 
normalminoralways
closedfixed 
 
3.43.4 
0006658: Surface with edges bleeds through solids
XP, trunk.

Start ParaView.
Open can.
Surface with Edges
Hit the Z- View direction icon. (you are now looking at the bottom of the plate.)
Animate.

Notice that the can will bleed the edge lines through the bottom plate. This is not just a z-buffer precision problem - this should not happen. Happens when hardware rendered locally or remote render composited.

Probably not a drop dead error, but makes surface with edges useless for any presentations.

No tags attached.
related to 0006804closed Ken Moreland Select cells through causes artifacts 
Issue History
2008-03-25 21:30Alan ScottNew Issue
2008-04-10 17:41Ken MorelandStatusbacklog => tabled
2008-04-10 17:41Ken MorelandAssigned To => Berk Geveci
2008-04-15 10:38Ken MorelandRelationship addedrelated to 0006804
2008-05-15 13:45Utkarsh AyachitAssigned ToBerk Geveci => Ken Moreland
2008-08-13 11:19Ken MorelandNote Added: 0012999
2008-08-18 12:48Ken MorelandStatustabled => @80@
2008-08-18 12:48Ken MorelandResolutionopen => fixed
2008-08-18 12:48Ken MorelandNote Added: 0013051
2008-08-19 20:04Alan ScottStatus@80@ => closed
2008-08-19 20:04Alan ScottNote Added: 0013095
2009-05-13 13:58Utkarsh AyachitTarget Version => 3.4
2009-05-13 13:59Utkarsh AyachitFixed in Version => 3.4
2011-06-16 13:10Zack GalbreathCategory => (No Category)

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