Thank you very much for your response. I will investigate the MSAA.
In aerospace, everyone uses Parallel Projection. I am surprised there is not more discussion of this issue. The issue affects recent versions of ParaView. Note the checkbox in the lower left. You can see the problem with any example if you zoom in on a small part. Do you have any advice for ParaView users?
If you load this into ParaView, and then rotate so the lighting is like this, then zoom in on the small triangle, then roll the mouse wheel forwards about 3 times, you should see the unwanted artifacts.
If that’s the case, then we’re talking about Z-fighting and not Moiré patterns. Z-fighting or depth-fighting is a symptom of a problem in the model (coplanar surfaces). If this is indeed Z-fighting, then the OP likely needs to fix or adjust his geometry before rendering.
You don’t have to use the vtk file I posted. I included the triangle just for convenience, to show how far you have to zoom in. (For a typical aircraft, if you zoom in on the trailing edge of a wing, the artifacts are horrific). You can use the standard uGridEx.vtk (or any other file) with Parallel Projection, and zoom in. It helps if you rotate the model so the lighting is at an angle, as shown here (note the xyz triad in the lower left).
Here is an example of zooming in, but most any other zoom in will also work.
A fix was attempted, but it appears to not work perfectly.
A workaround is to add/compute surface normals on the geometry. That uses a different rendering path where the surface normal of the polygons doesn’t need to be calculated in the shader.
Next, I switch off the visibility of the original surfaces, and switch on the visibility of GenerateSurfaceNormals1. We see the problem goes away. I used the default settings shown in the image – is that right?
Cory, thanks again for the info. You mentioned “A fix was attempted, but it appears to not work perfectly.” Do you have a reference for that fix? Has anyone else tried to fix this? Currently we use vtkPolyDataNormals as a workaround, but speed is an issue. Has anyone written a version of vtkPolyDataNormals that uses GPU rather than CPU?
Cory, I got the latest VTK code from the master branch because @jaswantp said that the fix is not in VTK 9.3.1. Unfortunately the problem is still there. You can demonstrate this by using a vtkSphereSource to create a sphere with radius 0.00004 in a scene where there is at least one other object with size 1. I can provide a self-contained simple example if you like, but I thought it would be easier to describe it verbally. Do you have any advice for us? We cannot use vtkPolyDataNormals because it is too slow. I would think this would be a big issue for VTK because everyone in aerospace uses parallel projection, and if you zoom in on a small feature it looks terrible.
The aforementioned fix (11235) was a fix for overflow/underflow. It wasn’t a fix for precision, which seems to be the issue that is reported in this discussion.
Thanks for the info. The problem was not present in VTK 6.0.0. Is there any way to use some code or ideas from VTK 6.0.0 to address the current issue? We don’t want to go back to VTK 6.0.0 because of other performance issues, but at least it did not have this problem.
I’ve tried creating a scene with two spheres one centered at 0,0,0 with a radius of 1.0 and another at 3,0,0 with a radius of 0.00004. However, i’ve to get the smaller sphere in camera view programatically which is a bit awkward.
I understand it can be tiresome putting together a minimal example. It goes a long way in helping us exactly reprod the issue you’re facing. We could also use that code as a unit test to ensure the behaviour doesn’t regress in future versions.
Thank you very much for your response. In the attached example, there are two large cones with their points pointing at each other. You zoom in on that gap and you will see the small sphere there.
You can also demonstrate the problem using ParaView and, for example, the standard example weldedSpheres.vtk (or any other example with some small details), with “Camera Parallel Projection” checked. I find it useful to view “Surface With Edges” as shown in these two images.