]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
Patch ParaView 5.9 with an adapted file get from the previous one pv_coincident.patch
authorQuentin Cozette <quentin.cozette@cea.fr>
Wed, 14 Apr 2021 15:14:49 +0000 (17:14 +0200)
committerQuentin Cozette <quentin.cozette@cea.fr>
Wed, 14 Apr 2021 15:14:49 +0000 (17:14 +0200)
applications/SALOME-master-native.pyconf
products/ParaView.pyconf
products/patches/paraview.0008-ParaView_coincident_rendering.patch [new file with mode: 0644]

index ff9f95b0ae9cbe43f178433ee7f7d9e7defc196d..ba85fbb7120f11d4723c34880a1486563e0f9a08 100644 (file)
@@ -202,7 +202,8 @@ __overwrite__ :
       'PRODUCTS.ParaView.version_5_9_0.patches' : ['paraview.0003-ParaViewClient.patch',
                                                    'paraview.0005-ParaView_find_cgns.patch',
                                                    'paraview-0012-LATA_64BITS_IDS.patch',
-                                                   'ParaView-5.9.0-CATALYST_cmake.patch']
+                                                   'ParaView-5.9.0-CATALYST_cmake.patch',
+                                                   'paraview.0008-ParaView_coincident_rendering.patch']
    }
    {
       # On DB10, ParaView fails to find xmlpatterns executable : ParaViewClient.cmake try to find it
@@ -216,7 +217,8 @@ __overwrite__ :
                                                    'paraview-0012-LATA_64BITS_IDS.patch',
                                                    'paraview-5.9_qt-minimum-version.patch',
                                                    'paraview.0003-ParaViewClient_native.patch',
-                                                   'ParaView-5.9.0-CATALYST_cmake.patch']
+                                                   'ParaView-5.9.0-CATALYST_cmake.patch',
+                                                   'paraview.0008-ParaView_coincident_rendering.patch']
    }
    {
       # CentOS 8 repositories don't include sphinxintl package which must be installed through pip.
index 64e152564970d053bbd243be6d0819b8a3ce476d..766f3fe7a0991666ddede6f0d0ef4bde4cbe71e2 100755 (executable)
@@ -41,7 +41,8 @@ version_5_9_0 :
                'paraview.0006-ParaView_find_libxml2.patch',
                'paraview.0007-ParaView_find_freetype.patch',
                'paraview-0012-LATA_64BITS_IDS.patch',
-               'ParaView-5.9.0-CATALYST_cmake.patch'
+               'ParaView-5.9.0-CATALYST_cmake.patch',
+               'paraview.0008-ParaView_coincident_rendering.patch'
               ]
 }
 
@@ -55,7 +56,8 @@ version_5_9_0_int32 :
                'paraview.0005-ParaView_find_cgns.patch',
                'paraview.0006-ParaView_find_libxml2.patch',
                'paraview.0007-ParaView_find_freetype.patch',
-               'ParaView-5.9.0-CATALYST_cmake.patch'
+               'ParaView-5.9.0-CATALYST_cmake.patch',
+               'paraview.0008-ParaView_coincident_rendering.patch'
               ]
 }
 
@@ -83,7 +85,8 @@ version_5_9_0_win :
                'paraview.0007-ParaView_find_freetype.patch',
                'paraview.0008-ParaView_find_zlib.patch',
                'paraview-0012-LATA_64BITS_IDS.patch',
-               'ParaView-5.9.0-CATALYST_cmake.patch'
+               'ParaView-5.9.0-CATALYST_cmake.patch',
+               'paraview.0008-ParaView_coincident_rendering.patch'
               ]
 }
 
@@ -110,7 +113,8 @@ version_5_9_0_win_int32 :
                'paraview.0006-ParaView_find_libxml2.patch',
                'paraview.0007-ParaView_find_freetype.patch',
                'paraview.0008-ParaView_find_zlib.patch',
-               'ParaView-5.9.0-CATALYST_cmake.patch'
+               'ParaView-5.9.0-CATALYST_cmake.patch',
+               'paraview.0008-ParaView_coincident_rendering.patch'
               ]
 }
 
@@ -125,7 +129,8 @@ version_5_9_0_MPI :
                'paraview.0007-ParaView_find_freetype.patch',
                'paraview-5.9-VTKM_MPI.patch',
                'paraview-0012-LATA_64BITS_IDS.patch',
-               'ParaView-5.9.0-CATALYST_cmake.patch'
+               'ParaView-5.9.0-CATALYST_cmake.patch',
+               'paraview.0008-ParaView_coincident_rendering.patch'
               ]
 }
 
@@ -139,7 +144,8 @@ version_5_9_0_MPI_int32 :
                'paraview.0006-ParaView_find_libxml2.patch',
                'paraview.0007-ParaView_find_freetype.patch',
                'paraview-5.9-VTKM_MPI.patch',
