1 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
2 --- ParaView-5.9.0_SRC_orig/Remoting/Views/Resources/utilities_remotingviews.xml
3 +++ ParaView-5.9.0_SRC_modif/Remoting/Views/Resources/utilities_remotingviews.xml
5 <DoubleVectorProperty name="PolygonOffsetParameters"
6 command="SetPolygonOffsetParameters"
8 - default_values="0.0 0.0"
9 + default_values="2.0 2.0"
10 panel_visibility="advanced">
11 <DoubleRangeDomain name="range" />
14 <DoubleVectorProperty name="LineOffsetParameters"
15 command="SetLineOffsetParameters"
16 number_of_elements="2"
17 - default_values="0.0 -4"
18 + default_values="1.0 1.0"
19 panel_visibility="advanced">
20 <DoubleRangeDomain name="range" />
23 <DoubleVectorProperty name="PointOffsetParameter"
24 command="SetPointOffsetParameter"
25 number_of_elements="1"
28 panel_visibility="advanced">
29 <DoubleRangeDomain name="range" />
31 diff -Naur ParaView-5.9.0_SRC_orig/VTK/Rendering/Core/vtkMapper.cxx ParaView-5.9.0_SRC_modif/VTK/Rendering/Core/vtkMapper.cxx
32 --- ParaView-5.9.0_SRC_orig/VTK/Rendering/Core/vtkMapper.cxx
33 +++ ParaView-5.9.0_SRC_modif/VTK/Rendering/Core/vtkMapper.cxx
35 static double vtkMapperGlobalResolveCoincidentTopologyZShift = 0.01;
36 static int vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetFaces = 1;
38 -static double vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetFactor = 0.0;
39 -static double vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetUnits = 0.0;
40 -static double vtkMapperGlobalResolveCoincidentTopologyLineOffsetFactor = 0.0;
41 -static double vtkMapperGlobalResolveCoincidentTopologyLineOffsetUnits = -4.0;
42 -static double vtkMapperGlobalResolveCoincidentTopologyPointOffsetUnits = -8.0;
43 +static double vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetFactor = 2.0;
44 +static double vtkMapperGlobalResolveCoincidentTopologyPolygonOffsetUnits = 2.0;
45 +static double vtkMapperGlobalResolveCoincidentTopologyLineOffsetFactor = 1.0;
46 +static double vtkMapperGlobalResolveCoincidentTopologyLineOffsetUnits = 1.0;
47 +static double vtkMapperGlobalResolveCoincidentTopologyPointOffsetUnits = 0.0;
49 vtkCxxSetObjectMacro(vtkMapper, Selection, vtkSelection);
51 diff -Naur ParaView-5.9.0_SRC_orig/VTK/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx ParaView-5.9.0_SRC_modif/VTK/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx
52 --- ParaView-5.9.0_SRC_orig/VTK/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx
53 +++ ParaView-5.9.0_SRC_modif/VTK/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx
54 @@ -2430,42 +2430,26 @@
56 std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
58 - if (ren->GetActiveCamera()->GetParallelProjection())
60 - vtkShaderProgram::Substitute(FSSource, "//VTK::Coincident::Dec", "uniform float cCValue;");
61 - if (this->DrawingTubesOrSpheres(*this->LastBoundBO, actor))
63 - vtkShaderProgram::Substitute(
64 - FSSource, "//VTK::Depth::Impl", "gl_FragDepth = gl_FragDepth + cCValue;\n");
68 - vtkShaderProgram::Substitute(
69 - FSSource, "//VTK::Depth::Impl", "gl_FragDepth = gl_FragCoord.z + cCValue;\n");
73 + vtkShaderProgram::Substitute(FSSource, "//VTK::Coincident::Dec",
74 + "uniform float cfactor;\n"
75 + "uniform float coffset;");
76 + vtkShaderProgram::Substitute(
78 + "//VTK::UniformFlow::Impl",
79 + "float cscale = length(vec2(dFdx(gl_FragCoord.z),dFdy(gl_FragCoord.z)));\n"
80 + " //VTK::UniformFlow::Impl\n" // for other replacements
82 + vtkShaderProgram::Substitute(FSSource, "//VTK::Depth::Impl",
83 + "gl_FragDepth = gl_FragCoord.z + cfactor*cscale + 0.000016*coffset;\n");
87 - vtkShaderProgram::Substitute(FSSource, "//VTK::Coincident::Dec",
88 - "uniform float cCValue;\n"
89 - "uniform float cSValue;\n"
90 - "uniform float cDValue;");
91 - if (this->DrawingTubesOrSpheres(*this->LastBoundBO, actor))
93 - vtkShaderProgram::Substitute(FSSource, "//VTK::Depth::Impl",
94 - "float Zdc = gl_FragDepth*2.0 - 1.0;\n"
95 - " float Z2 = -1.0*cDValue/(Zdc + cCValue) + cSValue;\n"
96 - " float Zdc2 = -1.0*cCValue - cDValue/Z2;\n"
97 - " gl_FragDepth = Zdc2*0.5 + 0.5;\n");
101 - vtkShaderProgram::Substitute(FSSource, "//VTK::Depth::Impl",
102 - "float Zdc = gl_FragCoord.z*2.0 - 1.0;\n"
103 - " float Z2 = -1.0*cDValue/(Zdc + cCValue) + cSValue;\n"
104 - " float Zdc2 = -1.0*cCValue - cDValue/Z2;\n"
105 - " gl_FragDepth = Zdc2*0.5 + 0.5;\n");
107 + vtkShaderProgram::Substitute(FSSource, "//VTK::Coincident::Dec",
108 + "uniform float coffset;");
109 + vtkShaderProgram::Substitute(
110 + FSSource, "//VTK::Depth::Impl", "gl_FragDepth = gl_FragCoord.z + 0.000016*coffset;\n");
112 shaders[vtkShader::Fragment]->SetSource(FSSource);
114 @@ -2586,14 +2570,13 @@
115 // Have the renderpasses changed?
116 vtkMTimeType renderPassMTime = this->GetRenderPassStageMTime(actor);
118 - vtkOpenGLCamera* cam = (vtkOpenGLCamera*)(ren->GetActiveCamera());
120 // shape of input data changed?
121 float factor, offset;
122 this->GetCoincidentParameters(ren, actor, factor, offset);
123 unsigned int scv = (this->CurrentInput->GetPointData()->GetNormals() ? 0x01 : 0) +
124 (this->HaveCellScalars ? 0x02 : 0) + (this->HaveCellNormals ? 0x04 : 0) +
125 - ((cam->GetParallelProjection() != 0.0) ? 0x08 : 0) + ((offset != 0.0) ? 0x10 : 0) +
126 + ((factor != 0.0) ? 0x08 : 0) + ((offset != 0.0) ? 0x10 : 0) +
127 (this->VBOs->GetNumberOfComponents("scalarColor") ? 0x20 : 0) +
128 (vtkOpenGLRenderer::SafeDownCast(ren)->GetUseSphericalHarmonics() ? 0x40 : 0) +
129 (actor->GetProperty()->GetCoatStrength() > 0.0 ? 0x80 : 0) +
130 @@ -2910,6 +2893,19 @@
131 lineWidth[1] = 2.0 * propLineWidth / vp[3];
132 cellBO.Program->SetUniform2f("lineWidthNVC", lineWidth);
135 + // handle coincident
136 + if (cellBO.Program->IsUniformUsed("coffset"))
138 + float factor, offset;
139 + this->GetCoincidentParameters(ren, actor,factor,offset);
140 + cellBO.Program->SetUniformf("coffset",offset);
141 + // cfactor isn't always used when coffset is.
142 + if (cellBO.Program->IsUniformUsed("cfactor"))
144 + cellBO.Program->SetUniformf("cfactor", factor);
147 vtkOpenGLCheckErrorMacro("failed after UpdateShader");
150 @@ -2995,25 +2991,6 @@
154 - // handle coincident
155 - if (cellBO.Program->IsUniformUsed("cCValue"))
157 - float diag = actor->GetLength();
158 - float factor, offset;
159 - this->GetCoincidentParameters(ren, actor, factor, offset);
160 - if (cam->GetParallelProjection())
162 - // one unit of offset is based on 1/1000 of bounding length
163 - cellBO.Program->SetUniformf("cCValue", -2.0 * 0.001 * diag * offset * vcdc->GetElement(2, 2));
167 - cellBO.Program->SetUniformf("cCValue", vcdc->GetElement(2, 2));
168 - cellBO.Program->SetUniformf("cDValue", vcdc->GetElement(3, 2));
169 - cellBO.Program->SetUniformf("cSValue", -0.001 * diag * offset);
173 vtkNew<vtkMatrix3x3> env;
174 if (program->IsUniformUsed("envMatrix"))