Use antialiasing only on some actors

Hi,

The title says it all : is it possible to use antialiasing only on some render window objects (e.g. a vtkPolyData).

I’m using PNG image as textures for planes and antialisaing is modifiying their borders.

Thanks.

Hi,
You can use different render passes and apply an FXAA pass on a specific render pass only.
See https://vtk.org/Wiki/VTK/MultiPass_Rendering

1 Like

Hi @Michael

Thank you for you excellent reply.

Can you please look at this implementation of a class derived from vtkRenderPass https://github.com/OpenGeoscience/vtkMap/blob/master/core/vtkGeoMapLayerPass.cxx and tell me where I can control FXAA stuff ?

The file above is from a slippy geo map based on VTK, I want to disable anti-aliasing on map tiles (PNG images) but keep anti-aliasing for colored lines (vtkPolyData) / map markers.

I think your reply gave me a hint (the file) to fix this bug related to the Qt widget with recent VTK versions (>= 8.2.0) Glitches when passing from QVTKWidget to QVTKOpenGLWidget but I still don’t have the knowledge required for that task.

Otherwise, It’s sad that, in 2020, I have to rely on an abandoned and buggy project (vtkMap) to have a slippy map for a C++ desktop application (that is also shipped in the product that my company manufactures). The right tools are only available for web and mobile platforms (e.g. Google Maps in Android), in Qt there’s the Qt Location module but I don’t know QML, I don’t have time to learn it, to master it enough to migrate the stuff I have already implemented with vtkMap and I don’t want to add another language to increase the software entropy (that keeps increasing with the all the unnecessary bullshit that the IT people are creating).

You can have a look at how I manage FXAA in F3D: https://gitlab.kitware.com/f3d/f3d/-/blob/master/src/vtkF3DRenderer.cxx#L282

What are the VTK objects used for the tiles?

@Michael

I will try to look at your file this afternoon.

vtkOsmLayer is the layer that contains OpenStreetMaps (Osm) tiles.

vtkOsmLayer is a feature layer, vtkFeatureLayer has an array of features (vtkFeature)

A tile is defined in vtkMapTile which is a layer feature (vtkFeature), a vtkFeature has this method vtkProp* PickProp();

So, in vtkGeoMapLayerPass, I guess, we have to determine to which vtkFeature a vtkProp belongs (I can work that) and disable the antialiasing on the vtkProp am I right ? So if you can give me a pseudo code, I can fix that.

Thanks !

Do I need this class vtkOpenGLFXAAPass ?

In vtkMap.h

vtkSmartPointer<vtkRenderPassCollection> LayerCollection;
vtkSmartPointer<vtkSequencePass> LayerSequence;
vtkSmartPointer<vtkCameraPass> CameraPass;

In vtkMap::Initialize() is where the renderer’s pass is set.