-               'ParaView-5.9.0-CATALYST_cmake.patch'
+               'ParaView-5.9.0-CATALYST_cmake.patch',
+               'paraview.0008-ParaView_coincident_rendering.patch'
               ]
 }
 
diff --git a/products/patches/paraview.0008-ParaView_coincident_rendering.patch b/products/patches/paraview.0008-ParaView_coincident_rendering.patch
new file mode 100644 (file)
index 0000000..a1e25e7
--- /dev/null
@@ -0,0 +1,176 @@
+diff -Naur ParaView-5.9.0_SRC_orig/Remoting/Views/Resources/utilities_remotingviews.xml ParaView-5.9.0_SRC_modif/Remoting/Views/Resources/utilities_remotingviews.xml
+--- ParaView-5.9.0_SRC_orig/Remoting/Views/Resources/utilities_remotingviews.xml
++++ ParaView-5.9.0_SRC_modif/Remoting/Views/Resources/utilities_remotingviews.xml
+@@ -31,7 +31,7 @@
+       <DoubleVectorProperty name="PolygonOffsetParameters"
+         command="SetPolygonOffsetParameters"
+         number_of_elements="2"
+-        default_values="0.0 0.0"
++        default_values="2.0 2.0"
+         panel_visibility="advanced">
+         <DoubleRangeDomain name="range" />
+         <Documentation>
+@@ -51,7 +51,7 @@
+       <DoubleVectorProperty name="LineOffsetParameters"
+         command="SetLineOffsetParameters"
+         number_of_elements="2"
+-        default_values="0.0 -4"
++        default_values="1.0 1.0"
+         panel_visibility="advanced">
+         <DoubleRangeDomain name="range" />
+         <Documentation>
+@@ -66,7 +66,7 @@
+       <DoubleVectorProperty name="PointOffsetParameter"
+         command="SetPointOffsetParameter"
+         number_of_elements="1"
+-        default_values="-8"
++        default_values="0"
+         panel_visibility="advanced">
+         <DoubleRangeDomain name="range" />
+         <Documentation>
+diff -Naur ParaView-5.9.0_SRC_orig/VTK/Rendering/Core/vtkMapper.cxx ParaView-5.9.0_SRC_modif/VTK/Rendering/Core/vtkMapper.cxx
+--- ParaView-5.9.0_SRC_orig/VTK/Rendering/Core/vtkMapper.cxx
++++ ParaView-5.9.0_SRC_modif/VTK/Rendering/Core/vtkMapper.cxx
+@@ -36,11 +36,11 @@
+ static double vtkMapperGlobalResolveCoincidentTopologyZShift = 0.01;
+ static int vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetFaces = 1;
+-static double vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetFactor = 0.0;
+-static double vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetUnits = 0.0;
+-static double vtkMapperGlobalResolveCoincidentTopologyLineOffsetFactor = 0.0;
+-static double vtkMapperGlobalResolveCoincidentTopologyLineOffsetUnits = -4.0;
+-static double vtkMapperGlobalResolveCoincidentTopologyPointOffsetUnits = -8.0;
++static double vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetFactor = 2.0;
++static double vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetUnits = 2.0;
++static double vtkMapperGlobalResolveCoincidentTopologyLineOffsetFactor = 1.0;
++static double vtkMapperGlobalResolveCoincidentTopologyLineOffsetUnits = 1.0;
++static double vtkMapperGlobalResolveCoincidentTopologyPointOffsetUnits = 0.0;
+ vtkCxxSetObjectMacro(vtkMapper, Selection, vtkSelection);
+diff -Naur ParaView-5.9.0_SRC_orig/VTK/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx ParaView-5.9.0_SRC_modif/VTK/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx
+--- ParaView-5.9.0_SRC_orig/VTK/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx
++++ ParaView-5.9.0_SRC_modif/VTK/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx
+@@ -2430,42 +2430,26 @@
+   {
+     std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
+-    if (ren->GetActiveCamera()->GetParallelProjection())
+-    {
+-      vtkShaderProgram::Substitute(FSSource, "//VTK::Coincident::Dec", "uniform float cCValue;");
+-      if (this->DrawingTubesOrSpheres(*this->LastBoundBO, actor))
+-      {
+-        vtkShaderProgram::Substitute(
+-          FSSource, "//VTK::Depth::Impl", "gl_FragDepth = gl_FragDepth + cCValue;\n");
+-      }
+-      else
+-      {
+-        vtkShaderProgram::Substitute(
+-          FSSource, "//VTK::Depth::Impl", "gl_FragDepth = gl_FragCoord.z + cCValue;\n");
+-      }
++    if (factor != 0.0)
++    {
++      vtkShaderProgram::Substitute(FSSource, "//VTK::Coincident::Dec", 
++        "uniform float cfactor;\n"
++        "uniform float coffset;");
++       vtkShaderProgram::Substitute(
++        FSSource, 
++        "//VTK::UniformFlow::Impl",
++        "float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));\n"
++        "  //VTK::UniformFlow::Impl\n" // for other replacements
++        );
++        vtkShaderProgram::Substitute(FSSource, "//VTK::Depth::Impl",
++        "gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;\n");
+     }
+     else
+     {
+-      vtkShaderProgram::Substitute(FSSource, "//VTK::Coincident::Dec",
+-        "uniform float cCValue;\n"
+-        "uniform float cSValue;\n"
+-        "uniform float cDValue;");
+-      if (this->DrawingTubesOrSpheres(*this->LastBoundBO, actor))
+-      {
+-        vtkShaderProgram::Substitute(FSSource, "//VTK::Depth::Impl",
+-          "float Zdc = gl_FragDepth*2.0 - 1.0;\n"
+-          "  float Z2 = -1.0*cDValue/(Zdc + cCValue) + cSValue;\n"
+-          "  float Zdc2 = -1.0*cCValue - cDValue/Z2;\n"
+-          "  gl_FragDepth = Zdc2*0.5 + 0.5;\n");
+-      }
+-      else
+-      {
+-        vtkShaderProgram::Substitute(FSSource, "//VTK::Depth::Impl",
+-          "float Zdc = gl_FragCoord.z*2.0 - 1.0;\n"
+-          "  float Z2 = -1.0*cDValue/(Zdc + cCValue) + cSValue;\n"
+-          "  float Zdc2 = -1.0*cCValue - cDValue/Z2;\n"
+-          "  gl_FragDepth = Zdc2*0.5 + 0.5;\n");
+-      }
++       vtkShaderProgram::Substitute(FSSource, "//VTK::Coincident::Dec",
++        "uniform float coffset;");
++      vtkShaderProgram::Substitute(
++        FSSource, "//VTK::Depth::Impl", "gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;\n");
+     }
+     shaders[vtkShader::Fragment]->SetSource(FSSource);
+   }
+@@ -2586,14 +2570,13 @@
+   // Have the renderpasses changed?
+   vtkMTimeType renderPassMTime = this->GetRenderPassStageMTime(actor);
+-  vtkOpenGLCamera* cam = (vtkOpenGLCamera*)(ren->GetActiveCamera());
+   // shape of input data changed?
+   float factor, offset;
+   this->GetCoincidentParameters(ren, actor, factor, offset);
+   unsigned int scv = (this->CurrentInput->GetPointData()->GetNormals() ? 0x01 : 0) +
+     (this->HaveCellScalars ? 0x02 : 0) + (this->HaveCellNormals ? 0x04 : 0) +
+-    ((cam->GetParallelProjection() != 0.0) ? 0x08 : 0) + ((offset != 0.0) ? 0x10 : 0) +
++    ((factor != 0.0) ? 0x08 : 0) + ((offset != 0.0) ? 0x10 : 0) +
+     (this->VBOs->GetNumberOfComponents("scalarColor") ? 0x20 : 0) +
+     (vtkOpenGLRenderer::SafeDownCast(ren)->GetUseSphericalHarmonics() ? 0x40 : 0) +
+     (actor->GetProperty()->GetCoatStrength() > 0.0 ? 0x80 : 0) +
+@@ -2910,6 +2893,19 @@
+     lineWidth[1] = 2.0 * propLineWidth / vp[3];
+     cellBO.Program->SetUniform2f("lineWidthNVC", lineWidth);
+   }
++   
++  // handle coincident
++  if (cellBO.Program->IsUniformUsed("coffset"))
++  {
++    float factor, offset;
++    this->GetCoincidentParameters(ren, actor,factor,offset);
++    cellBO.Program->SetUniformf("coffset",offset);
++    // cfactor isn't always used when coffset is.
++    if (cellBO.Program->IsUniformUsed("cfactor"))
++    {
++      cellBO.Program->SetUniformf("cfactor", factor);
++    }
++  }
+   vtkOpenGLCheckErrorMacro("failed after UpdateShader");
+ }
+@@ -2995,25 +2991,6 @@
+     }
+   }
+-  // handle coincident
+-  if (cellBO.Program->IsUniformUsed("cCValue"))
+-  {
+-    float diag = actor->GetLength();
+-    float factor, offset;
+-    this->GetCoincidentParameters(ren, actor, factor, offset);
+-    if (cam->GetParallelProjection())
+-    {
+-      // one unit of offset is based on 1/1000 of bounding length
+-      cellBO.Program->SetUniformf("cCValue", -2.0 * 0.001 * diag * offset * vcdc->GetElement(2, 2));
+-    }
+-    else
+-    {
+-      cellBO.Program->SetUniformf("cCValue", vcdc->GetElement(2, 2));
+-      cellBO.Program->SetUniformf("cDValue", vcdc->GetElement(3, 2));
+-      cellBO.Program->SetUniformf("cSValue", -0.001 * diag * offset);
+-    }
+-  }
+-
+   vtkNew<vtkMatrix3x3> env;
+   if (program->IsUniformUsed("envMatrix"))
+   {
+