Rendering artifacts when zoomed in and no point normals are associated with geometry
If you zoom in far enough in a VTK render window when the camera is using parallel projection and the visibility geometry does not have normals associated with its points, you may see a speckled pattern. This is most easily reproduced in ParaView:
- Start ParaView
- Load the can.ex2 example dataset
- Turn on the Camera Parallel Projection property.
- Use the right mouse button to zoom in. A pattern like the following will appear:
From a discussion with @ken-martin, the likely cause is the polygon surface normal calculation made in the fragment shader used by the mapper when no normals are provided. This calculation relies on the dfdx and dfdy builtin variables, and Ken’s suspicion is that these take on wonky values when you are zoomed way in. Possible solution: compute polygon normal in the geometry shader instead of using dfdx/dfdy. Tradeoff in performance - fragment shader should be faster because logic in there will be removed, but the addition of a geometry shader may slow things down.