diff --git a/ApplicationLibCode/ReservoirDataModel/RigGridBase.cpp b/ApplicationLibCode/ReservoirDataModel/RigGridBase.cpp index 1adbb1716b..fe38e3c80d 100644 --- a/ApplicationLibCode/ReservoirDataModel/RigGridBase.cpp +++ b/ApplicationLibCode/ReservoirDataModel/RigGridBase.cpp @@ -550,15 +550,23 @@ bool RigGridCellFaceVisibilityFilter::isFaceVisible( size_t return true; } - size_t neighborCellIndex = m_grid->cellIndexFromIJK( ni, nj, nk ); + // Do not show cell geometry if a fault is present to avoid z fighting between surfaces + // It will always be a better solution to avoid geometry creation instead of part priority and polygon offset + size_t nativeResvCellIndex = m_grid->reservoirCellIndex( cellIndex ); + const RigFault* fault = m_grid->mainGrid()->findFaultFromCellIndexAndCellFace( nativeResvCellIndex, face ); + if ( fault ) + { + return false; + } + size_t neighborCellIndex = m_grid->cellIndexFromIJK( ni, nj, nk ); // If the neighbour cell is invisible, we need to draw the face if ( ( cellVisibility != nullptr ) && !( *cellVisibility )[neighborCellIndex] ) { return true; } - // Do show the faces in the boarder between this grid and a possible LGR. Some of the LGR cells + // Do show the faces in the border between this grid and a possible LGR. Some of the LGR cells // might not be visible. if ( m_grid->mainGrid()->gridCount() > 1 && m_grid->cell( neighborCellIndex ).subGrid() ) {