# Use antialiasing only on some actors

**URL:** https://discourse.vtk.org/t/use-antialiasing-only-on-some-actors/3500
**Category:** Support
**Created:** [June 9, 2020, 3:12pm UTC](https://discourse.vtk.org/t/use-antialiasing-only-on-some-actors/3500 "2020-06-09T15:12:25Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [June 9, 2020, 3:12pm UTC](https://discourse.vtk.org/t/use-antialiasing-only-on-some-actors/3500/1 "2020-06-09T15:12:26Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Michael](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael/32/16_2.png) [@Michael](https://discourse.vtk.org/u/Michael)
#### Post date: [June 10, 2020, 6:55am UTC](https://discourse.vtk.org/t/use-antialiasing-only-on-some-actors/3500/2 "2020-06-10T06:55:16Z")

</div>

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](https://vtk.org/Wiki/VTK/MultiPass_Rendering)

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [June 10, 2020, 9:31am UTC](https://discourse.vtk.org/t/use-antialiasing-only-on-some-actors/3500/3 "2020-06-10T09:31:28Z")

</div>

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](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](https://discourse.vtk.org/t/glitches-when-passing-from-qvtkwidget-to-qvtkopenglwidget/3068/6) 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).

---

<div class="post-metadata">

### Author: ![Michael](https://discourse.vtk.org/user_avatar/discourse.vtk.org/michael/32/16_2.png) [@Michael](https://discourse.vtk.org/u/Michael)
#### Post date: [June 10, 2020, 9:50am UTC](https://discourse.vtk.org/t/use-antialiasing-only-on-some-actors/3500/4 "2020-06-10T09:50:58Z")

</div>

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

What are the VTK objects used for the tiles?

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [June 10, 2020, 10:09am UTC](https://discourse.vtk.org/t/use-antialiasing-only-on-some-actors/3500/5 "2020-06-10T10:09:19Z")

</div>

@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 !

---

<div class="post-metadata">

### Author: ![embeddedmz](https://discourse.vtk.org/user_avatar/discourse.vtk.org/embeddedmz/32/12_2.png) [@embeddedmz](https://discourse.vtk.org/u/embeddedmz)
#### Post date: [June 10, 2020, 3:01pm UTC](https://discourse.vtk.org/t/use-antialiasing-only-on-some-actors/3500/6 "2020-06-10T15:01:28Z")

</div>

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.
